[Trigger] Generic spell trigger doesn't fire properly

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2008
Messages
243
UNSOLVED

I get this with quite a few of my spells in my game. The trigger fires before the spell is cast. The spell doesn't drain any mana and has no cooldown (and yes, the spell has a cooldown (of 5 seconds), a casting time of 0.00, and uses mana)

Here's one of the spells that does this.
  • Redeeming Strike
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Redeeming Strike (Heroes)
    • Actions
      • -------- Declare --------
      • Set Spell_RedeemingStrikeTarget = (Target unit of ability being cast)
      • -------- Calculate --------
      • Set Spell_RedeemingStrikeDmg = ((Level of (Triggering unit)) x 50)
      • Set Spell_RedeemingStrikeHeal = (Spell_RedeemingStrikeDmg / 10)
      • -------- Perform --------
      • Unit - Set life of Spell_RedeemingStrikeTarget to ((Life of Spell_RedeemingStrikeTarget) - (Real(Spell_RedeemingStrikeDmg)))
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Real(Spell_RedeemingStrikeHeal)))
      • -------- Text --------
      • Set DegreesRandom[0] = (Random real number between 0.00 and 359.00)
      • Floating Text - Create floating text that reads ((String(Spell_RedeemingStrikeDmg)) + ( dmg + (( + ((Name of (Owner of (Triggering unit))) + ))))) above Spell_RedeemingStrikeTarget with Z offset 0.00, using font size 9.00, color (99.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 210.00 towards DegreesRandom[0] degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
      • -------- Text --------
      • Set DegreesRandom[0] = (Random real number between 0.00 and 359.00)
      • Floating Text - Create floating text that reads (+ + ((String(Spell_RedeemingStrikeHeal)) + ( hp + ))) above (Triggering unit) with Z offset 0.00, using font size 9.00, color (0.00%, 99.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 210.00 towards DegreesRandom[0] degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
Things in the object editor that might help you decide on the problem:

Art - Animation Names - None
Missile Homing Enabled - False
Missile Speed - 0
Data - Defense Reduction - 0
Stats - Buff - None
Stats - Cast Range - 75 (melee distance)
Stats - Casting Time - 0.00
Stats - Cooldown - 5.00
Stats - (Hero+Normal)Duration - 0.01
Stats - Effect - None
Stats - Level - 1
Stats - Hero/Unit Ability - false/false
Stats - Mana cost - 45
Stats prioritory for spell steal - 2
Techtree - Check depandancies - False
Stats - Targets allowed - Air, Ground, Enemy, Neurtal
Text - order string (activate/deactivate/use/turnoff) - (faeriefireon/fareriefireoff/fariefire)
 
Last edited:
Level 7
Joined
Dec 8, 2008
Messages
243
Generic *go in combat* *take damage* *heal self*. I just had the most hilarious bug. I cast the spell and my hero died without any death animation. It just vanished.
 
Level 7
Joined
Dec 8, 2008
Messages
243
Ah, I've fixed the unit vanishing. Was setting the hero's life to a real that hadn't been set. I've updated my first post.
 
Level 7
Joined
Dec 8, 2008
Messages
243
Reviving this old thread since I'm getting this problem again. Same thing as before. The trigger fires before the spell is cast. The spell doesn't drain any mana and has no cooldown (and yes, the spell has a cooldown (of 5 seconds), a casting time of 0.00, and uses mana)
 
Level 7
Joined
Dec 8, 2008
Messages
243
You're using the Begins casting event. However, mana cost and cooldown take place when the unit starts the effect of an ability. I suggest you use that event. Because there is a small delay between those two events, and if the unit interrupts the order with another before the effect starts, there will be no mana cost or cooldown.

Are you a wizard? Thanks a ton.
 
Status
Not open for further replies.
Top