• 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.

[Trigger] Drop Item problem

Status
Not open for further replies.
Level 7
Joined
Jun 19, 2017
Messages
144
Hi guys, I'm having a problem with a trigger that prevents Heroes from having more than 1 item class in their inventory. The trigger works and if conditions are matched, it drops the item on ground where it was picked from. I also have a courier type unit that can carry items for the Hero and this is where the trigger bugs.

So the problem is that whenever the courier carries an item to the hero and directly gives it to him, but the hero already has an item of that class, the item goes back to the point where the courier picked it from. My question is: Is there a way to derive if the item has been picked from the ground or given to the hero from another unit?
Here is the trigger:
  • Drop Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer LoopDuplicateItem) from 1 to (Size of inventory for (Triggering unit)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A Hero) Equal to True
              • (Item-class of (Item being manipulated)) Not equal to Unknown
              • (Item carried by (Triggering unit) in slot LoopDuplicateItem) Not equal to (Item being manipulated)
              • (Item-class of (Item carried by (Triggering unit) in slot LoopDuplicateItem)) Equal to (Item-class of (Item being manipulated))
            • Then - Actions
              • Set Point[0] = (Position of (Item being manipulated))
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Item - Move (Item being manipulated) to Point[0]
              • Set PlayerGroup[0] = (Player group((Triggering player)))
              • Quest - Display to PlayerGroup[0] the Warning message: |c00FF0000Only one ...
              • Custom script: call RemoveLocation(udg_Point[0])
              • Custom script: call DestroyForce(udg_PlayerGroup[0])
            • Else - Actions
 
Status
Not open for further replies.
Top