Yoshii
New Member
- Reaction score
- 74
I seem to be to having a problem with my map I cant figure out.
In my map the player enter a circle which teleport him to a region where the game create an exact copy of the hero but with more stats, this is fine and working but as I reward for winning I want my hero to gain 30 stats for example; since I cannot create an item and have it drop on its death since I want +stats and not an item i made the following trigger.
ImageFight
and
it work but it can bug; if for example I summon a unit during the fight and it kill the cloned hero I do not gain stats since the condition unit type of killing= unit type of dying is false,
anyone got an idea go around this? I could disable the skill but thats not really what I want and there is no event such as "when your clone dies".anyone Got any good idea? Cant figure out how to make the game detect the clone to have died by me or my unit and then add stats.
I could probably have big trigger with if unit dies, if unit type of unit=hero 1 and if dying unit belong to computer then pick all hero within region and do same for all hero with an array but isnt there another possible way?
edit: nvm i fixed myself I stored the clone type in a variable and refer to it with a condition if its owner by a computer when it dies then pick all unit within special event and add X stats to hero
In my map the player enter a circle which teleport him to a region where the game create an exact copy of the hero but with more stats, this is fine and working but as I reward for winning I want my hero to gain 30 stats for example; since I cannot create an item and have it drop on its death since I want +stats and not an item i made the following trigger.
ImageFight
Trigger:
- Events
- Unit - A unit enters ImageRegion <gen>
- Conditions
- ((Owner of (Triggering unit)) controller) Equal to User
- ((Triggering unit) is A Hero) Equal to True
- Actions
- Unit Group - Pick every unit in (Units in ImageRegion <gen> owned by Player 11 (Dark Green)) and do (Actions)
- Loop - Actions
- Unit - Remove (Picked unit) from the game
- Loop - Actions
- Unit Group - Pick every unit in (Units in ImageRegion <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
- Loop - Actions
- Set AttributeImage[1] = (Strength of (Picked unit) (Exclude bonuses))
- Set AttributeImage[2] = (Agility of (Picked unit) (Exclude bonuses))
- Set AttributeImage[3] = (Intelligence of (Picked unit) (Exclude bonuses))
- Unit - Create 1 (Unit-type of (Picked unit)) for Player 11 (Dark Green) at (Center of Cloneposition <gen>) facing Default building facing degrees
- Hero - Modify Strength of (Last created unit): Set to (AttributeImage[1] x 5)
- Hero - Modify Agility of (Last created unit): Set to (AttributeImage[2] x 5)
- Hero - Modify Intelligence of (Last created unit): Set to (AttributeImage[3] x 5)
- Unit - Add Spell Immunity to (Last created unit)
- Loop - Actions
- Unit Group - Pick every unit in (Units in ImageRegion <gen> owned by Player 11 (Dark Green)) and do (Actions)
and
Trigger:
- Imagedeath
- Events
- Unit - A unit Dies
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Killing unit)) Equal to (Unit-type of (Dying unit))
- Then - Actions
- Hero - Modify Strength of (Killing unit): Add 30
- Hero - Modify Agility of (Killing unit): Add 30
- Hero - Modify Intelligence of (Killing unit): Add 30
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
it work but it can bug; if for example I summon a unit during the fight and it kill the cloned hero I do not gain stats since the condition unit type of killing= unit type of dying is false,
anyone got an idea go around this? I could disable the skill but thats not really what I want and there is no event such as "when your clone dies".anyone Got any good idea? Cant figure out how to make the game detect the clone to have died by me or my unit and then add stats.
I could probably have big trigger with if unit dies, if unit type of unit=hero 1 and if dying unit belong to computer then pick all hero within region and do same for all hero with an array but isnt there another possible way?
edit: nvm i fixed myself I stored the clone type in a variable and refer to it with a condition if its owner by a computer when it dies then pick all unit within special event and add X stats to hero