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

[Spell] Scripted spells by a total newbie

Status
Not open for further replies.
Level 3
Joined
May 28, 2019
Messages
39
Hi there. I'm trying to learn to use triggers to make cool spells. I'm pretty satisfied with work done, but unfortunately, I'm not skilled enough, to detect leaks or non-MUI tools or "dangerous" functions.

And I'm afraid I've already implemented something which sometimes causes game to crash when I restart map or try to exit the application.

Can you give me some advice please?

I'm wandering:
1. What causes game to crash?
2. Will my "Stealth", "Shadowstep", "Shadow Copy" abilities will work in multiplayer, when used by different players?
3. Is there something I should know before continuing my work?

"How is it supposed to work"
1. Stealth is an channel-ability based on World Of Warcraft stealth mechanics. It adds you a spell book, with 100% critical strike (for backstabbing) and permanent invisibility. If you use offensive ability, attack or get attacked, stealth will be broken and you'll get buff "In combat" for 15 seconds, which will prevent you from using stealth.

2. Shadowstep is a blink ability, which can get you out of combat and activate your stealth immediately.
If you are already in stealth mode, Shadowstep will be replaced with another blink ability with lowered CD and mana cost.

3. Shadow Copy is a berserk-based ability, which looks like mirror image, but in fact creates 2 new heroes with original's abilities, stats, level.

