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

Heroes only equip 1 kind of item

Status
Not open for further replies.
Level 3
Joined
Jan 29, 2017
Messages
29
Guys, is there any way to do that?, for example, i have an item called Abyssal Blade, then if i pick another Abyssal Blade, it will be unusable, or immediately dropped, or whatever it is, the point is i need to make all players wouldn't be able to having 2 same items.

how do i do that? thanks
 
Level 11
Joined
May 16, 2016
Messages
730
Guys, is there any way to do that?, for example, i have an item called Abyssal Blade, then if i pick another Abyssal Blade, it will be unusable, or immediately dropped, or whatever it is, the point is i need to make all players wouldn't be able to having 2 same items.

how do i do that? thanks
When unit pick items You must do next
For each Loop Integer from 1 to 6 do actions
If Conditions:
item carried by triggering hero in slot Loop Integer equals to item type of item being manipulated
And
Item not equals item being manipulated
Then
Move item being manipulated to the position of the triggerring unit.
 
Level 3
Joined
Jan 29, 2017
Messages
29
EXAMPLE
Events
Unit - A unit Acquires an item
Conditions
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions

Like this?
 
Level 3
Joined
Jan 29, 2017
Messages
29
EXAMPLE
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 (Item-type of (Item being manipulated))) and ((Matching item) Not equal to (Item being manipulated))
Then - Actions
Item - Move (Item being manipulated) to (Position of (Triggering unit))
Else - Actions
 
Level 3
Joined
Jan 29, 2017
Messages
29
IT WORKS! THanks dude Rep+


EXAMPLE
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 (Item-type of (Item being manipulated))) and ((Item carried by (Triggering unit) in slot (Integer A)) Not equal to (Item being manipulated))
(Item-type of (Item being manipulated)) Equal to Abyssal Blade
((Triggering unit) has an item of type Abyssal Blade) Equal to True
Then - Actions
Item - Move (Item being manipulated) to (Position of (Triggering unit))
Else - Actions
 
Status
Not open for further replies.
Top