• 🏆 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] Revive spell

Status
Not open for further replies.
Level 7
Joined
May 18, 2010
Messages
264
FIXED Revive spell

Ok i kinda h8 starting a new triger until i get some help...
i got a spell revive ( thunder clap based) that revived last died hero
should just make like this
/
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Dying unit)) controller) Equal to User
    • Actions
      • Set Died_hero_unit = (Dying unit)
      • Set Point_of_die_unit = (Position of Died_hero_unit)
      • Do nothing
      • Custom script: call point_remove(udg_Point_of_die_unit)
  • asd
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Resurrection
    • Actions
      • Set Resurection_unit = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of Resurection_unit) and (Position of Died_hero_unit)) Less than or equal to 250.00
        • Then - Actions
          • Wait 1.00 seconds
          • Hero - Instantly revive Died_hero_unit at Point_of_die_unit, Hide revival graphics
        • Else - Actions
          • Do nothing
Btw only 1 unit will have this spell
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
I think the first trigger should be like this:

  • Untitled Trigger 055
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Custom script: if udg_p1 != null then
      • Custom script: call RemoveLocation(udg_p1)
      • Custom script: endif
      • Set p1 = (Position of (Triggering unit))
 
Level 7
Joined
May 18, 2010
Messages
264
Im no pro but Maker
custom script if (udg_p1 != null then)

wont that mean that p1 is not set and it removes the position whyc dosent exzist?
shouldnt insted of null be som else or is it right?
cuz i realy got no idea...just from logical point of view its veird
 
nope, its logical... the if cluster means that if p1 exist ( != means "not equal to"), you would remove it first to prevent leaks since if you set p1 to another location, the older p1 will stay in the memory and take up unnecessary space...

basically this is what your triggers should look like (btw, you might want to change ((Owner of (Triggering unit)) controller) Equal to User into ((Owner of (Triggering unit))) Equal to PlayerBlahBlah)

  • Untitled Trigger 055
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Custom script: if udg_p1 != null then
      • Custom script: call RemoveLocation(udg_p1)
      • Custom script: endif
      • Set p1 = (Position of (Triggering unit))
      • Set DieUnit = Triggering Unit
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Resurrection
  • Actions
    • Set Resurection_unit = (Triggering unit)
    • set p2 = Position of Resurection_unit
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Distance between (p2) and (p1)) Less than or equal to 250.00
      • Then - Actions
        • Wait 1.00 seconds
        • Hero - Instantly revive DieUnit at p1, Hide revival graphics
        • Custom script: call RemoveLocation(udg_p1)
        • Else - Actions
 
Status
Not open for further replies.
Top