• 🏆 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] Check the item

Status
Not open for further replies.
Level 8
Joined
Dec 16, 2007
Messages
252
Okay, on my map you buy items with abilities, so when you cast an ability, you get the item. Now, you can get items by either cast thoose abilities or pick them from ground and here's a trigger to check if he already got a weapon, if he has, he will get gold back.
  • Weapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • 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-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-class of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffffcc00You canno...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to Machine Hook
                • Then - Actions
                  • Player - Add 400 to (Owner of (Triggering unit)) Current gold
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to Shothook
                • Then - Actions
                  • Player - Add 600 to (Owner of (Triggering unit)) Current gold
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to Snipehook
                • Then - Actions
                  • Player - Add 1000 to (Owner of (Triggering unit)) Current gold
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to Toxicthrower
                • Then - Actions
                  • Player - Add 400 to (Owner of (Triggering unit)) Current gold
                • Else - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions

Now the problem is, that I can't check if it's from ground. If he picked the item from the ground, he shouldn't get gold back. And I have no idea how to check this, I was thinking of custom value, but I realized I used it for something else. And since I use abilities, I can't check if it's from shop.

Sorry for my english, I know it annoys you, but I hope you get what I mean.
 
I think there is something, that have something to do with merchant sell/buy items (i'm not sure, maybe its in WEU...) dunno must check in WE.

Edit:
Yes there is Event "unit sells an item" In generic events...
So you will need to do a trigger that checks if selling unit is (lets say) merchant and than do that else do that. A lot of thinking D: but you could make it work somehow ;)
 
Status
Not open for further replies.
Top