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

[General] disabling items.

Status
Not open for further replies.
Level 6
Joined
Mar 2, 2013
Messages
127
In the map i'm working on there are a few items that if you take damage, the item becomes disabled for example. unit gets hurt, remove item, then swap item to disabled item for a few seconds, then swap back to original item.

The problem with they way i have it setup, the items drop on death like 50% of the time. Anyone have a system for how to do this?
 
Level 6
Joined
Mar 2, 2013
Messages
127
No, not an item drop system, i need like the opposite of that lol.
I need items NOT TO DROP ON DEATH, but for some reason I can't get it to work.


One of the items are Kunai, allows a person to blink. If that person gets hit, I make a trigger that swaps the kunai for a disabled kunai. Meaning they can't blink anymore for a few seconds(unless they get attacked again) which then swaps the item back to regular kunai.

Here is how I have it setup. (item still drops on death)

  • UnitbuysDagger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to (==) Yondaime's Special Kunai
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in DaggerGroup) Equal to (==) False
        • Then - Actions
          • Trigger - Add to DisableDagger <gen> the event (Unit - (Triggering unit) Takes damage)
          • Unit Group - Add (Triggering unit) to DaggerGroup
        • Else - Actions
  • DisableDagger
    • Events
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Damage source) is An Ancient) Equal to (==) True) or (((Damage source) is A Hero) Equal to (==) True)
          • ((Triggering unit) has an item of type Yondaime's Special Kunai) Equal to (==) True
          • (Unit-type of (Triggering unit)) Not equal to (!=) Uchiha Traitor
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) of type Yondaime's Special Kunai)
          • Hero - Create Yondaime's Special Kunai and give it to (Triggering unit)
          • Item - Make (Last created item) Stay with Heroes upon death
          • Custom script: call SetItemPlayer(GetLastCreatedItem(),GetOwningPlayer(GetTriggerUnit()),true)
        • Else - Actions
      • Countdown Timer - Start DaggerTimers[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 3.00 seconds
  • DaggerTimer
    • Events
      • Time - DaggerTimers[1] expires
      • Time - DaggerTimers[2] expires
      • Time - DaggerTimers[3] expires
      • Time - DaggerTimers[4] expires
      • Time - DaggerTimers[5] expires
      • Time - DaggerTimers[6] expires
      • Time - DaggerTimers[7] expires
      • Time - DaggerTimers[8] expires
      • Time - DaggerTimers[9] expires
      • Time - DaggerTimers[10] expires
      • Time - DaggerTimers[11] expires
      • Time - DaggerTimers[12] expires
    • Conditions
    • Actions
      • Set DisableGroup[1] = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to (==) True) and ((((Matching unit) is alive) Equal to (==) True) and ((((Matching unit) has an item of type Yondaime's Special Kunai) Equal to (==) True) and ((Unit-type of (Matching
      • Unit Group - Pick every unit in DisableGroup[1] and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for DaggerTimers[(Player number of (Owner of (Picked unit)))]) Less than or equal to (<=) 0.00
            • Then - Actions
              • Item - Remove (Item carried by (Picked unit) of type Yondaime's Special Kunai)
              • Hero - Create Yondaime's Special Kunai and give it to (Picked unit)
              • Item - Make (Last created item) Stay with Heroes upon death
              • Custom script: call SetItemPlayer(GetLastCreatedItem(),GetOwningPlayer(GetEnumUnit()),true)
            • Else - Actions
      • Custom script: call DestroyGroup (udg_DisableGroup[1])
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
What type of inventory are you using? If its hero there should be no problem if its a backpack from one of the races, go to the ability and change drop items on death to false
 
Level 6
Joined
Mar 2, 2013
Messages
127
Inventory is Hero Type.
 

Attachments

  • inventory.png
    inventory.png
    202.4 KB · Views: 115
Level 29
Joined
Oct 24, 2012
Messages
6,543
option one. Change OE field for units so they don't drop item on death.
Then make trigger with dying unit event. If dying unit has the item you want to drop on death then drop the item.

option two. Change OE field for units so they drop items on death.
Then make trigger with dying unit event. Pick all items in range of dying unit. Then check all of the items and check if it is the item you don't want to be dropped. If it is the item then remove the item.
 
Status
Not open for further replies.
Top