• 🏆 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] Custom Script check

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
Started using custom script so I can reference global variables in Hashtables, and tested on this ability called Challenge.

It works like a Taunt-type ability and lasts 10 seconds. The taunted unit does 50% reduced damage except against the unit that taunted them, and the buff is supposed to be removed early if the taunted unit deals 50 damage or more to the taunting unit.

So here it is, it has very few lines but I think it should work

  • Untitled Trigger 001
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GDD_DamageSource has buff 0_BRS-3 Challenge ) Equal to True
        • Then - Actions
          • Custom script: set udg_temp_unit = LoadUnitHandle(udg_H_BRS_Challenge, GetHandleId(udg_GDD_DamageSource), StringHash("caster"))
          • Custom script: set udg_temp_real = LoadReal(udg_H_BRS_Challenge, GetHandleId(udg_GDD_DamageSource), StringHash("damage"))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GDD_DamagedUnit Not equal to temp_unit
              • (GDD_DamagedUnit has buff 0_PAL-3 Sanctified Bond ) Equal to False
            • Then - Actions
              • Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) + (0.50 x GDD_Damage))
              • Game - Display to (All players) the text: ((Name of GDD_DamagedUnit) + ( blocked + ((String((Integer((0.50 x GDD_Damage))))) + due to Challenge.)))
            • Else - Actions
              • Custom script: call SaveReal(udg_H_BRS_Challenge, GetHandleId(udg_GDD_DamageSource), StringHash("damage"), (udg_temp_real + udg_GDD_Damage))
              • Game - Display to (All players) the text: ((Name of GDD_DamageSource) + ( dealt + ((String((Integer(GDD_Damage)))) + damage to the taunting Berserker.)))
        • Else - Actions
This is just the damage modifying part. And the 0-pal-3-Bond buff is damage immunity, which is another damage block that totally negates the damage. So if it interacted with this it would overheal 50% so units with that buff are excluded
 
Status
Not open for further replies.
Top