Morphing Problems, Need Help With Ability Retention

AceLegend90

New Member
Reaction score
6
Hi, I've been stuck on this ability for awhile, and I've gone through all the possible ideas I could think of.

This is what the ability does: The ability morphs the target hero into another hero for so and so seconds. The morphed hero has no abilities (doesn't matter if his old skills are disabled or removed) except for a new ability that is an aura that turns other heroes in so and so range into the morphed hero as well. The units affected by the aura retain their abilities but not their life, mana, damage, armor, and attributes. After the original target hero turns back into himself again, I want him to be completely his old self with his abilities with any life/mana gains/losses and experience gains.

Now, I have the aura working fine except for that when the people in the aura turn back to their old selves, they have to redistribute their skill points.

I've approached this many, many ways already but couldn't come up with a solution, so I decided to post it on a forum.

Here's what I have for morphing the regular hero:
Code:
Victimize
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Victimize 
    Actions
        Set Victimize_UnitSP = (Unspent skill points of (Target unit of ability being cast))
        Set Point = (Player 1 (Red) start location)
        Unit - Create 1 (Unit-type of (Target unit of ability being cast)) for Player 1 (Red) at Point facing 0.00 degrees
        Custom script:   call RemoveLocation(udg_Point) 
        Set Victimize_UnitOriginal = (Last created unit)
        Unit - Replace (Target unit of ability being cast) with a Ghoul (morph) using The old unit's relative life and mana
        Set Victimize_Unit = (Last replaced unit)
        Hero - Modify unspent skill points of Victimize_Unit: Set to 0 points
        Unit - Add Victimize Aura  to Victimize_Unit
        Unit - Set level of Victimize Aura  for Victimize_Unit to 1
        Trigger - Turn on Victimize Aura <gen>
        Unit - Add a (11.00 + (10.00 x (Real((Level of Victimize  for (Triggering unit)))))) second Generic expiration timer to Victimize_Unit
        Wait (10.00 + (10.00 x (Real((Level of Victimize  for (Triggering unit)))))) seconds
        Unit - Replace Victimize_Unit with a (Unit-type of Victimize_UnitOriginal) using The old unit's relative life and mana
        Hero - Modify unspent skill points of (Last replaced unit): Set to Victimize_UnitSP points
        Unit - Remove Victimize_UnitOriginal from the game
        Wait 5.00 seconds
        Trigger - Turn off Victimize Aura <gen>

Here's what I have for the aura:
Code:
Victimize Aura
    Events
        Time - Every 0.25 seconds of game time
    Conditions
    Actions
        Set VictimizeAura_UnitsBuffed = (Units in (Playable map area) matching ((((Matching unit) has buff Victimize Aura ) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Ghoul (morph))))
        Set Index = 1
        Unit Group - Pick every unit in VictimizeAura_UnitsBuffed and do (Actions)
            Loop - Actions
                Unit - Create 1 (Unit-type of (Picked unit)) for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
                Set VictimizeAura_UnitsOriginal[Index] = (Last created unit)
                Unit - Set the custom value of (Picked unit) to Index
                Set Index = (Index + 1)
                Unit - Add Victimize Aura Morph  to (Picked unit)
                Unit - Set level of Victimize Aura Morph  for (Picked unit) to 1
        Set VictimizeAura_UnitsNotBuffed = (Units in (Playable map area) matching ((((Matching unit) has buff Victimize Aura ) Equal to False) and ((Unit-type of (Matching unit)) Equal to Ghoul (morph))))
        Custom script:   call DestroyGroup(udg_VictimizeAura_UnitsBuffed) 
        Unit Group - Pick every unit in VictimizeAura_UnitsNotBuffed and do (Actions)
            Loop - Actions
                Unit - Decrease level of Victimize Aura Morph  for (Picked unit)
                Unit - Remove Victimize Aura Morph  from (Picked unit)
                For each (Integer Index) from 1 to 4, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Custom value of (Picked unit)) Equal to Index
                            Then - Actions
                                Unit - Replace (Picked unit) with a (Unit-type of VictimizeAura_UnitsOriginal[Index]) using The old unit's relative life and mana
                                Unit - Remove VictimizeAura_UnitsOriginal[Index] from the game
                            Else - Actions
                                Do nothing
                Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
        Custom script:   call DestroyGroup(udg_VictimizeAura_UnitsNotBuffed)

