• 🏆 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] Creep Revive System & Creep Drops

Status
Not open for further replies.
Level 10
Joined
May 31, 2007
Messages
645
Hello everybody! How are you guys?
I want to ask some things:
1. How to make a creep revival system in GUI so that when a creep dies it will need 2 minutes to respawn?
2. How to make a creep drop system so that when a creep is killed it will generate items based on an item table? I know how to do so when i have a creep that I have placed, but if it's one revived, then what?

Please help me as soon as possible, because I need these things for my RPG map, that will have a Beta released soon with these features!
 
Level 4
Joined
Jul 12, 2007
Messages
116
Watch and learn :thumbs_up:

  • CR by Warlord
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Dying unit) is A structure) Equal to False
          • ((Dying unit) is A Hero) Equal to False
    • Actions
      • Wait 120.00 seconds
      • Unit - Create 1 (Unit-type of (Dying unit)) for (Owner of (Dying unit)) at ((Owner of (Dying unit)) start location) facing (Facing of (Dying unit)) degrees

  • ID by Warlord
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Dying unit) is A structure) Equal to False
          • ((Dying unit) is A Hero) Equal to False
    • Actions
      • Set random_integer = (Random integer number between 1 and 5)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • random_integer Equal to 1
        • Then - Actions
          • Item - Create Ring of Protection +4 at (Position of (Dying unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • random_integer Equal to 2
        • Then - Actions
          • Item - Create Talisman of the Wild at (Position of (Dying unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • random_integer Equal to 3
        • Then - Actions
          • Item - Create Claws of Attack +6 at (Position of (Dying unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • random_integer Equal to 4
        • Then - Actions
          • Item - Create Orb of Venom at (Position of (Dying unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • random_integer Equal to 5
        • Then - Actions
          • Item - Create Potion of Greater Healing at (Position of (Dying unit))
        • Else - Actions
          • Do nothing
      • Set random_integer = 0



(random_integer is an integer variable)
 
Level 27
Joined
Feb 22, 2006
Messages
3,052
You don't even need GUI to do the second thing..
First, go to Advanced -> Item Tables
Add a table, then add a set. Add the items to the table, modifying the % chance for it to drop if you want.
Then, when you place a neutral unit, double click on it, and go to that tab that says Items Dropped.
Select the table that you made, and there you go! Your unit now drops an item.
Note: This will not work with units created via triggers.
--donut3.5--
 
Level 4
Joined
Jul 12, 2007
Messages
116
But while the unit is "respawning" its no longer an original part of the map.

(as you said "Note: This will not work with units created via triggers.")
 
Level 10
Joined
May 31, 2007
Messages
645
I know about the tables, but didn't know how to make items drop off monsters generated through a trigger! Thx guys. Anyway before you posted I found out alolne how to make it and it's a lot more useful this way. I will post it later, but it may look a little noobish, you know. I made some units that carry itmes and made triggers fro each unit-type in my map to drop one item from the unit that carries the drops of them. Confusing, eh? Anyway thanks! I may use the whole thing in some other map or a later version, even to make my map smaller in size!
 
Level 10
Joined
Sep 21, 2007
Messages
517
Just create a item type array and fill it in with the items you want to be spawned
then when a unit dies set a integer variable to a random integer number between (starting number of your array) to (ending number of your array) then create
ItemType[RandomInteger] at the dying units position >_<
Tho i suggest you set item type's by levels and make a whole system for it, but its your choice.
 
Level 8
Joined
Feb 20, 2007
Messages
338
  • Creep Respawn
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • ((Triggering unit) is A Hero) Not equal to True
    • Actions
      • Wait 40.00 seconds
      • If ((Number of units in (Units within 700.00 of (Center of (Rect centered at (Position of (Dying unit)) with size (1.00, 1.00))) matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True))) Equal to 0) then do (Unit - Replace (Dying unit) with a (Random level (Random integer number between 1 and 10) creep unit-type) using The new unit's max life and mana) else do (Trigger - Run (This trigger) (checking conditions))
Why 40 second wait? Because you have to have bones around for the creep to respawn. I do not know why this is. I have upped my bone decay to several minutes to 5 minutes to get extended respawn times.

I set my "bosses" as hero - either through a trigger that creates them or through "Unit - Add classification of A Hero to (Triggering unit)" (Created unit or a selected unit in editor)

If you do not want a random creep then change the random level to:

...(Unit - Replace (Dying unit) with a (Unit-type of (Dying unit)) ...

You can also tie it into the hero or killing units level. Say you want level 2 stuff to drop from level 2 creeps instead of a level 9 item dropping from a level 2 creep because the hero is level 9.

The Rect is from WEU - for region.

In this instance a creep DOES NOT respawn if an enemy to neutral hostile is within a certain range of the dying unit. You can remove that, change the distance what ever.

I'm using WEU so there is the addition of Point- Remove point of (dying unit) and Point-remove point of last created unit.

To remove a leak point for WE check out: http://www.hiveworkshop.com/forums/showthread.php?t=35124

If you are not too picky about random drops you can make it a relatively simple trigger like:

  • Item Creep Drop
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Item - Create (Random level (Level of (Killing unit)) item-type) at (Position of (Dying unit))[COLOR="Red"]
      • Item - Set the custom value of (Last created item) to 45
      • -------- Change 45 to any number for seconds to decay - in this instance the item will be gone in 45 seconds --------[/COLOR]
      • Wait 0.10 seconds
      • Point - Remove (Position of (Dying unit))
      • Trigger - Turn off (This trigger)
      • Wait 90.00 seconds
      • Trigger - Turn on (This trigger)
Again WEU.

In this case every 90 seconds I want the drop to take place, thus I have turn on turn off.

The Red in this trigger is the addition of a decay system in this trigger - if you do not want it, then remove the 'item - set custom value' Again I am using WEU which has point-remove point. Check out that tutorial link about cleaning up leaks.

The decay system for this trigger cleans up my map of items that were not picked up. There is a set up for it:

  • ItemRemove
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Item - Pick every item in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked item) is owned) Equal to False
              • ((Picked item) is invulnerable) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked item)) Less than or equal to 0
                • Then - Actions
                  • Item - Remove (Picked item)
                • Else - Actions
                  • Item - Set the custom value of (Picked item) to ((Custom value of (Picked item)) - 1)
                  • Floating Text - Create floating text that reads (String((Custom value of (Picked item)))) at (Position of (Picked item)) with Z offset 48.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 50.00% transparency
                  • Floating Text - Set the velocity of (Last created floating text) to 32.00 towards 90.00 degrees
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 0.50 seconds
            • Else - Actions
And should the player want to drop a thing:

  • ItemDrop
    • Events
      • Unit - A unit Acquires an item
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • Item - Set the custom value of (Item being manipulated) to 60
If there is an item you do not want to vanish set it to invulnerable:

  • Boss drops
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Extra
    • Actions
      • Item - Make (Last dropped item) Invulnerable
Your event/condition can be anything you want.

This whole drop system works rather nicely. Mind I have mine set to creating a random item level depending on the level of the killing unit.

If there is a small set of items you want to drop you can change it to drop level 11 items - you change the level of the items in object editor to level 11.

You need to decide which is easier for you, how many items you want to drop.

Campaign items are level 0 so will not drop unless you either create a trigger that allows certain campaign objects to drop from specific units OR if you go into object editor and change the level of the item to something above 0.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Do not even bother making it with GUI, for something used as often as a creep revival system I can only recommend JASS for its speed and accuracy and also for its ability of not leaking.

Also I am sure there are JASS revive systems already located on this site. Try looking for them if you really can not make your own.
 
Status
Not open for further replies.
Top