Shadow Copy Triggers
  • Activate Shadow Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Copy (new)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RealOne[(Player number of (Owner of (Triggering unit)))] Equal to No unit
        • Then - Actions
          • Set RealOne[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
        • Else - Actions
      • Unit - Order (Triggering unit) to Stop
      • Set PositionIni = (Position of (Triggering unit))
      • Unit - Hide RealOne[(Player number of (Owner of (Triggering unit)))]
      • Unit - Create 1 SHADOW COPY EFFECT for Player 1 (Red) at PositionIni facing (Facing of (Triggering unit)) degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Set Illusions = (Units owned by (Owner of (Triggering unit)) of type Fel Orc Blademaster (Shadow Copy))
      • Unit Group - Pick every unit in Illusions and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup(udg_Illusions)
      • Custom script: call RemoveLocation(udg_PositionIni)
  • Shadow Copy Effect 1
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to SHADOW COPY EFFECT
    • Actions
      • Set PositionIni = (Position of (Triggering unit))
      • Set Roll = (Random integer number between -1 and 1)
      • If (Roll Equal to 0) then do (Set Roll = 1) else do (Do nothing)
      • Set PositionIni = (Position of (Triggering unit))
      • Set PositionFinal = (PositionIni offset by 192.00 towards ((Facing of (Triggering unit)) + (135.00 x (Real(Roll)))) degrees)
        • Unit - Move (Triggering unit) instantly to PositionFinal
        • Custom script: call RemoveLocation(udg_PositionFinal)
      • Set PositionFinal = (PositionIni offset by 192.00 towards ((Facing of (Triggering unit)) + (135.00 x (-1.00 + (Real(Roll))))) degrees)
      • Unit - Create 1 Fel Orc Blademaster (Shadow Copy) for (Owner of (Triggering unit)) at PositionFinal facing (Facing of (Triggering unit)) degrees
        • Custom script: call RemoveLocation(udg_PositionFinal)
      • Set PositionFinal = (PositionIni offset by 192.00 towards ((Facing of (Triggering unit)) + (135.00 x (-2.00 + (Real(Roll))))) degrees)
      • Unit - Create 1 Fel Orc Blademaster (Shadow Copy) for (Owner of (Triggering unit)) at PositionFinal facing (Facing of (Triggering unit)) degrees
        • Custom script: call RemoveLocation(udg_PositionFinal)
        • Unit - Unhide RealOne[(Player number of (Owner of (Triggering unit)))]
        • Selection - Select RealOne[(Player number of (Owner of (Triggering unit)))] for (Owner of (Triggering unit))
        • Unit - Remove (Triggering unit) from the game
        • Custom script: call RemoveLocation(udg_PositionIni)
  • Shadow Copy Settings
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (Shadow Copy)
    • Actions
      • Hero - Set (Triggering unit) experience to (Hero experience of RealOne[(Player number of (Owner of (Triggering unit)))]), Hide level-up graphics
        • Unit - Set Unit: (Triggering unit)'s Integer Field: Strength ('ustc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Strength ('ustc'))
        • Unit - Set Unit: (Triggering unit)'s Integer Field: Agility ('uagc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Agility ('uagc'))
          • Unit - Set Unit: (Triggering unit)'s Integer Field: Intelligence ('uinc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Intelligence ('uinc'))
        • Unit - Set life of (Triggering unit) to (Life of RealOne[(Player number of (Owner of (Triggering unit)))])
        • Unit - Set mana of (Triggering unit) to (Mana of RealOne[(Player number of (Owner of (Triggering unit)))])
        • Hero - Disable experience gain for (Triggering unit)
        • Hero - Modify unspent skill points of (Triggering unit): Set to 0 points
        • Unit - Set life of (Triggering unit) to (Percentage life of RealOne[(Player number of (Owner of (Triggering unit)))])%
        • Unit - Set mana of (Triggering unit) to (Percentage mana of RealOne[(Player number of (Owner of (Triggering unit)))])%
        • Unit - Add a 60.00 second Generic expiration timer to (Triggering unit)
  • Shadow Copy Start Abilities
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (Shadow Copy)
    • Actions
      • Unit Group - Pick every unit in (Units of type Fel Orc Blademaster (new)) and do (Actions)
        • Loop - Actions
          • Custom script: local integer var_bladestorm_level =0
          • Custom script: local integer var_windwalk_level =0
          • Custom script: local integer var_burningblade_level =0
          • Custom script: local integer var_strike_level =0
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Owner of (Triggering unit))
            • Then - Actions
              • Custom script: set var_windwalk_level =GetUnitAbilityLevel( GetEnumUnit(),'A00G')
              • Custom script: set var_burningblade_level =GetUnitAbilityLevel( GetEnumUnit(),'A003')
              • Custom script: set var_bladestorm_level =GetUnitAbilityLevel( GetEnumUnit(),'A00J')
              • Custom script: set var_strike_level =GetUnitAbilityLevel( GetEnumUnit(),'A00C')
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Wind Walk (new) for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Hero - Modify unspent skill points of (Triggering unit): Add 1 points
                  • Hero - Learn skill for (Triggering unit): Wind Walk (new)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00G', var_windwalk_level)
                • Else - Actions
                  • Do nothing
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Crushing Strike Research (new) for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Hero - Modify unspent skill points of (Triggering unit): Add 1 points
                  • Hero - Learn skill for (Triggering unit): Crushing Strike Research (new)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00C', var_strike_level)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00B', var_strike_level)
                • Else - Actions
                  • Do nothing
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Bladestorm Research (new) for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Hero - Modify unspent skill points of (Triggering unit): Add 1 points
                  • Hero - Learn skill for (Triggering unit): Bladestorm Research (new)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00J', var_bladestorm_level)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00H', var_bladestorm_level)
                • Else - Actions
                  • Do nothing
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Burning Blade Research for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Hero - Modify unspent skill points of (Triggering unit): Add 1 points
                  • Hero - Learn skill for (Triggering unit): Burning Blade Research
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A003', var_burningblade_level)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00K', var_burningblade_level)
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Do nothing
  • Shadow Copy Learn Abilities
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (new)
    • Actions
      • Set Illusions = (Units owned by (Owner of (Triggering unit)) of type Fel Orc Blademaster (Shadow Copy))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Crushing Strike Research (new)
        • Then - Actions
          • Unit Group - Pick every unit in Illusions and do (Actions)
            • Loop - Actions
              • Custom script: local integer var_strike_level=GetUnitAbilityLevel( GetTriggerUnit(),'A00C')
              • Hero - Modify unspent skill points of (Picked unit): Add 1 points
              • Hero - Learn skill for (Picked unit): Crushing Strike Research (new)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00C', var_strike_level)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00B', var_strike_level)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Wind Walk (new)
        • Then - Actions
          • Unit Group - Pick every unit in Illusions and do (Actions)
            • Loop - Actions
              • Custom script: local integer var_windwalk_level=GetUnitAbilityLevel( GetTriggerUnit(),'A00G')
              • Hero - Modify unspent skill points of (Picked unit): Add 1 points
              • Hero - Learn skill for (Picked unit): Wind Walk (new)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00G', var_windwalk_level)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Bladestorm Research (new)
        • Then - Actions
          • Unit Group - Pick every unit in Illusions and do (Actions)
            • Loop - Actions
              • Custom script: local integer var_bladestorm_level=GetUnitAbilityLevel( GetTriggerUnit(),'A00J')
              • Hero - Modify unspent skill points of (Picked unit): Add 1 points
              • Hero - Learn skill for (Picked unit): Bladestorm Research (new)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00J', var_bladestorm_level)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00H', var_bladestorm_level)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Burning Blade Research
        • Then - Actions
          • Unit Group - Pick every unit in Illusions and do (Actions)
            • Loop - Actions
              • Custom script: local integer var_burningblade_level=GetUnitAbilityLevel( GetTriggerUnit(),'A003')
              • Hero - Modify unspent skill points of (Picked unit): Add 1 points
              • Hero - Learn skill for (Picked unit): Burning Blade Research
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A003', var_burningblade_level)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00K', var_burningblade_level)
        • Else - Actions
          • Do nothing
      • Custom script: call DestroyGroup(udg_Illusions)
  • Shadow Copy Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (Shadow Copy)
    • Actions
      • Set PositionIni = (Position of (Triggering unit))
      • Special Effect - Create a special effect at PositionIni using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Unit - Remove (Triggering unit) from the game
      • Custom script: call RemoveLocation(udg_PositionIni)
  • Shadow Copy Level Up
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (new)
    • Actions
      • Set Illusions = (Units owned by (Owner of (Triggering unit)) of type Fel Orc Blademaster (Shadow Copy))
      • Unit Group - Pick every unit in Illusions and do (Actions)
        • Loop - Actions
          • Hero - Enable experience gain for (Picked unit)
          • Hero - Set (Picked unit) Hero-level to (Level of (Triggering unit)), Show level-up graphics
          • Hero - Disable experience gain for (Picked unit)
          • Hero - Modify unspent skill points of (Picked unit): Set to 0 points
      • Custom script: call DestroyGroup(udg_Illusions)
  • Shodow Copy Power Up
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (new)
          • (Item-class of (Item being manipulated)) Equal to Powerup
    • Actions
      • Set Illusions = (Units owned by (Owner of (Triggering unit)) of type Fel Orc Blademaster (Shadow Copy))
      • Unit Group - Pick every unit in Illusions and do (Actions)
        • Loop - Actions
          • Unit - Set Unit: (Picked unit)'s Integer Field: Strength ('ustc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Strength ('ustc'))
          • Unit - Set Unit: (Picked unit)'s Integer Field: Agility ('uagc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Agility ('uagc'))
          • Unit - Set Unit: (Picked unit)'s Integer Field: Intelligence ('uinc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Intelligence ('uinc'))
      • Custom script: call DestroyGroup(udg_Illusions)

