- Joined
- Feb 19, 2009
- Messages
- 15
Who can teach me a Item ownership trigger that when i drop the item no one can picked it or when i drop my item it will transfer in a selected region
Thnx for advance
Thnx for advance
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Drop Item

Events


Unit - A unit Loses an item

Conditions


(Hero manipulating item) Equal to (Your Item)

Actions


Set Point = (YourPoint)


Item - Move (Item being manipulated) to Point


Custom script: call RemoveLocation( udg_Point )
Item Ownership

Events


Unit - A unit Acquires an item

Conditions

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




Or - Any (Conditions) are true





Conditions






(Custom value of (Item being manipulated)) Equal to (Player number of (Owner of (Triggering unit)))






(Custom value of (Item being manipulated)) Equal to 0



Then - Actions




Set TempLoc = (Position of (Item being manipulated))




Item - Move (Item being manipulated) to TempLoc




Custom script: call RemoveLocation(udg_TempLoc)




Skip remaining actions



Else - Actions




Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
Actually, it is a very simple trigger...
Right, you can also use "Drop (Item being manipulated) from (Hero manipulating item)", but then you can move the item (and I think that's less effective than this).
Item Ownership
Events
Unit - A unit Acquires an item
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Custom value of (Item being manipulated)) Equal to (Player number of (Owner of (Triggering unit)))
(Custom value of (Item being manipulated)) Equal to 0
Then - Actions
Set TempLoc = (Position of (Item being manipulated))
Item - Move (Item being manipulated) to TempLoc
Custom script: call RemoveLocation(udg_TempLoc)
Skip remaining actions
Else - Actions
Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))
TempLoc: Point variable, no array.
Edit: Justify was faster than me... his post wasn't there when I posted mine :/
It would appear to be doing the check the wrong way around...
That "or" should be an "and", and the "equal to" should be "not equal to".
Or you could just swap the "then" and "else" blocks around![]()
Item Ownership

Events


Unit - A unit Acquires an item

Conditions

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




And - All (Conditions) are true





Conditions






(Owner of (Item being manipulated)) Not equal to Player 1 (Red)






(Owner of (Item being manipulated)) Not equal to Player 2 (Blue)






(Owner of (Item being manipulated)) Not equal to Player 3 (Teal)






(Owner of (Item being manipulated)) Not equal to Player 4 (Purple)






(Owner of (Item being manipulated)) Not equal to Player 5 (Yellow)






(Owner of (Item being manipulated)) Not equal to Player 6 (Orange)






(Owner of (Item being manipulated)) Not equal to Player 7 (Green)






(Owner of (Item being manipulated)) Not equal to Player 8 (Pink)






(Owner of (Item being manipulated)) Not equal to Player 9 (Gray)






(Owner of (Item being manipulated)) Not equal to Player 10 (Light Blue)






(Owner of (Item being manipulated)) Not equal to Player 11 (Dark Green)






(Owner of (Item being manipulated)) Not equal to Player 12 (Brown)



Then - Actions




Item - Change ownership of (Item being manipulated) to (Owner of (Hero manipulating item)) and Change color



Else - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Owner of (Item being manipulated)) Not equal to (Owner of (Hero manipulating item))





Then - Actions






Hero - Drop (Item being manipulated) from (Hero manipulating item)





Else - Actions
The first part isn't correct (it needs to be "or", otherwise it will say "Custom Value equal to 0 AND 2" for example).
You're right about the second part, i needs to be "not equal to" xD
Mehh, I didn't test it... it's almost correct, though![]()
