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

Spell upgrading by items...

Status
Not open for further replies.
Level 9
Joined
May 27, 2006
Messages
498
I'm working on a map, where I want heroes to lvl-up their abilities by buying specific items. First, they learn their skills as usually heroes in W3 do, and to upgrade them, they have to use books. For me everything seems to be fine, but the system doesn't work, and that's my problem... (And yes, i tried to fix it by myself)

Oh, and before you click the "reveal" button, remember to close other "If/Then/Else" roots, will be much easier to read :pP


Thanks in advance

This one sets a variable when spell is learned, to pass trought conditions in next trigger.
Every spell can be upgraded 4 times. I hope the knowledge of this will help.

  • Learn
    • Events
      • Unit - A unit acquires an ability
    • Conditions:
    • Actions:
      • -------- Stomp --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Learned Hero Skill) Equal to Stomp
        • Then - Actions:
          • Set Stomp[(Player number of (Owner of (Triggering unit)))] = 1
        • Else - Actions:
      • -------- Spellbook --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Learned Hero Skill) Equal to Totem Spellbook
        • Then - Actions:
          • Set Spellbook[(Player number of (Owner of (Triggering unit)))] = 1
        • Else - Actions:
      • -------- Slashing Strike --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Learned Hero Skill) Equal to Slashing Strike (dummy)
        • Then - Actions:
          • Set SS_angle[(Player number of (Owner of (Triggering unit)))] = 20 // It's default angle value for triggered spell, consider it as '1' in other "Set ..."'s
        • Else - Actions:
      • -------- Shockwave --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Learned Hero Skill) Equal to Shockwave (dummy)
        • Then - Actions:
          • Set Shockwave[(Player number of (Owner of (Triggering unit)))] = 1
        • Else - Actions
The trigger, which should upgrade abilities (just sets variables, i'll add the upgrade actions later)
Tought the bug is somewhere in this trigger, most probably in conditions, cause the upgrade-info hints has never been shown...

  • Upgrade
    • Events:
      • Unit - A unit acquires an item
    • Conditions:
    • Actions:
      • -------- Slashing Strike --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Slashing Strike
          • SS_angle[(Player number of (Owner of (Triggering unit)))] Greater than or Equal to 20
          • SS_angle[(Player number of (Owner of (Triggering unit)))] Lower than 100
        • Then - Actions
          • Set SS_angle[(Player number of (Owner of (Triggering unit)))] = (SS_angle[(Player number of (Owner of (Triggering unit)))] + 20)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: (|cffffcc00Upgrade - ...
        • Else - Actions:
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Slashing Strike
          • SS_angle[(Player number of (Owner of (Triggering unit)))] Equal to 0
        • Then - Actions:
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000Error|r |...
          • Player - Add 160 to (Owner of (Triggering unit)) gold amount
        • Else - Actions:
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Slashing Strike
          • SS_angle[(Player number of (Owner of (Triggering unit)))] Equal to 4
        • Then - Actions:
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000Error|r |...
          • Player - Add 160 to (Owner of (Triggering unit)) gold amount
        • Else - Actions:
      • -------- Stomp --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Stomp
          • Stomp[(Player number of (Owner of (Triggering unit)))] Greater than or Equal to 1
          • Stomp[(Player number of (Owner of (Triggering unit)))] Lower than 4
        • Then - Actions:
          • Set Stomp[(Player number of (Owner of (Triggering unit)))] = (Stomp[(Player number of (Owner of (Triggering unit)))] + 1)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: (|cffffcc00Upgrade - ...
          • Unit - Remove Stomp from (Triggering unit)
          • Unit - Add Stomp (upg) to (Triggering unit)
          • Unit - Set level of Stomp (upg) for (Triggering unit) to Stomp[(Player number of (Owner of (Triggering unit)))]
        • Else - Actions:
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Stomp
          • Stomp[(Player number of (Owner of (Triggering unit)))] Equal to 0
        • Then - Actions:
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000Error|r |...
          • Player - Add 270 to (Owner of (Triggering unit)) gold amount
        • Else - Actions:
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Stomp
          • Stomp[(Player number of (Owner of (Triggering unit)))] Equal to 4
        • Then - Actions:
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000Error|r |...
          • Player - Add 270 to (Owner of (Triggering unit)) gold amount
        • Else - Actions
      • -------- Spellbook --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Totem Spellbook
          • Spellbook[(Player number of (Owner of (Triggering unit)))] Greater than or Equal to 1
          • Spellbook[(Player number of (Owner of (Triggering unit)))] Lower than 4
        • Then - Actions:
          • Set Spellbook[(Player number of (Owner of (Triggering unit)))] = (Spellbook[(Player number of (Owner of (Triggering unit)))] + 1)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: (|cffffcc00Upgrade - ...
        • Else - Actions:
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Totem Spellbook
          • Spellbook[(Player number of (Owner of (Triggering unit)))] Equal to 0
        • Then - Actions:
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000Error|r |...
          • Player - Add 170 to (Owner of (Triggering unit)) gold amount
        • Else - Actions:
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Totem Spellbook
          • Spellbook[(Player number of (Owner of (Triggering unit)))] Equal to 4
        • Then - Actions:
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000Error|r |...
          • Player - Add 170 to (Owner of (Triggering unit)) gold amount
        • Else - Actions:
      • -------- Shockwave --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Shockwave
          • Shockwave[(Player number of (Owner of (Triggering unit)))] Greater than or Equal to 1
          • Shockwave[(Player number of (Owner of (Triggering unit)))] Lower than 4
        • Then - Actions:
          • Set Shockwave[(Player number of (Owner of (Triggering unit)))] = (Shockwave[(Player number of (Owner of (Triggering unit)))] + 1)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: (|cffffcc00Upgrade - ...
        • Else - Actions:
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Shockwave
          • Shockwave[(Player number of (Owner of (Triggering unit)))] Equal to 0
        • Then - Actions:
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000Error|r |...
          • Player - Add 230 to (Owner of (Triggering unit)) gold amount
        • Else - Actions:
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Item-type of (Item being manipulated)) Equal to Upgrade: Shockwave
          • Shockwave[(Player number of (Owner of (Triggering unit)))] Equal to 4
        • Then - Actions:
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000Error|r |...
          • Player - Add 230 to (Owner of (Triggering unit)) gold amount
        • Else - Actions:
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
If you please, it would be simpler if you add the map into the pastebin, and send me a pm with the link inside ._.

It would help alot, helping me helping you

It is indeed hard to repost any trigger here, and takes time creating a new one by hand... Thats why my suggestion would be much faster

/Regards
 
Status
Not open for further replies.
Top