Stealth Triggers
  • Hide Stealth Passive Abilities
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Disable Stealth Mode Passive Abilities (new) for (Picked player)
  • Stealth Ability Effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Stealth (new) (active button)
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Stealth ) Equal to False
        • Then - Actions
          • Sound - Play StealthSound <gen> at 100.00% volume, attached to (Triggering unit)
          • Unit - Add classification of A peon-type unit to (Triggering unit)
          • Unit - Add Stealth Mode Passive Abilities (new) to (Triggering unit)
          • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A008', var_stealth_level)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Level of Shadowstep (new) for (Triggering unit)) Greater than or equal to 1
            • Then - Actions
              • Unit - Add Shadowstep (new) (in Stealth mode) to (Triggering unit)
            • Else - Actions
              • Do nothing
          • Unit - Add Stealth Shadowstep Conversion to (Triggering unit)
        • Else - Actions
          • Unit - Remove Stealth Mode Passive Abilities (new) from (Triggering unit)
          • Unit - Remove Stealth buff from (Triggering unit)
          • Unit - Remove Shadowstep (new) (in Stealth mode) from (Triggering unit)
          • Unit - Remove Stealth Shadowstep Conversion from (Triggering unit)
          • Unit - Remove classification of A peon-type unit from (Triggering unit)
  • StealthUnitUnderAttack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Stealth Research (new) for (Attacked unit)) Greater than or equal to 1
      • ((Attacked unit) is An Ancient) Equal to False
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • Unit - Create 1 Dummy for (Owner of (Attacked unit)) at (Position of (Attacked unit)) facing Default building facing degrees
        • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Attacked unit)
        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Unit - Remove Stealth buff from (Attacked unit)
        • Unit - Remove classification of A peon-type unit from (Attacked unit)
        • Unit - Remove Stealth (new) (active button) from (Attacked unit)
        • Unit - Remove Shadowstep (new) (in Stealth mode) from (Attacked unit)
        • Unit - Remove Stealth Shadowstep Conversion from (Attacked unit)
        • Unit - Add Stealth (new) (inactive button) to (Attacked unit)
        • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A006', var_stealth_level)
        • -------- Wait to prevent Backstab slam animation bug --------
        • Wait 0.10 seconds
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Attacked unit) is An Ancient) Equal to False
          • Then - Actions
            • Unit - Remove Stealth Mode Passive Abilities (new) from (Attacked unit)
          • Else - Actions
            • Do nothing
        • -------- Wait to allow dummy cast InCombat ability --------
        • Wait 0.80 seconds
        • Unit Group - Add (Attacked unit) to InCombatGroup
  • StealthUnitAttacks
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Stealth Research (new) for (Attacking unit)) Greater than or equal to 1
    • Actions
      • Custom script: local integer var_stealth_level =0
      • Set AttackingUnit = (Attacking unit)
      • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
        • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Attacking unit)
        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Unit - Remove Stealth buff from (Attacking unit)
        • Unit - Remove classification of A peon-type unit from (Attacking unit)
        • Unit - Remove Stealth (new) (active button) from (Attacking unit)
        • Unit - Remove Shadowstep (new) (in Stealth mode) from (Attacking unit)
        • Unit - Remove Stealth Shadowstep Conversion from (Attacking unit)
        • Unit - Add Stealth (new) (inactive button) to (Attacking unit)
        • Custom script: set var_stealth_level =GetUnitAbilityLevel( udg_AttackingUnit,'A000')
        • Custom script: call SetUnitAbilityLevel (udg_AttackingUnit, 'A006', var_stealth_level)
        • -------- Wait to prevent Backstab slam animation bug --------
        • Wait 0.10 seconds
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Attacking unit) is An Ancient) Equal to False
          • Then - Actions
            • Unit - Remove Stealth Mode Passive Abilities (new) from (Attacking unit)
          • Else - Actions
            • Do nothing
        • -------- Wait to allow dummy cast InCombat ability --------
        • Wait 0.80 seconds
        • Unit Group - Add (Attacking unit) to InCombatGroup
  • StealthUnitUsesOffensiveAbility
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Level of Stealth Research (new) for (Triggering unit)) Greater than or equal to 1
      • (Ability being cast) Equal to Crushing Strike (new)
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
        • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Triggering unit)
        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Unit - Remove Stealth buff from (Triggering unit)
        • Unit - Remove classification of A peon-type unit from (Triggering unit)
        • Unit - Remove Stealth (new) (active button) from (Triggering unit)
        • Unit - Remove Shadowstep (new) (in Stealth mode) from (Triggering unit)
        • Unit - Remove Stealth Shadowstep Conversion from (Triggering unit)
        • Unit - Add Stealth (new) (inactive button) to (Triggering unit)
        • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A006', var_stealth_level)
        • -------- Wait to prevent Backstab slam animation bug --------
        • Wait 0.10 seconds
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) is An Ancient) Equal to False
          • Then - Actions
            • Unit - Remove Stealth Mode Passive Abilities (new) from (Triggering unit)
          • Else - Actions
            • Do nothing
        • -------- Wait to allow dummy cast InCombat ability --------
        • Wait 0.80 seconds
        • Unit Group - Add (Triggering unit) to InCombatGroup
  • Stealth Research
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Stealth Research (new)
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Stealth Research (new) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Stealth (new) (active button) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has buff Stealth ) Equal to True
            • Then - Actions
              • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A008', var_stealth_level)
            • Else - Actions
              • Do nothing
      • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A002', var_stealth_level)

  • Stealth AfterCombat
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in InCombatGroup and do (Actions)
        • Loop - Actions
          • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetEnumUnit(),'A000')
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff In Combat ) Equal to False
            • Then - Actions
              • Unit - Add Stealth (new) (active button) to (Picked unit)
              • Unit - Remove Stealth (new) (inactive button) from (Picked unit)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A002', var_stealth_level)
              • Unit Group - Remove (Picked unit) from InCombatGroup
            • Else - Actions
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A006', var_stealth_level)

