- Joined
- Jan 22, 2012
- Messages
- 13
Okay, so I have this item called 'Soul Stone'. It has charges and gains 1 per kill. The item has a spellbook ability which is hidden and contains a passive ability that gives 1 mana regen per charge.
When the holder dies, he will gain gold based on the charges, and a dummy hero will be created where he died to collect exp while he is dead. His nearby allies will get healed based on the charges. Afterwards, he loses 1/3 of the charges.
Problem: When he dies, the game crashes. I don't know the reason why.
When the holder dies, he will gain gold based on the charges, and a dummy hero will be created where he died to collect exp while he is dead. His nearby allies will get healed based on the charges. Afterwards, he loses 1/3 of the charges.
Problem: When he dies, the game crashes. I don't know the reason why.
-
Soul Stone Dies
-
Events
- Unit - A unit Dies
-
Conditions
- ((Dying unit) has an item of type Soul Stone) Equal to True
- ((Dying unit) is A Hero) Equal to True
-
Actions
- Player - Add (25 x (Charges remaining in (Item carried by (Dying unit) of type Soul Stone))) to (Owner of (Dying unit)) Current gold
- Set CastPoint = (Position of (Dying unit))
- Unit - Create 1 Soul Stone for (Owner of (Dying unit)) at CastPoint facing Default building facing degrees
- Unit Group - Add (Last created unit) to SoulStoneGroup
- Special Effect - Create a special effect at CastPoint using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
- Special Effect - Destroy (Last created special effect)
- Set CastGroup = (Units within 1675.00 of CastPoint matching (((Owner of (Matching unit)) is an ally of (Owner of (Dying unit))) Equal to True))
-
Unit Group - Pick every unit in CastGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is A structure) Not equal to True
- ((Picked unit) is Mechanical) Not equal to True
-
Then - Actions
- Unit - Set life of (Picked unit) to (((Life of (Picked unit)) + 400.00) + (30.00 x (Real((Charges remaining in (Item carried by (Dying unit) of type Soul Stone))))))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Item - Set charges remaining in (Item carried by (Dying unit) of type Soul Stone) to (((Charges remaining in (Item carried by (Dying unit) of type Soul Stone)) x 2) / 3)
- Unit - Set level of Soul Stone dummy aura (Item) for (Dying unit) to (Charges remaining in (Item carried by (Dying unit) of type Soul Stone))
- Custom script: call RemoveLocation(udg_CastPoint)
- Custom script: call DestroyGroup(udg_CastGroup)
-
Events
Last edited: