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

Backstab Problem (no one can solved that)

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,137
I don't want to deal damage to attacked unit if it's not attacked (another says this trigger shouldn't run until attacked unit takes damage)
Is there a way to do that ?

  • Viceclaws
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff Viceclaws ) Equal to True
      • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Set Backstab_Caster = (Attacking unit)
      • Set Backstab_Target = (Attacked unit)
      • Set Backstab_Point[1] = (Position of Backstab_Caster)
      • Set Backstab_Point[2] = (Position of Backstab_Target)
      • Set Backstab_Angle = (Angle from Backstab_Point[1] to Backstab_Point[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Facing of Backstab_Caster) Less than or equal to ((Facing of Backstab_Target) + 120.00)
                  • (Facing of Backstab_Caster) Greater than or equal to ((Facing of Backstab_Target) - 120.00)
              • And - All (Conditions) are true
                • Conditions
                  • Backstab_Angle Less than or equal to ((Facing of Backstab_Target) + 120.00)
                  • Backstab_Angle Greater than or equal to ((Facing of Backstab_Target) - 120.00)
        • Then - Actions
          • Unit - Cause Backstab_Caster to damage Backstab_Target, dealing ((60.00 x (Real((Level of Viceclaws jfa for (Attacking unit))))) + 1.00) damage of attack type Hero and damage type Normal
          • Special Effect - Create a special effect attached to the chest of Backstab_Target using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • Custom script: call RemoveLocation (udg_Backstab_Point[1])
      • Custom script: call RemoveLocation (udg_Backstab_Point[2])
 
Level 11
Joined
Feb 14, 2009
Messages
884
I don't think it is possible. Even Rikimaru's backstab and Ulfsaar's Fury Swipes proc before the unit is attacked (Yeah, most people thing that if IceFrog can't do it, it can't be done. But I don't think it can be done anyway :))
 
Level 11
Joined
Feb 14, 2009
Messages
884
You need to specify a unit for that. You can't just add a generic <a unit takes damage> but a <THIS unit takes damage>.
 
Level 2
Joined
Aug 28, 2009
Messages
20
You can do it, however it is a pain to do. Personnally, I create a trigger each time and put my data into it (damage that will be done etc) and add the event EVENT_UNIT_DAMAGED to it. Obviously, the trigger self destructs after a few seconds, thanks to a timer. Since you don't need to store data, you might be able to do this in GUI, if there's an Add Event action (without destroying the trigger).

So yeah, it can definitely be done, despite what Kercyn says, but it's a pain to do it the proper way.
 
Status
Not open for further replies.
Top