Shadowstep Triggers
  • Shadowstep effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadowstep (new)
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • Unit - Add classification of An Ancient to (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Stealth Research (new) for (Triggering unit)) Greater than or equal to 1
        • Then - Actions
          • Unit - Add Stealth Mode Passive Abilities (new) to (Triggering unit)
          • Unit Group - Remove (Triggering unit) from InCombatGroup
          • Unit - Add classification of A peon-type unit to (Triggering unit)
          • Unit - Add Stealth (new) (active button) to (Triggering unit)
          • Unit - Remove Stealth (new) (inactive button) from (Triggering unit)
          • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A002', var_stealth_level)
          • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A008', var_stealth_level)
          • Unit Group - Remove (Triggering unit) from InCombatGroup
          • -------- Wait to prevent manacost and cd bug on shadowstep and to last combat buff to be appied --------
          • Wait 0.10 seconds
          • Unit - Remove In Combat buff from (Triggering unit)
          • Unit - Add Stealth Shadowstep Conversion to (Triggering unit)
          • Unit - Add Shadowstep (new) (in Stealth mode) to (Triggering unit)
        • Else - Actions
          • Do nothing
      • -------- During 1 second, unit cannot be buffed with "InCombat" --------
      • Wait 1.00 seconds
      • Unit - Remove classification of An Ancient from (Triggering unit)
  • Hide ShadowStep Conversion
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Disable Stealth Shadowstep Conversion for (Picked player)
 

Attachments

  • BladeMasterGardenOfWar(herofinished).w3x
    1.7 MB · Views: 27
Last edited:
Level 3
Joined
May 28, 2019
Messages
39
I'd recommend you to post your triggers instead of sharing the map.
Thanks. Abilities also matter to understand how the system works.

But anyway it's not a bad idea to share triggers. How do you guys post triggers as text, but at the same time they look like World Editor GUI? (sorry for my english)

UPD. Oh. I think I've found the guide.

