• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Help with trigger

Status
Not open for further replies.
Level 4
Joined
Jul 18, 2008
Messages
76
Hi, I'm making a map that allows players to get XP each time they cast a spell.
Since I want each spell to award different amount of XP, I was wondering if there's a simple solution of making a trigger for this.

Instead of making it like 150 lines of "If spell x, then award 20 xp" in the same trigger, would it be possible to have a simple trigger that tracks which spell it is?

The amount of XP awarded will be based on the manacost + spell cooldown, perhaps even more once I've established it.

You would forever have my grattitude if you manage to solve this for me!
 
Level 9
Joined
Jul 10, 2011
Messages
562
the best solution i can think of is a hashtable with all spells and a trigger taking the spell from the hash and add the desired amount of xp.

thats the best solution because AFAIK its impossible to get the cooldown directly.
 
Level 4
Joined
Jul 18, 2008
Messages
76
Yea I figured something like that was the best solution, sadly I don't know how hashtables work.. at all.
 
Level 4
Joined
Jul 18, 2008
Messages
76
Thank you alot defskull, I've tested it on my own map and it works perfectly! I understand the triggers just fine :)

You have made my day, thank you great sir!
 
Status
Not open for further replies.
Top