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

[Trigger] Upgrade items (non recipe) skill

Status
Not open for further replies.
Level 3
Joined
Jun 16, 2006
Messages
8
Hi im wondering how to make this trigger?

clicks on item (has upgrade skill)
trigger checks item n resource
if meets requirement then removes item n gives upgraded item

i made this trigger but tested it doesnt work

upgrade 1
Events
Unit - A unit Uses an item
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Item-type of (Item being manipulated)) Equal to Claws of Attack +3) and (((Owner of (Hero manipulating item)) Current lumber) Greater than or equal to 30)
Then - Actions
Wait 1.00 seconds
Item - Remove (Item carried by (Hero manipulating item) of type Claws of Attack +3)
Hero - Create Claws of Attack +6 and give it to (Hero manipulating item)
Player - Add -30 to (Owner of (Hero manipulating item)) Current lumber
Else - Actions
Do nothing
 
Level 5
Joined
Nov 7, 2007
Messages
134
It's probably because of the "Wait", after a wait, the trigger "forgets" who is the "Hero Manipulating Item". So, either remove the wait, or make a "Set variable"-action that sets the "Hero Manipulating Item" into a unit-variable before the wait. Then use that variable to refer to the "Hero manipulating item" after the wait.
 
Level 6
Joined
Mar 22, 2009
Messages
276
xarxos was right.
Create a variable for the hero manipulating item.
Set var = hero manipulating item.
so the trigger can remember who is manipulating the item.
 
Level 4
Joined
Apr 16, 2009
Messages
85
i would remove the wait altogether as its unnecessary and a source of exploits (you could click on the item then you would have a timeframe of 1 sec to spend all your lumber and you would then get the new item anyway)
 
Status
Not open for further replies.
Top