• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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