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

Item

Status
Not open for further replies.
Level 5
Joined
Jul 15, 2012
Messages
101
I want to make that you can't have more than 1 claw.
  • Item Sword Refund 1
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Custom value of (Item carried by (Hero manipulating item) of type Claws of Attack +1)) Equal to 2
    • Actions
      • Item - Remove (Item carried by (Hero manipulating item) of type Claws of Attack +1)
and this doesn't work.
 
Level 17
Joined
Jul 17, 2011
Messages
1,863
try this [trigger=t]t
Events
Unit - A unit Acquires an item
Conditions
Actions
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 (Item being manipulated)
Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Custom script: call BJDebugMsg(" You cant carry any more of those")
Else - Actions
[/trigger]

all u have to do is add a condition that checks how many times this item has been aquired
 
Level 1
Joined
Jan 11, 2014
Messages
5
Hey, I was having the same problem but the method gorillabull showed seems to work.

I have one question on this if anyone can help. I have several weapons for my heroes all axes and swords, along with armor and shields etc. how can I make it so if the hero has a weapon of any type the hero can't pick up another weapon. I've tried and tried but I keep screwing it up I get close but I think I'm going to complicated.
 
I want to make that you can't have more than 1 claw.
  • Item Sword Refund 1
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Custom value of (Item carried by (Hero manipulating item) of type Claws of Attack +1)) Equal to 2
  • Actions
    • Item - Remove (Item carried by (Hero manipulating item) of type Claws of Attack +1)
and this doesn't work.
Custom vlaues are only trigger relevant, so you would have to set it for each item in a trigger before.

And your condition is useless, you check if an item exists in hero's inventory of type of Claws of Attack +1, and also has a specific custom value of 2, which is maybe never set.

I guess may be want here simply an item type comparrison?, idk.. and then check via loop like gorillabull posted, but better use your own inter variable for it instead of IntegerA/B.
 
Level 5
Joined
Jul 15, 2012
Messages
101
gorillabull said:
try this
t:
t
  • t
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • 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 (Item being manipulated)
            • Then - Actions
            • Else - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Custom script: call BJDebugMsg
all u have to do is add a condition that checks how many times this item has been aquired

  • Custom script: call BJDebugMsg
i get an error: Line 521: Expected '('
I tried to do () at end of that custom script and there is no error of that but there is another Line 522: Invalid number of arguments
 
Level 5
Joined
Jul 15, 2012
Messages
101
  • Untitled Trigger 002
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • 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 (Item being manipulated)
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Custom script: call BJDebugMsg(" You cant carry any more of those")
            • Else - Actions
Well now it's immediately dropped when picked
 
Level 5
Joined
Jul 15, 2012
Messages
101
  • Untitled Trigger 002
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws of Attack +1
    • Actions
      • 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)) Not equal to (Item being manipulated)
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Custom script: call BJDebugMsg(" You cant carry any more of those")
            • Else - Actions
If i made it how you said, it didn't work

EDIT*

  • Untitled Trigger 002
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • 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 Claws of Attack +1
              • (Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Custom script: call BJDebugMsg(" You cant carry any more of those")
            • Else - Actions
Works
 
Status
Not open for further replies.
Top