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

Respawn Trigger

Status
Not open for further replies.
Level 2
Joined
Dec 13, 2010
Messages
4
To simply put it I need a trigger that will respawn some dead creeps within a certain region after they die."

What I basically have is well I don't know how to classify it, sort of a open RPG and hero siege blended together. Any who I have an area with a pond and Murloc camps. I have a region and everything but what I need is a trigger to respawn Murlocs in relatively the same amount in the region.

If there is an easy way to do it great.
If it is going to be a custom variable and script type way I'm willing to learn.
If you can help in any way, shape or form it would be greatly appreciated.

-Thank you.
 
Level 16
Joined
Jan 31, 2009
Messages
1,792
The above method is simple and works. But this method the unit that dies will be spawned at the position of where the unit had died.
  • Events
    • Unit - A unit owned by Neutral Hostile Dies
  • Conditions
  • Actions
    • Wait 30.00 seconds
    • Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Position of (Dying unit)) facing Default building facing (270.0) degrees
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
In this system all units owned by neutral hostile will respawn at the position they were at the beginning of the map after rtime seconds.


  • Init Respawn
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set rhash = (Last created hashtable)
      • Set rtime = 5.00
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Custom script: call SaveReal( udg_rhash , GetHandleId(GetEnumUnit()) , StringHash("x") , GetUnitX(GetEnumUnit()) )
          • Custom script: call SaveReal( udg_rhash , GetHandleId(GetEnumUnit()) , StringHash("y") , GetUnitY(GetEnumUnit()) )
  • Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Wait rtime seconds
      • Custom script: set udg_r1 = LoadReal( udg_rhash , GetHandleId(GetTriggerUnit()) , StringHash("x") )
      • Custom script: set udg_r2 = LoadReal( udg_rhash , GetHandleId(GetTriggerUnit()) , StringHash("y") )
      • Custom script: set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetTriggerUnit()) , GetUnitTypeId(GetTriggerUnit()) , udg_r1 , udg_r2 , GetRandomReal(0 , 359) )
      • Custom script: call SaveReal( udg_rhash , GetHandleId(bj_lastCreatedUnit) , StringHash("x") , udg_r1 )
      • Custom script: call SaveReal( udg_rhash , GetHandleId(bj_lastCreatedUnit) , StringHash("y") , udg_r2 )
      • Custom script: call FlushChildHashtable( udg_rhash , GetHandleId(GetTriggerUnit()))
      • Unit - Remove (Triggering unit) from the game


Though I must say thaht maybe you should do this with indexing, it's so simple. There's some respawn tutorial thread somewhere, or look for a respawn system in the spells section.
 
Level 2
Joined
Dec 13, 2010
Messages
4
Wow thank you all for helpful and quick responses. I think some of you missed what I actually needed but I believe I have all that I need.
 
Status
Not open for further replies.
Top