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

[Damage Detection System] Shadow Strike Dagger

Status
Not open for further replies.

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
178
Hi, I've made a trigger but I'm not sure if it is properly made. Can someone make me sure?


Description:

Has a 15% chance to hurl a poisoned dagger with incredible force at an enemy, dealing x initial damage, and x damage every x seconds for x seconds. The poison slows the attack rate and movement speed of the enemy for a short duration.


Variables:

Temp_Unit - Unit Array
Custom_Value - Integer


Trigger:
  • Shadow Strike Dagger
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • IsDamageAttack Equal to True
          • (DamageEventSource has an item of type Orb of Venom) Equal to True
          • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource).) Equal to True
          • (DamageEventSource is A Hero) Equal to True
          • (Random integer number between 1 and 7) Equal to 1
    • Actions
      • Unit - Create 1 Dummy Unit for (Owner of DamageEventSource) at (Position of DamageEventTarget) facing Default building facing degrees
      • Set VariableSet Custom_Value = (Custom value of (Last created unit))
      • Set VariableSet Temp_Unit[Custom_Value] = (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike DamageEventTarget
      • Wait 1.00 seconds
      • Unit - Remove Temp_Unit[Custom_Value] from the game
 

Attachments

  • Shadow Strike Dagger.w3m
    61.3 KB · Views: 36

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
So you're making a few mistakes here:
1) Your Wait will cause problems. This is because the Custom_Value variable can be set to something else during that Waiting period, removing the wrong Temp_Unit when it comes time. A simple expiration timer should do the trick.
2) You're leaking a point when you use (Position of DamageEventTarget).
3) Your conditions can be optimized.
4) Your random number between 1 and 7 isn't actually 15%.
5) No need to use the Unit Indexer in this case.

Here's how I would structure it:
  • Untitled Trigger 001
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource has an item of type Orb of Venom) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsDamageAttack Equal to True
          • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource).) Equal to True
          • (DamageEventSource is A Hero) Equal to True
          • (Random integer number between 1 and 100) Less than or Equal to 15
        • Then - Actions
          • Set VariableSet ss_Point = (Position of DamageEventTarget)
          • Unit - Create 1 Dummy for (Owner of DamageEventSource) at ss_Point facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_ss_Point)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike DamageEventTarget
        • Else - Actions
Also, don't forget to add the Shadow Strike ability to your Dummy unit after creating it, unless this Dummy already has the ability added to it in the Object Editor. I would avoid adding it in the Object Editor if you plan on using this same Dummy unit for other spells since it can cause ability conflicts.
 
Last edited:

zam

zam

Level 3
Joined
Jan 1, 2021
Messages
31
In Bribe's DDS you need to add 'Turn off (This Trigger)' at the top of the actions and 'Turn on (This Trigger)' at the last. [i think]
 
Status
Not open for further replies.
Top