This is pretty tough to explain, so I will try to keep it short.
In the test map I'm making, I am triggering all spells so that I can have their damage/healing affected by the Intelligence stat. Each spell will have a spellpower modifier just like the spell coefficients in World of Warcraft. One thing I want to do is have items that modify ONLY spellpower, without giving any of the other benefits of Intellect (mana regeneration and damage for Intelligence heroes).
So I did figure out how to do this, it is quite simple: When a unit possessing a "spellpower" item begins casting, I will add to his Intelligence. When he stops casting, I will remove that Intelligence:
Here, in my test map, the item "Savant's Staff" has +25 Intelligence while casting. The triggers I have set up work perfectly for the first time only. After that, they subtracts the Intelligence 2, 3, 4 ... etc. times each cast because the event is counting for each previous spellcast too.
I am thinking if I can add this line to the end of the second trigger, it will work just fine:
So is there a custom script line to remove an event?
Attached is my test map, the old one I uploaded in my movespeed thread does not have the triggers for this.
In the test map I'm making, I am triggering all spells so that I can have their damage/healing affected by the Intelligence stat. Each spell will have a spellpower modifier just like the spell coefficients in World of Warcraft. One thing I want to do is have items that modify ONLY spellpower, without giving any of the other benefits of Intellect (mana regeneration and damage for Intelligence heroes).
So I did figure out how to do this, it is quite simple: When a unit possessing a "spellpower" item begins casting, I will add to his Intelligence. When he stops casting, I will remove that Intelligence:
-
powerboost
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
((Triggering unit) has an item of type Savant's Staff) Equal to True
-
-
Actions
-
Hero - Modify Intelligence of (Triggering unit): Add 25
-
Trigger - Add to powerloss <gen> the event (Unit - (Triggering unit) Stops casting an ability)
-
-
-
powerloss
-
Events
-
Conditions
-
((Triggering unit) has an item of type Savant's Staff) Equal to True
-
-
Actions
-
Hero - Modify Intelligence of (Triggering unit): Subtract 25
-
-
Here, in my test map, the item "Savant's Staff" has +25 Intelligence while casting. The triggers I have set up work perfectly for the first time only. After that, they subtracts the Intelligence 2, 3, 4 ... etc. times each cast because the event is counting for each previous spellcast too.
I am thinking if I can add this line to the end of the second trigger, it will work just fine:
-
Trigger - Remove from powerloss <gen> the event (Unit - (Triggering unit) Stops casting an ability)
So is there a custom script line to remove an event?
Attached is my test map, the old one I uploaded in my movespeed thread does not have the triggers for this.