• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trouble with mobs dropping items

Status
Not open for further replies.
Level 5
Joined
Nov 14, 2007
Messages
161
Trouble with mobs dropping items (Solved)

I've been doing pretty good up until this skill, what is suppose to happen is you cast the skill on a enemy unit and it has a random chance to land. If it lands, it leaves a buff that lets the players know and when that unit dies it drops an item. Right now the skill works and the buff is left on the creature, but when it dies, nothing happens. I have tried a few different ways to check the dying unit for a buff but none have worked yet. My most recent attempt is:

  • Spoiled Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) has buff Spoiled ) Equal to True
      • -------- I have also tried "dying unit" --------
    • Actions
      • Set SpoiledChanceInt = (Random integer number between 1 and 2)
      • Game - Display to (All players) for 30.00 seconds the text: actions now
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SpoiledChanceInt Equal to 1
        • Then - Actions
          • Game - Display to (All players) for 30.00 seconds the text: 1
        • Else - Actions
The game text in the actions is just to see if it works I will later replace that, but I can't get it to display either text which means this trigger is not going off.

I know the unit has the buff which is based off of the ability slow (with no decreases) and the buff duration is maxed and is on the unit when the final blow is made. Hope someone knows what i did wrong or has another way to go about it.

Thanks for your time
YO_MA_MA
 
Last edited:
Level 5
Joined
Nov 14, 2007
Messages
161
I like it, I'll give it a try when i get back.

Thanks again.

EDIT: Ok, I like your idea but there were only 2 ways i could think of to "stick" a unit to another. Way 1 was order unit to follow which is working fine except that the dummy is a little further away from the unit then I would like. Is there a way to change a dummy's following range? Way2 would be to loop an instantly move dummy to the unit which seems easier but I cant figure out the triggers for it. Also my simple 2 triggers turned into 1 large, bloated, and non-MUI trigger and it made it so only 1 unit can have a dummy following him at once. Any suggestions? Here is my horrible trigger:
  • Spoil
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spoil (hero)
    • Actions
      • Set SpoilInt = (Random integer number between 1 and 3)
      • Set Spoiler = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SpoilInt Less than or equal to (Level of Spoil (hero) for Spoiler)
        • Then - Actions
          • Set SpoilTarg = (Target unit of ability being cast)
          • Set SpoilPoint = (Position of SpoilTarg)
          • Unit - Create 1 Dummy (for spoil) for (Owner of Spoiler) at SpoilPoint facing Default building facing degrees
          • Set Dummy_SP = (Last created unit)
          • Unit - Set level of Spoil (dummy) for Dummy_SP to (Level of Spoil (hero) for Spoiler)
          • Unit - Remove Attempting to Spoil buff from SpoilTarg
          • Unit - Order Dummy_SP to Undead Necromancer - Cripple SpoilTarg
          • Unit - Order Dummy_SP to Follow SpoilTarg
          • Game - Display to (All players) for 30.00 seconds the text: Spoil Succeeds
          • Set SpoiledChanceInt = (Random integer number between 1 and 2)
          • Wait until ((SpoilTarg is dead) Equal to True), checking every 0.10 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SpoiledChanceInt Equal to 1
            • Then - Actions
              • Game - Display to (All players) for 30.00 seconds the text: 1
              • Set SpoilPoint = (Position of Dummy_SP)
              • Item - Create Tome of Experience at (Position of Dummy_SP)
              • Unit - Remove Dummy_SP from the game
              • Set SpoilTarg = No unit
              • Set Dummy_SP = No unit
              • Custom script: call RemoveLocation(udg_SpoilPoint)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SpoiledChanceInt Equal to 2
            • Then - Actions
              • Game - Display to (All players) for 30.00 seconds the text: 2
              • Set SpoilPoint = (Position of Dummy_SP)
              • Item - Create Tome of Experience at (Position of Dummy_SP)
              • Unit - Remove Dummy_SP from the game
              • Set SpoilTarg = No unit
              • Set Dummy_SP = No unit
              • Custom script: call RemoveLocation(udg_SpoilPoint)
            • Else - Actions
        • Else - Actions
      • Set Spoiler = No unit

:week:
Isn't that horrible.
 
Last edited:
Level 11
Joined
Feb 22, 2006
Messages
752
When the spell is cast and it successfully lands, add the affected unit to a global unit group.

Then have another trigger detect when a unit dies and set condition to be that the dying unit has to be in that global unit group. Then for the actions just create item at the dead unit's location and then remove the unit from the group (units can't die twice).
 
Level 5
Joined
Nov 14, 2007
Messages
161
Errr that sounds to easy. lol ill disable these and give that a try. Thanks for another idea. +rep

Edit by the way i figured it out, thanks for your help again. Happy Holidays!


My final 2 triggers ended up like this; 1 for the skill (if it lands) and the other for a random item (if you're lucky enough)

  • Spoil
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spoil (hero)
    • Actions
      • Set SpoilInt = (Random integer number between 1 and 20)
      • Set Spoiler = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SpoilInt Less than or equal to (Level of Spoil (hero) for Spoiler)
        • Then - Actions
          • Set SpoilTarg = (Target unit of ability being cast)
          • Set SpoilPoint = (Position of SpoilTarg)
          • Unit - Create 1 Dummy (for spoil) for (Owner of Spoiler) at SpoilPoint facing Default building facing degrees
          • Set Dummy_SP = (Last created unit)
          • Unit - Set level of Spoil (dummy) for Dummy_SP to (Level of Spoil (hero) for Spoiler)
          • Unit - Order Dummy_SP to Undead Necromancer - Cripple SpoilTarg
          • Unit - Add a 2.00 second Generic expiration timer to Dummy_SP
          • Game - Display to (All players) for 30.00 seconds the text: ...
          • Unit Group - Add SpoilTarg to SpoiledGroup
          • Set SpoilTarg = No unit
          • Set Dummy_SP = No unit
          • Custom script: call RemoveLocation(udg_SpoilPoint)
        • Else - Actions
      • Set Spoiler = No unit

  • Spoiled Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in SpoiledGroup) Equal to True
    • Actions
      • Set SpoilPointItem = (Position of (Triggering unit))
      • Set SpoilTargLands = (Triggering unit)
      • Set SpoiledChanceInt = (Random integer number between 1 and 20)
      • If (SpoiledChanceInt Equal to 1) then do (Item - Create Tome of Intelligence at SpoilPointItem) else do (Do nothing)
      • If (SpoiledChanceInt Equal to 2) then do (Item - Create Tome of Agility at SpoilPointItem) else do (Do nothing)
      • If (SpoiledChanceInt Equal to 3) then do (Item - Create Tome of Strength at SpoilPointItem) else do (Do nothing)
      • If (SpoiledChanceInt Equal to 4) then do (Item - Create Lesser Healing Potion at SpoilPointItem) else do (Do nothing)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SpoiledChanceInt Equal to 5
          • MobLevel Greater than 0
          • MobLevel Less than 5
        • Then - Actions
          • Item - Create Wooden Helmet at SpoilPointItem
        • Else - Actions
      • If (SpoiledChanceInt Greater than 6) then do (Game - Display to (All players) the text: ...) else do (Do nothing)
      • Unit Group - Remove SpoilTargLands from SpoiledGroup
      • Set SpoilTargLands = No unit
      • Custom script: call RemoveLocation(udg_SpoilPointItem)

More will be added but that is the final product, thanks again.
 
Last edited:
Status
Not open for further replies.
Top