• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Unlearning Spells Help

Status
Not open for further replies.
Level 17
Joined
Jun 12, 2007
Messages
1,261
My map features dummy items, which will learn you the spell if you use the item.
That part works fine.

But you are also able to unlearn each spell individual, and when you unlearn the spell it´s dummy item will spawn at your location. And I have no clue how to recognize what spell the player is unlearning thus what dummy item should be dropped.

Background information:
- Each spell only has one level.
- You unlearn spells by purchasing an item (unlearn first spell, unlearn second spell etc) which are used automatically.
- It's for 4 players.

Current learn trigger:
(It's just the basics for now and text part needs work lol.)
  • Learn Firebolt
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Firebolt [Fire]
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Only4Spell[(Player number of (Owner of (Triggering unit)))] Less than 4
              • (Level of Firebolt for (Triggering unit)) Equal to 0
            • Then - Actions
              • Unit - Add Firebolt to (Triggering unit)
              • Set Only4Spell[(Player number of (Owner of (Triggering unit)))] = (Only4Spell[(Player number of (Owner of (Triggering unit)))] + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Only4Spell[(Player number of (Owner of (Triggering unit)))] Less than 4
                  • (Level of Firebolt for (Triggering unit)) Equal to 1
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You already know this spell.
                • Else - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You can only have 4 spell.
        • Else - Actions
Problem:
Don't know how to see what spells has been learned at what time etc etc So I can trace back: Unlearn 2, oh second spell is fire bolt, unlearn fire bolt and create learn firebolt dummy item.

Can somebody spoon feed me? With some sample triggers if can.
I'll give you rep
 
I would probably do it like this:
  • Unit - Remove FirstAbility[Player Number of (Triggering Player)]
  • Unit - Add Firebolt to (Triggering Unit)
  • Set FirstAbility[Player Number of (Triggering Player)] = Firebolt
Using this should remove any previous first ability of the unit, add the new ability, then save the new ability in case you want to replace it again, hope this helped, some of this may be excess of what your looking for, so you might night need as many integers inside the Ability variable array.
 
set an String with arrays :)
If Spell [1] = None Then set Spell [1] = Firebolt Else If Spell [2] = None Then Spell [2] = Firebolt, ETC and when u unlearn u change the string back to None
 
set an String with arrays :)
If Spell [1] = None Then set Spell [1] = Firebolt Else If Spell [2] = None Then Spell [2] = Firebolt, ETC and when u unlearn u change the string back to None

That's actually something I can make working. Great help.
It's been a while since I made maps so my brains need some retraining. :P

Though I'll have huge unlearn triggers, a check for every string (about 200 spells lol). xD
 
:P its going to be huge indeed XD
212~ If/Then/Else but thats why Copy Paste is here for :) good luck on it :P
 
Status
Not open for further replies.
Back
Top