• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Triggered Pulverize

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
I wanted to simulate the Pulverize effect with triggers to add attribute bonus dmg. I'd like to know if it's well done, or how could I improve it.

  • Pulverize Bonus Damage
    • Events
      • Game - GDD_Event becomes Not equal to 0.00
    • Conditions
      • GDD_Damage Not equal to 0.00
      • (Level of Pulverize for GDD_DamageSource) Greater than 0
      • (Random integer number between 1 and 15) Less than or equal to (5 + (Level of Pulverize for GDD_DamageSource))
    • Actions
      • Set Temp_Point = (Position of GDD_DamagedUnit)
      • Set Temp_Group = (Units within 250.00 of Temp_Point matching ((((Matching unit) belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Set Pulverize_Damage = (((Real((Level of Pulverize for GDD_DamageSource))) x 10.00) + ((Real((Strength of GDD_DamageSource (Include bonuses)))) + (0.10 x (Real((Level of Pulverize for GDD_DamageSource))))))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Cause GDD_DamageSource to damage (Picked unit), dealing Pulverize_Damage damage of attack type Spells and damage type Normal
      • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call DestroyGroup(udg_Temp_Group)
EDIT: I'm using 'not equal to 0' because I have had problems with it using 'Equal to 0' since it triggers even when the dmg is 0, wich is no damage at all.

I guess I could make some Int variables to sore some values and make the lines shorter... :p
 
Last edited:
Level 26
Joined
Mar 19, 2008
Messages
3,140
Damage Event or GDD.

Improvement:
  • Set Temp_Group = (Units within 250.00 of Temp_Point matching ((((Matching unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
  • Unit Group - Pick every unit in Temp_Group and do (Actions)
    • Loop - Actions
      • Unit - Cause (Attacking unit) to damage (Picked unit), dealing Pulverize_Damage damage of attack type Spells and damage type Normal
  • Custom script: call DestroyGroup(udg_Temp_Group)
->>
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 250.00 of Temp_Point matching ((((Matching unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
    • Loop - Actions
      • Unit - Cause (Attacking unit) to damage (Picked unit), dealing Pulverize_Damage damage of attack type Spells and damage type Normal
Ofcourse all the (Attacking unit) has to be replaced with given system's damage source reference.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Oh.. the set bj_wantDestroyGroup = true is placed before, and not after the group is created? :p

Is there a way to detect if the group was really destroyed? I've had some issues with the bj_wantDestroyGroup not working the same way as storing the group into a variable =/

EDIT: GDD added :). Removed Temp_Group and added the pick conditions in the group creation.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
@Bribe: 'Lead me to the truth' if i'm wrong, but if GDD_DamageEvent and GDD_Damage not equal to 0, how could a '0 dmg' trigger it?.

I was using dummy Unholy Frenzy with 0 hp cost for something, and the unit was triggering. When changed to 'Not equal to 0' it began to work properly... Anyway, I'll keep testing and doing stuff. If it messes stuff, i'll use yours ;)
 
Status
Not open for further replies.
Top