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

Store item position

Status
Not open for further replies.
Level 1
Joined
Jun 13, 2008
Messages
132
Hi there, How can I make a trigger that perfectly stores the item position in the hero's inventory?
I have already made one, but it seems buggy as it does not store the items very well:
Item = power boots (upon activation it changes the main bonus of atribute it gives, from 6 strength to 6 agility, then from 6 agility to 6 intelligence and finally from 6 intelligence to 6 strength).
That part of the trigger works.
Now now, the part that does not work is:
The trigger is activated when someone uses the ability that triggers the boots' trigger.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Ability being cast) Equal to Objeto efecto ( Activar botas fue )
    • Then - Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set DropItemInteger = 0
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item carried by (Triggering unit) in slot (Integer A)) Equal to No item
            • Then - Actions
              • Set DropItemInteger = (DropItemInteger + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DropItemInteger Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to DropItemInteger, do (Actions)
            • Loop - Actions
              • Item - Create Espacio at TempPoint
              • Hero - Give (Last created item) to (Triggering unit)
        • Else - Actions
      • Item - Remove (Item carried by (Triggering unit) of type Botas de poder)
      • Item - Create Botas de poder at TempPoint
      • Hero - Give (Last created item) to (Triggering unit)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Espacio
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Espacio)
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
    • Else - Actions
 
Level 1
Joined
Jun 13, 2008
Messages
132
Yes, for example, I want if my item is at slot 3 and there are no other items, and I click the item, I create temp items that occupy the slots then I remove the clicked item and finally I add the other item. But for some reason, the position is changed, but the trigger is ok, so what is happening I cannot understand!
 
Status
Not open for further replies.
Top