Shadow Copy Triggers
  • Activate Shadow Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Copy (new)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RealOne[(Player number of (Owner of (Triggering unit)))] Equal to No unit
        • Then - Actions
          • Set RealOne[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
        • Else - Actions
      • Unit - Order (Triggering unit) to Stop
      • Set PositionIni = (Position of (Triggering unit))
      • Unit - Hide RealOne[(Player number of (Owner of (Triggering unit)))]
      • Unit - Create 1 SHADOW COPY EFFECT for Player 1 (Red) at PositionIni facing (Facing of (Triggering unit)) degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Set Illusions = (Units owned by (Owner of (Triggering unit)) of type Fel Orc Blademaster (Shadow Copy))
      • Unit Group - Pick every unit in Illusions and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup(udg_Illusions)
      • Custom script: call RemoveLocation(udg_PositionIni)
  • Shadow Copy Effect 1
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to SHADOW COPY EFFECT
    • Actions
      • Set PositionIni = (Position of (Triggering unit))
      • Set Roll = (Random integer number between -1 and 1)
      • If (Roll Equal to 0) then do (Set Roll = 1) else do (Do nothing)
      • Set PositionIni = (Position of (Triggering unit))
      • Set PositionFinal = (PositionIni offset by 192.00 towards ((Facing of (Triggering unit)) + (135.00 x (Real(Roll)))) degrees)
        • Unit - Move (Triggering unit) instantly to PositionFinal
        • Custom script: call RemoveLocation(udg_PositionFinal)
      • Set PositionFinal = (PositionIni offset by 192.00 towards ((Facing of (Triggering unit)) + (135.00 x (-1.00 + (Real(Roll))))) degrees)
      • Unit - Create 1 Fel Orc Blademaster (Shadow Copy) for (Owner of (Triggering unit)) at PositionFinal facing (Facing of (Triggering unit)) degrees
        • Custom script: call RemoveLocation(udg_PositionFinal)
      • Set PositionFinal = (PositionIni offset by 192.00 towards ((Facing of (Triggering unit)) + (135.00 x (-2.00 + (Real(Roll))))) degrees)
      • Unit - Create 1 Fel Orc Blademaster (Shadow Copy) for (Owner of (Triggering unit)) at PositionFinal facing (Facing of (Triggering unit)) degrees
        • Custom script: call RemoveLocation(udg_PositionFinal)
        • Unit - Unhide RealOne[(Player number of (Owner of (Triggering unit)))]
        • Selection - Select RealOne[(Player number of (Owner of (Triggering unit)))] for (Owner of (Triggering unit))
        • Unit - Remove (Triggering unit) from the game
        • Custom script: call RemoveLocation(udg_PositionIni)
  • Shadow Copy Settings
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (Shadow Copy)
    • Actions
      • Hero - Set (Triggering unit) experience to (Hero experience of RealOne[(Player number of (Owner of (Triggering unit)))]), Hide level-up graphics
        • Unit - Set Unit: (Triggering unit)'s Integer Field: Strength ('ustc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Strength ('ustc'))
        • Unit - Set Unit: (Triggering unit)'s Integer Field: Agility ('uagc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Agility ('uagc'))
          • Unit - Set Unit: (Triggering unit)'s Integer Field: Intelligence ('uinc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Intelligence ('uinc'))
        • Unit - Set life of (Triggering unit) to (Life of RealOne[(Player number of (Owner of (Triggering unit)))])
        • Unit - Set mana of (Triggering unit) to (Mana of RealOne[(Player number of (Owner of (Triggering unit)))])
        • Hero - Disable experience gain for (Triggering unit)
        • Hero - Modify unspent skill points of (Triggering unit): Set to 0 points
        • Unit - Set life of (Triggering unit) to (Percentage life of RealOne[(Player number of (Owner of (Triggering unit)))])%
        • Unit - Set mana of (Triggering unit) to (Percentage mana of RealOne[(Player number of (Owner of (Triggering unit)))])%
        • Unit - Add a 60.00 second Generic expiration timer to (Triggering unit)
  • Shadow Copy Start Abilities
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (Shadow Copy)
    • Actions
      • Unit Group - Pick every unit in (Units of type Fel Orc Blademaster (new)) and do (Actions)
        • Loop - Actions
          • Custom script: local integer var_bladestorm_level =0
          • Custom script: local integer var_windwalk_level =0
          • Custom script: local integer var_burningblade_level =0
          • Custom script: local integer var_strike_level =0
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Owner of (Triggering unit))
            • Then - Actions
              • Custom script: set var_windwalk_level =GetUnitAbilityLevel( GetEnumUnit(),'A00G')
              • Custom script: set var_burningblade_level =GetUnitAbilityLevel( GetEnumUnit(),'A003')
              • Custom script: set var_bladestorm_level =GetUnitAbilityLevel( GetEnumUnit(),'A00J')
              • Custom script: set var_strike_level =GetUnitAbilityLevel( GetEnumUnit(),'A00C')
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Wind Walk (new) for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Hero - Modify unspent skill points of (Triggering unit): Add 1 points
                  • Hero - Learn skill for (Triggering unit): Wind Walk (new)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00G', var_windwalk_level)
                • Else - Actions
                  • Do nothing
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Crushing Strike Research (new) for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Hero - Modify unspent skill points of (Triggering unit): Add 1 points
                  • Hero - Learn skill for (Triggering unit): Crushing Strike Research (new)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00C', var_strike_level)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00B', var_strike_level)
                • Else - Actions
                  • Do nothing
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Bladestorm Research (new) for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Hero - Modify unspent skill points of (Triggering unit): Add 1 points
                  • Hero - Learn skill for (Triggering unit): Bladestorm Research (new)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00J', var_bladestorm_level)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00H', var_bladestorm_level)
                • Else - Actions
                  • Do nothing
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Burning Blade Research for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Hero - Modify unspent skill points of (Triggering unit): Add 1 points
                  • Hero - Learn skill for (Triggering unit): Burning Blade Research
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A003', var_burningblade_level)
                  • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A00K', var_burningblade_level)
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Do nothing
  • Shadow Copy Learn Abilities
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (new)
    • Actions
      • Set Illusions = (Units owned by (Owner of (Triggering unit)) of type Fel Orc Blademaster (Shadow Copy))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Crushing Strike Research (new)
        • Then - Actions
          • Unit Group - Pick every unit in Illusions and do (Actions)
            • Loop - Actions
              • Custom script: local integer var_strike_level=GetUnitAbilityLevel( GetTriggerUnit(),'A00C')
              • Hero - Modify unspent skill points of (Picked unit): Add 1 points
              • Hero - Learn skill for (Picked unit): Crushing Strike Research (new)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00C', var_strike_level)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00B', var_strike_level)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Wind Walk (new)
        • Then - Actions
          • Unit Group - Pick every unit in Illusions and do (Actions)
            • Loop - Actions
              • Custom script: local integer var_windwalk_level=GetUnitAbilityLevel( GetTriggerUnit(),'A00G')
              • Hero - Modify unspent skill points of (Picked unit): Add 1 points
              • Hero - Learn skill for (Picked unit): Wind Walk (new)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00G', var_windwalk_level)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Bladestorm Research (new)
        • Then - Actions
          • Unit Group - Pick every unit in Illusions and do (Actions)
            • Loop - Actions
              • Custom script: local integer var_bladestorm_level=GetUnitAbilityLevel( GetTriggerUnit(),'A00J')
              • Hero - Modify unspent skill points of (Picked unit): Add 1 points
              • Hero - Learn skill for (Picked unit): Bladestorm Research (new)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00J', var_bladestorm_level)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00H', var_bladestorm_level)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Burning Blade Research
        • Then - Actions
          • Unit Group - Pick every unit in Illusions and do (Actions)
            • Loop - Actions
              • Custom script: local integer var_burningblade_level=GetUnitAbilityLevel( GetTriggerUnit(),'A003')
              • Hero - Modify unspent skill points of (Picked unit): Add 1 points
              • Hero - Learn skill for (Picked unit): Burning Blade Research
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A003', var_burningblade_level)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A00K', var_burningblade_level)
        • Else - Actions
          • Do nothing
      • Custom script: call DestroyGroup(udg_Illusions)
  • Shadow Copy Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (Shadow Copy)
    • Actions
      • Set PositionIni = (Position of (Triggering unit))
      • Special Effect - Create a special effect at PositionIni using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Unit - Remove (Triggering unit) from the game
      • Custom script: call RemoveLocation(udg_PositionIni)
  • Shadow Copy Level Up
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (new)
    • Actions
      • Set Illusions = (Units owned by (Owner of (Triggering unit)) of type Fel Orc Blademaster (Shadow Copy))
      • Unit Group - Pick every unit in Illusions and do (Actions)
        • Loop - Actions
          • Hero - Enable experience gain for (Picked unit)
          • Hero - Set (Picked unit) Hero-level to (Level of (Triggering unit)), Show level-up graphics
          • Hero - Disable experience gain for (Picked unit)
          • Hero - Modify unspent skill points of (Picked unit): Set to 0 points
      • Custom script: call DestroyGroup(udg_Illusions)
  • Shodow Copy Power Up
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (new)
          • (Item-class of (Item being manipulated)) Equal to Powerup
    • Actions
      • Set Illusions = (Units owned by (Owner of (Triggering unit)) of type Fel Orc Blademaster (Shadow Copy))
      • Unit Group - Pick every unit in Illusions and do (Actions)
        • Loop - Actions
          • Unit - Set Unit: (Picked unit)'s Integer Field: Strength ('ustc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Strength ('ustc'))
          • Unit - Set Unit: (Picked unit)'s Integer Field: Agility ('uagc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Agility ('uagc'))
          • Unit - Set Unit: (Picked unit)'s Integer Field: Intelligence ('uinc') to Value: (Unit: RealOne[(Player number of (Owner of (Triggering unit)))]'s Integer Field: Intelligence ('uinc'))
      • Custom script: call DestroyGroup(udg_Illusions)

