The base spell is the war stomp spell. There are no other spells tied to it. However, the funny thing is is that it worked before I started to create the actual map. I built my heroes and their special abilities before I started to actually put stuff into the map, and that's when it started screwing up.
I just tested all the other hero abilities, and they work fine. Just this one is being fussy. And the level of the spell being modified can't be a problem because the mana cost of all the levels of the spell are greater than 100.
:EDIT: Okay, so apparently there are only two spells that screw up in this fashion. Both these spells work in generally the same way, except one is single target, and the other is an AoE. First is based off Firebolt, second is based off War Stomp. I don't have problems with other custom spells based off these two. I just tested the game again with triggers off and it works, so here's my trigger spell code, there's something wrong with it but I can't figure it out. It's a spell that requires both life and mana to cast. It checks whether the unit has enough life, and if so, casts the spell. Otherwise, returns the mana cost of the spell, since you have to first cast the spell to initiate the trigger.
-
Misbehaving Spell
-
Events
-
Unit - A unit Starts the effect of an ability
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to genericClass
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Ability being cast) Equal to Misbehaving Spell
-
(Life of (Triggering unit)) Greater than (35.00 + (15.00 x (Real((Level of (Ability being cast) for (Triggering unit))))))
-
Then - Actions
-
Unit - Cause (Triggering unit) to damage (Triggering unit), dealing (35.00 + (15.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) damage of attack type Spells and damage type Fire
-
Else - Actions
-
Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + (65.00 + (10.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))))
Data from my tests runs indicate that it seems to be running both the "Then" and the "Else" statements, though I don't know why.
Few more results:
- Using "Starts the effect of an ability" causes the mana count to (you can actually see this happening) increase first then decrease upon clicking the ability to cast, resulting in a net loss of only 50 mana. This is why the first cast works, because the unit has full mana at the start of the test.
- Using "Finishes the casting of an ability" causes the mana count to only decrease, but still only results in a loss of 50 mana.
The trigger may seem odd at first glance but there's a method to the madness, I assure you.
:EDIT: Okay, I fixed it. Dumbest error ever. Take a look at the second 'if' statement and it's corresponding 'else' statement. It checks for a spell match and life. If one is false, it adds mana. Now, the trigger itself runs whenever a spell is cast by that genericClass-type unit. Since there are two versions of this same trigger, one for the single target, and one for the AoE, every time that genericClass-type unit casts a spell both will run. One will register as false, and run the 'else' statement, giving the unit mana, while the other will register as true, and run correctly. Stupid error, but hard to find.