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

[Trigger] Need Help

Status
Not open for further replies.
Level 6
Joined
Sep 13, 2013
Messages
155
This trigger doesn't work. Why ?

Trigger:

  • Backdoor Protection
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Unit-type of (Attacked unit)) is A town-hall-type unit) Equal to True
      • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Set HpReg = (Units within 750.00 of (Position of (Attacked unit)) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True)))
      • Set HpRegLvl = (Number of units in HpReg)
      • Unit - Add Backdoor protection (HP Reg) to (Attacked unit)
      • Unit - Set level of Backdoor protection (HP Reg) for (Attacked unit) to HpRegLvl
      • Custom script: call DestroyGroup(udg_HpReg)
      • Custom script: set udg_HpReg = null
Backdoor Protection (Hp Reg) is a spell based on Ring of Regeneration's ability.
EDIT: the spell is supposed to give health regeneration to the attacked unit based on the number of nearby allied structures.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Set HpReg = (Units within 750.00 of (Position of (Attacked unit)) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True)))
Leaks a location, also due to how filters operate (look at JASS it makes) it is possible that "Attacked unit" is lost. Try setting it to a register global variable and using that instead.

Unit - Set level of Backdoor protection (HP Reg) for (Attacked unit) to HpRegLvl
Some item abilities are bugged. Increasing their level will not alter the properties they provide to reflect the data you entered. When removing the ability it should remove the correct amount of property for the level (even if it was not giving that amount of property in the first place). This is the item level exploit and is used by many property systems to permanently modify properties.

Try basing it on Unholy Aura as a test. That healing does scale with level. Obviously not a long term solution but it rules out any bug interaction.
 
Level 13
Joined
Dec 21, 2010
Messages
541
Simply just add every structures the event of unit takes damage

  • Anti-Backdoor Init
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set - AntiBDGroup = Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True
    • Unit Group - Pick every unit in AntiBDGroup and do (Actions)
      • Loop - Actions
        • Trigger - Add to AntiBDCheck the event (Unit - (Picked unit) takes damage)
    • Custom script: call DestroyGroup(udg_AntiBDGroup)
  • AntiBDCheck
  • Conditions
  • Actions
    • Set - AntiBDPoint = Position of Triggering Unit
    • -------- The GROUP checks whether there's an enemy creep nearby IF 0 then the life of the structure remains the same--------
    • Set - AntiBDGroup = (Units within 750.00 of AntiBDPoint matching ((((Matching unit) is Hero) Not Equal to True and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Number of Units in AntiBDGroup Equal to 0
      • Then - Actions
        • Unit - Set life of (Triggering unit) to (Life of (Triggering unit) + damage Taken)
      • Else - Actions
    • Custom script: call DestroyGroup(udg_AntiBDGroup)
    • Custom script: call RemoveLocation(udg_SI_AntiBDPoint)
 
Status
Not open for further replies.
Top