Stealth Triggers
  • Hide Stealth Passive Abilities
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Disable Stealth Mode Passive Abilities (new) for (Picked player)
  • Stealth Ability Effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Stealth (new) (active button)
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Stealth ) Equal to False
        • Then - Actions
          • Sound - Play StealthSound <gen> at 100.00% volume, attached to (Triggering unit)
          • Unit - Add classification of A peon-type unit to (Triggering unit)
          • Unit - Add Stealth Mode Passive Abilities (new) to (Triggering unit)
          • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A008', var_stealth_level)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Level of Shadowstep (new) for (Triggering unit)) Greater than or equal to 1
            • Then - Actions
              • Unit - Add Shadowstep (new) (in Stealth mode) to (Triggering unit)
            • Else - Actions
              • Do nothing
          • Unit - Add Stealth Shadowstep Conversion to (Triggering unit)
        • Else - Actions
          • Unit - Remove Stealth Mode Passive Abilities (new) from (Triggering unit)
          • Unit - Remove Stealth buff from (Triggering unit)
          • Unit - Remove Shadowstep (new) (in Stealth mode) from (Triggering unit)
          • Unit - Remove Stealth Shadowstep Conversion from (Triggering unit)
          • Unit - Remove classification of A peon-type unit from (Triggering unit)
  • StealthUnitUnderAttack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Stealth Research (new) for (Attacked unit)) Greater than or equal to 1
      • ((Attacked unit) is An Ancient) Equal to False
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • Unit - Create 1 Dummy for (Owner of (Attacked unit)) at (Position of (Attacked unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Attacked unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Remove Stealth buff from (Attacked unit)
      • Unit - Remove classification of A peon-type unit from (Attacked unit)
      • Unit - Remove Stealth (new) (active button) from (Attacked unit)
      • Unit - Remove Shadowstep (new) (in Stealth mode) from (Attacked unit)
      • Unit - Remove Stealth Shadowstep Conversion from (Attacked unit)
      • Unit - Add Stealth (new) (inactive button) to (Attacked unit)
      • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A006', var_stealth_level)
      • -------- Wait to prevent Backstab slam animation bug --------
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) is An Ancient) Equal to False
        • Then - Actions
          • Unit - Remove Stealth Mode Passive Abilities (new) from (Attacked unit)
        • Else - Actions
          • Do nothing
      • -------- Wait to allow dummy cast InCombat ability --------
      • Wait 0.80 seconds
      • Unit Group - Add (Attacked unit) to InCombatGroup
  • StealthUnitAttacks
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Stealth Research (new) for (Attacking unit)) Greater than or equal to 1
    • Actions
      • Custom script: local integer var_stealth_level =0
      • Set AttackingUnit = (Attacking unit)
      • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Attacking unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Remove Stealth buff from (Attacking unit)
      • Unit - Remove classification of A peon-type unit from (Attacking unit)
      • Unit - Remove Stealth (new) (active button) from (Attacking unit)
      • Unit - Remove Shadowstep (new) (in Stealth mode) from (Attacking unit)
      • Unit - Remove Stealth Shadowstep Conversion from (Attacking unit)
      • Unit - Add Stealth (new) (inactive button) to (Attacking unit)
      • Custom script: set var_stealth_level =GetUnitAbilityLevel( udg_AttackingUnit,'A000')
      • Custom script: call SetUnitAbilityLevel (udg_AttackingUnit, 'A006', var_stealth_level)
      • -------- Wait to prevent Backstab slam animation bug --------
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacking unit) is An Ancient) Equal to False
        • Then - Actions
          • Unit - Remove Stealth Mode Passive Abilities (new) from (Attacking unit)
        • Else - Actions
          • Do nothing
      • -------- Wait to allow dummy cast InCombat ability --------
      • Wait 0.80 seconds
      • Unit Group - Add (Attacking unit) to InCombatGroup
  • StealthUnitUsesOffensiveAbility
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Level of Stealth Research (new) for (Triggering unit)) Greater than or equal to 1
      • (Ability being cast) Equal to Crushing Strike (new)
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Triggering unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Remove Stealth buff from (Triggering unit)
      • Unit - Remove classification of A peon-type unit from (Triggering unit)
      • Unit - Remove Stealth (new) (active button) from (Triggering unit)
      • Unit - Remove Shadowstep (new) (in Stealth mode) from (Triggering unit)
      • Unit - Remove Stealth Shadowstep Conversion from (Triggering unit)
      • Unit - Add Stealth (new) (inactive button) to (Triggering unit)
      • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A006', var_stealth_level)
      • -------- Wait to prevent Backstab slam animation bug --------
      • Wait 0.10 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is An Ancient) Equal to False
        • Then - Actions
          • Unit - Remove Stealth Mode Passive Abilities (new) from (Triggering unit)
        • Else - Actions
          • Do nothing
      • -------- Wait to allow dummy cast InCombat ability --------
      • Wait 0.80 seconds
      • Unit Group - Add (Triggering unit) to InCombatGroup
  • Stealth Research
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Stealth Research (new)
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Stealth Research (new) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Stealth (new) (active button) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has buff Stealth ) Equal to True
            • Then - Actions
              • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A008', var_stealth_level)
            • Else - Actions
              • Do nothing
      • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A002', var_stealth_level)

  • Stealth AfterCombat
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in InCombatGroup and do (Actions)
        • Loop - Actions
          • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetEnumUnit(),'A000')
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff In Combat ) Equal to False
            • Then - Actions
              • Unit - Add Stealth (new) (active button) to (Picked unit)
              • Unit - Remove Stealth (new) (inactive button) from (Picked unit)
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A002', var_stealth_level)
              • Unit Group - Remove (Picked unit) from InCombatGroup
            • Else - Actions
              • Custom script: call SetUnitAbilityLevel (GetEnumUnit(), 'A006', var_stealth_level)

