• 🏆 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] Transformed units dont carry over ability

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2010
Messages
312
After much work and still to no avail I can not add previously used abilities to transformed units.

The whole point is so they don't have to be added manually, but whenever (for example) a druid of the claw transforms into the bear state, that unit loses the ability that was added via triggers. I want to transfer over the level of the ability and add abilities depending on the current level of the first ability (more info in the trigger "End Ability" below).

  • V Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- --------------------------------------------------------------------------------------------- --------
      • -------- Set this to how many kills you want before a bonus is given! --------
      • Set V_KillLimit = 3
      • -------- --------------------------------------------------------------------------------------------- --------
      • Hashtable - Create a hashtable
      • Set V_Hashtable = (Last created hashtable)
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set V_HashUnit = (Key (Picked unit))
          • Set V_Unit = (Picked unit)
          • Hashtable - Save 0 as 0 of V_HashUnit in V_Hashtable
          • Unit - Add Rank (Dummy) to V_Unit
          • Unit - Add V_Damage Bonus to V_Unit
          • Unit - Add V_Armor Bonus to V_Unit
  • V End Ability
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Bear Form
          • (Ability being cast) Equal to Phoenix Morphing (Egg Related)
    • Actions
      • Game - Display to (All players) the text: Running
      • Set V_HashUnit = (Key (Triggering unit))
      • Set V_AbilityUnit[V_HashUnit] = (Triggering unit)
      • Set V_RankLevel = (Level of Rank (Dummy) for V_AbilityUnit[V_HashUnit])
      • Unit - Add Rank (Dummy) to V_AbilityUnit[V_HashUnit]
      • Unit - Set level of Rank (Dummy) for V_AbilityUnit[V_HashUnit] to V_RankLevel
      • Unit - Add V_Damage Bonus to V_AbilityUnit[V_HashUnit]
      • Unit - Set level of V_Armor Bonus for V_AbilityUnit[V_HashUnit] to V_RankLevel
      • Unit - Add V_Armor Bonus to V_AbilityUnit[V_HashUnit]
      • Unit - Set level of V_Damage Bonus for V_AbilityUnit[V_HashUnit] to V_RankLevel
      • If (V_RankLevel Greater than or equal to 5) then do (Unit - Add V_Level 5 to V_AbilityUnit[V_HashUnit]) else do (Do nothing)
      • If (V_RankLevel Greater than or equal to 10) then do (Unit - Add V_Level 10 to V_AbilityUnit[V_HashUnit]) else do (Do nothing)
      • If (V_RankLevel Equal to 15) then do (Unit - Add V_Level 15 to V_AbilityUnit[V_HashUnit]) else do (Do nothing)
  • V Record
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set V_Unit = (Triggering unit)
      • Unit - Remove V_Level 5 from V_Unit
      • Unit - Remove V_Level 10 from V_Unit
      • Unit - Remove V_Level 15 from V_Unit
      • Set V_Killer = (Killing unit)
      • Set V_HashUnit = (Key (Killing unit))
      • Set V_RankKills = ((Load 0 of V_HashUnit from V_Hashtable) + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • V_RankKills Equal to V_KillLimit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Level of Rank (Dummy) for V_Killer) Greater than 0) and ((Level of Rank (Dummy) for V_Killer) Less than 15)
            • Then - Actions
              • Unit - Increase level of Rank (Dummy) for V_Killer
              • Unit - Increase level of V_Armor Bonus for V_Killer
              • Unit - Increase level of V_Damage Bonus for V_Killer
              • Special Effect - Create a special effect attached to the origin of V_Killer using Abilities\Spells\Items\AIre\AIreTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • If ((Level of Rank (Dummy) for V_Killer) Equal to 5) then do (Unit - Add V_Level 5 to V_Killer) else do (Do nothing)
              • If ((Level of Rank (Dummy) for V_Killer) Equal to 10) then do (Unit - Add V_Level 10 to V_Killer) else do (Do nothing)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Rank (Dummy) for V_Killer) Equal to 15
                • Then - Actions
                  • Unit - Remove V_Level 10 from V_Killer
                  • Unit - Add V_Level 15 to V_Killer
                • Else - Actions
              • Set V_RankKills = ((Load 0 of V_HashUnit from V_Hashtable) - V_KillLimit)
            • Else - Actions
        • Else - Actions
      • Hashtable - Save V_RankKills as 0 of V_HashUnit in V_Hashtable
Any help is appreciated, thank you in advance!
 
Level 9
Joined
Apr 23, 2010
Messages
312
@Doomlord, Thanks!

I figured it out now though with GUI as well.
  • V Start Ability
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Bear Form
          • (Ability being cast) Equal to Phoenix Morphing (Egg Related)
    • Actions
      • Game - Display to (All players) the text: (Name of (Triggering unit))
      • Set V_AbilityUnit = (Triggering unit)
      • Set V_RankLevel = (Level of Rank (Dummy) for V_AbilityUnit)
  • V End Ability
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Bear Form
          • (Ability being cast) Equal to Phoenix Morphing (Egg Related)
    • Actions
      • Game - Display to (All players) the text: (Name of (Triggering unit))
      • Unit - Add Rank (Dummy) to V_AbilityUnit
      • Unit - Set level of Rank (Dummy) for V_AbilityUnit to V_RankLevel
      • Unit - Add V_Damage Bonus to V_AbilityUnit
      • Unit - Set level of V_Armor Bonus for V_AbilityUnit to V_RankLevel
      • Unit - Add V_Armor Bonus to V_AbilityUnit
      • Unit - Set level of V_Damage Bonus for V_AbilityUnit to V_RankLevel
      • If (V_RankLevel Greater than or equal to 5) then do (Unit - Add V_Level 5 to V_AbilityUnit) else do (Do nothing)
      • If (V_RankLevel Greater than or equal to 10) then do (Unit - Add V_Level 10 to V_AbilityUnit) else do (Do nothing)
      • If (V_RankLevel Equal to 15) then do (Unit - Add V_Level 15 to V_AbilityUnit) else do (Do nothing)
 
Status
Not open for further replies.
Top