Help is much appreciated!
 

iPeez

Hot food far all world wide!
Reaction score
165
You will have to use Game Chase, I don't know much about it. I am sure someone else can help you, but try play around with Game Chase triggers. Game Chase save imformation/data.
 
F

FViral

Guest
You might have to use Game Chase like iPeez said. I've never ever used them though.
Perhaps you could just hide the actual hero and create your victimized one, then when the effect is over just show the acutal hero and remove the created one. That should retain all the hero information.
 

AceLegend90

New Member
Reaction score
6
I've thought about using the Hide action, but can you make the on-screen icon for the hero go away?

Game Cache would be my last resort, especially because I don't know how to use them. If anyone could help me code this with a Game Cache, it'd be much appreciated.
 

AceLegend90

New Member
Reaction score
6
Okay, I've got the morph working by using the Hide method (I had to compromise and remove the morph's hero icon).

Now I have a problem with the aura... -_-

I've changed the aura code to this:
Code:
Victimize Aura
    Events
        Time - Every 0.25 seconds of game time
    Conditions
    Actions
        If (VictimizeAura_Index Equal to 1000) then do (Set VictimizeAura_Index = 1) else do (Do nothing)
        Set VictimizeAura_UnitsBuffed = (Units in (Playable map area) matching ((((Matching unit) has buff Victimize Aura ) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Ghoul (morph))))
        Unit Group - Pick every unit in VictimizeAura_UnitsBuffed and do (Actions)
            Loop - Actions
                Set VictimizeAura_UnitsOriginal[VictimizeAura_Index] = (Picked unit)
                Unit - Hide VictimizeAura_UnitsOriginal[VictimizeAura_Index]
                Set Point = (Position of VictimizeAura_UnitsOriginal[VictimizeAura_Index])
                Unit - Create 1 Ghoul (morph) for (Owner of VictimizeAura_UnitsOriginal[VictimizeAura_Index]) at Point facing (Facing of VictimizeAura_UnitsOriginal[VictimizeAura_Index]) degrees
                Custom script:   call RemoveLocation(udg_Point) 
                Unit - Set the custom value of (Last created unit) to VictimizeAura_Index
                Hero - Set (Last created unit) experience to (Hero experience of VictimizeAura_UnitsOriginal[VictimizeAura_Index]), Hide level-up graphics
                Set VictimizeAura_Index = (VictimizeAura_Index + 1)
        Custom script:   call DestroyGroup(udg_VictimizeAura_UnitsBuffed) 
        Set VictimizeAura_UnitsNotBuffed = (Units in (Playable map area) matching ((((Matching unit) has buff Victimize Aura ) Equal to False) and ((Unit-type of (Matching unit)) Equal to Ghoul (morph))))
        Unit Group - Pick every unit in VictimizeAura_UnitsNotBuffed and do (Actions)
            Loop - Actions
                For each (Integer VictimizeAura_Index) from 1 to 1000, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Custom value of (Picked unit)) Equal to VictimizeAura_Index
                            Then - Actions
                                Set Point = (Position of (Picked unit))
                                Unit - Move VictimizeAura_UnitsOriginal[VictimizeAura_Index] instantly to Point, facing (Facing of (Picked unit)) degrees
                                Custom script:   call RemoveLocation(udg_Point) 
                                Unit - Unhide VictimizeAura_UnitsOriginal[VictimizeAura_Index]
                                Unit - Remove (Picked unit) from the game
                                Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
                            Else - Actions
                                Do nothing
        Custom script:   call DestroyGroup(udg_VictimizeAura_UnitsNotBuffed)

The aura turns them into ghouls correctly but doesn't turn them back. Help is much appreciated!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top