Shadowstep Triggers
  • Shadowstep effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadowstep (new)
    • Actions
      • Custom script: local integer var_stealth_level =GetUnitAbilityLevel( GetTriggerUnit(),'A000')
      • Unit - Add classification of An Ancient to (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Stealth Research (new) for (Triggering unit)) Greater than or equal to 1
        • Then - Actions
          • Unit - Add Stealth Mode Passive Abilities (new) to (Triggering unit)
          • Unit Group - Remove (Triggering unit) from InCombatGroup
          • Unit - Add classification of A peon-type unit to (Triggering unit)
          • Unit - Add Stealth (new) (active button) to (Triggering unit)
          • Unit - Remove Stealth (new) (inactive button) from (Triggering unit)
          • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A002', var_stealth_level)
          • Custom script: call SetUnitAbilityLevel (GetTriggerUnit(), 'A008', var_stealth_level)
          • Unit Group - Remove (Triggering unit) from InCombatGroup
          • -------- Wait to prevent manacost and cd bug on shadowstep and to last combat buff to be appied --------
          • Wait 0.10 seconds
          • Unit - Remove In Combat buff from (Triggering unit)
          • Unit - Add Stealth Shadowstep Conversion to (Triggering unit)
          • Unit - Add Shadowstep (new) (in Stealth mode) to (Triggering unit)
        • Else - Actions
          • Do nothing
      • -------- During 1 second, unit cannot be buffed with "InCombat" --------
      • Wait 1.00 seconds
      • Unit - Remove classification of An Ancient from (Triggering unit)
  • Hide ShadowStep Conversion
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Disable Stealth Shadowstep Conversion for (Picked player)
 
Last edited:
Level 3
Joined
May 28, 2019
Messages
39
These triggers will fail when one player can have multiple units of the same type but should be okay for one per player. In short, this is Multi-Player Instance support (MPI).

Some notes:
1. Delete Do Nothing, they just waste memory.
2. Shadow Copy Powerup does not cover health tome.
Thank you! +rep.

What about "StealthUnitAttacks" script? I've used a global variable "AttackingUnit" in in. Will it cause any problems?

I did it because it seems like there was no function as GetAttackingUnit() in custom scripts.

---UPD---
Seems like i get it. I need to make "StealthUnitAttacks" an array variable and use player number as index to make it MPI. Thank you again.

---UPD2---

I've came to conclusion that my Stealth system is too complicated and (possibly) buggy. I'm starting to recreate one. Anyway, I'll still be happy to hear out your advice.

Especially, about Shadow Copy. Is there a way to make it MUI?
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
I did it because it seems like there was no function as GetAttackingUnit() in custom scripts.

You can make the global variable a local variable.

  • customscript: local unit udg_AttackingUnit
  • setvariable AttackingUnit = (AttackingUnit)
EDIT: I found the jassline you were looking for.

  • Custom script: local unit u = GetAttacker()
 
Last edited:
Level 3
Joined
May 28, 2019
Messages
39
You can make the global variable a local variable.

  • customscript: local unit udg_AttackingUnit
  • setvariable AttackingUnit = (AttackingUnit)
EDIT: I found the jassline you were looking for.

  • Custom script: local unit u = GetAttacker()
WOOW, Thank you very much! ^^ +rep
 
