• 🏆 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!

[Trigger] Buying abilities problem

Status
Not open for further replies.
Level 4
Joined
Jul 9, 2008
Messages
88
On a map I am making, you buy your abilities for your heros.
I suck at JASS, so am struggling to do this with GUI.
I have it set up so that if a unit buys an item, depending on what item that is, the unit will get the ability. This is not a problem, it works fine (thanks to ParrotHead for the template). Example:
  • Events
    • Unit - A unit manipulates an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Unholy Aura
  • Actions
    • Set skill[(Player number of (Triggering player))] = Unholy Aura
    • Wait 0.20 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of skill[(Player number of (Triggering player))] for (Triggering unit)) Less than 1
      • Then - Actions
        • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: (You have bought the skill + (Name of (Item being manipulated)))
        • Hero - Learn skill for heroes[(Player number of (Triggering player))]: Unholy Aura
      • Else - Actions
        • Game - Display to (Player group((Triggering player))) for 5.00 seconds the text: (You already have + ((Name of (Item being manipulated)) + .))
        • Player - Add 1 to (Triggering player) Current gold
Now, all this does is automatically give the ability to the hero, he doesn't even have to level or learn it.
I would like it so that the hero truly has it, has to level, and learn it.
I have absolutely NO idea how to do this :/

Here are some of my attempts:
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Unholy Aura
  • Actions
    • Set skill[(Player number of (Triggering player))] = Unholy Aura
    • Wait 0.20 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of skill[(Player number of (Triggering player))] for (Triggering unit)) Less than 1
      • Then - Actions
        • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: (You have bought the skill + (Name of (Item being manipulated)))
        • Hero - Learn skill for heroes[(Player number of (Triggering player))]: Unholy Aura
      • Else - Actions
        • Game - Display to (Player group((Triggering player))) for 5.00 seconds the text: (You already have + ((Name of (Item being manipulated)) + .))
        • Player - Add 1 to (Triggering player) Current gold
any ideas?
 
Last edited:
Level 4
Joined
Jul 9, 2008
Messages
88
no, hmmmm, well, thanks but I would like it to be where they choose which ability they level. Plus I would have to make indeividual spells for each level :/
 
Level 3
Joined
Dec 14, 2007
Messages
44
You could maybe use a spellbook with dummy spells, and when a hero buys a ability then add it in the spellbook and every time a hero gains a level enable the spell book and when they use an ability in the spellbook it raises the level of the ability used. You would have to make it so the hero has no hero spells and use this to replace the button where the hero levels his abilities.

?? i'm just throwing this out there
 
Status
Not open for further replies.
Top