Level 3
Joined
May 28, 2019
Messages
39
I think I've managed to make "Shadow Copy" MUI at cost of secondary dynamic learning abilities and reading tomes functional. (because currently I don't have enough time to learn hashatables)
  • Activate Shadow Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Copy (new)
    • Actions
      • Custom script: local unit Caster =(GetTriggerUnit())
      • Custom script: local player Owner =GetOwningPlayer(Caster)
      • Custom script: local location PositionIni = GetUnitLoc(Caster)
      • Custom script: local integer Roll = GetRandomInt(0, 1)
      • Custom script: local location PositionFinal = PolarProjectionBJ(PositionIni, 192.00, ( GetUnitFacing(Caster) + ( 135.00 * I2R(Roll) ) ))
      • Custom script: local group SelectedUnits = ( GetUnitsSelectedAll(Owner))
      • Custom script: local integer var_strike_level =GetUnitAbilityLevel( Caster,'A00C')
      • Custom script: local integer var_bladestorm_level =GetUnitAbilityLevel( Caster,'A00J')
      • Custom script: local integer var_burningblade_level =GetUnitAbilityLevel( Caster,'A003')
      • Unit - Order (Triggering unit) to Stop
      • Unit - Hide (Triggering unit)
      • Custom script: call AddSpecialEffectLocBJ( PositionIni, "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl" )
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Custom script: set PositionFinal = PolarProjectionBJ(PositionIni, 192.00, ( GetUnitFacing(Caster) + ( 135.00 * I2R(Roll) ) ))
      • Custom script: call SetUnitPositionLoc( Caster, PositionFinal )
      • Custom script: call RemoveLocation(PositionFinal)
      • Custom script: set PositionFinal = PolarProjectionBJ(PositionIni, 192.00, ( GetUnitFacing(Caster) + ( 135.00 * ( -1.00 + I2R(Roll) ) ) ))
      • Custom script: call CreateNUnitsAtLoc( 1, 'O000', Owner, PositionFinal, GetUnitFacing(Caster) )
      • Hero - Set (Last created unit) experience to (Hero experience of (Triggering unit)), Hide level-up graphics
      • Hero - Disable experience gain for (Last created unit)
      • Hero - Modify unspent skill points of (Last created unit): Set to 0 points
      • Unit - Set Unit: (Last created unit)'s Integer Field: Strength ('ustc') to Value: (Unit: (Triggering unit)'s Integer Field: Strength ('ustc'))
      • Unit - Set Unit: (Last created unit)'s Integer Field: Agility ('uagc') to Value: (Unit: (Triggering unit)'s Integer Field: Agility ('uagc'))
      • Unit - Set Unit: (Last created unit)'s Integer Field: Intelligence ('uinc') to Value: (Unit: (Triggering unit)'s Integer Field: Intelligence ('uinc'))
      • Unit - Set Max HP of (Last created unit) to (Max HP of (Triggering unit))
      • Unit - Set life of (Last created unit) to (Percentage life of (Triggering unit))%
      • Unit - Set mana of (Last created unit) to (Percentage mana of (Triggering unit))%
      • Custom script: call SetUnitAbilityLevel (GetLastCreatedUnit(), 'A00B', var_strike_level)
      • Custom script: call SetUnitAbilityLevel (GetLastCreatedUnit(), 'A00H', var_bladestorm_level)
      • Custom script: call SetUnitAbilityLevel (GetLastCreatedUnit(), 'A00K', var_burningblade_level)
      • Custom script: call SetUnitAbilityLevel (GetLastCreatedUnit(), 'A00M', var_burningblade_level)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Crushing Strike Research (new) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Remove Crushing Strike (new) from (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Burning Blade (new) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Remove Burning Blade (shadow copy) (new) from (Last created unit)
          • Unit - Remove Burning Blade Button (new) from (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Bladestorm Research (new) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Remove Bladestorm (new) from (Last created unit)
        • Else - Actions
      • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(PositionFinal)
      • Custom script: set PositionFinal = PolarProjectionBJ(PositionIni, 192.00, ( GetUnitFacing(Caster) + ( 135.00 * ( -2.00 + I2R(Roll) ) ) ))
      • Custom script: call CreateNUnitsAtLoc( 1, 'O000', Owner, PositionFinal, GetUnitFacing(Caster) )
      • Hero - Set (Last created unit) experience to (Hero experience of (Triggering unit)), Hide level-up graphics
      • Hero - Disable experience gain for (Last created unit)
      • Hero - Modify unspent skill points of (Last created unit): Set to 0 points
      • Unit - Set Unit: (Last created unit)'s Integer Field: Strength ('ustc') to Value: (Unit: (Triggering unit)'s Integer Field: Strength ('ustc'))
      • Unit - Set Unit: (Last created unit)'s Integer Field: Agility ('uagc') to Value: (Unit: (Triggering unit)'s Integer Field: Agility ('uagc'))
      • Unit - Set Unit: (Last created unit)'s Integer Field: Intelligence ('uinc') to Value: (Unit: (Triggering unit)'s Integer Field: Intelligence ('uinc'))
      • Unit - Set Max HP of (Last created unit) to (Max HP of (Triggering unit))
      • Unit - Set life of (Last created unit) to (Percentage life of (Triggering unit))%
      • Unit - Set mana of (Last created unit) to (Percentage mana of (Triggering unit))%
      • Custom script: call SetUnitAbilityLevel (GetLastCreatedUnit(), 'A00B', var_strike_level)
      • Custom script: call SetUnitAbilityLevel (GetLastCreatedUnit(), 'A00H', var_bladestorm_level)
      • Custom script: call SetUnitAbilityLevel (GetLastCreatedUnit(), 'A00K', var_burningblade_level)
      • Custom script: call SetUnitAbilityLevel (GetLastCreatedUnit(), 'A00M', var_burningblade_level)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Crushing Strike Research (new) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Remove Crushing Strike (new) from (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Burning Blade (new) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Remove Burning Blade (shadow copy) (new) from (Last created unit)
          • Unit - Remove Burning Blade Button (new) from (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Bladestorm Research (new) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Remove Bladestorm (new) from (Last created unit)
        • Else - Actions
      • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(PositionFinal)
      • Unit - Unhide (Triggering unit)
      • Custom script: call SelectGroupForPlayerBJ( SelectedUnits, Owner )
      • Custom script: call RemoveLocation(PositionIni)
      • Custom script: set Caster = null
      • Custom script: set Owner = null
      • Custom script: call DestroyGroup(SelectedUnits)
  • Shadow Copy Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fel Orc Blademaster (Shadow Copy)
    • Actions
      • Custom script: local location PositionIni = GetUnitLoc(GetTriggerUnit())
      • Custom script: call AddSpecialEffectLocBJ( PositionIni, "Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl" )
      • Special Effect - Destroy (Last created special effect)
      • Unit - Remove (Triggering unit) from the game
      • Custom script: call RemoveLocation(PositionIni)
 
Status
Not open for further replies.
Top