• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Item Requirements and Dropping

Status
Not open for further replies.
Level 25
Joined
May 11, 2007
Messages
4,650
Alright, I have two questions, I'll start this fast as I need those answered fast (got a timeline).

What's the trigger to drop/remove items when a unit has more then 1 of them?
Like if a unit has 2 pistol (Which is set to permanent) and then picks up another, he would drop the third.

And about requirements, I saw in the object editor that you can have requirements for items, so I tested it, but it seems that sold things does not require requirements? So is there a way to have items require research before they could be sold?
 
Level 7
Joined
Mar 16, 2008
Messages
348
I think this is it
Hope it works!!!
  • Events
    • A unit Acquires an item
  • Conditions
    • Or-Any (Conditions) are true
      • Conditions
        • (Item being manipulated) equal to (Pistol)
  • Actions
  • Actions Item-Remove (Item being manipulated)
  • If (All Conditions Are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • If (Triggering Unit) has an item of type (Pistol)
    • Then - Actions
      • Hero - Drop Item carried by (Triggering Unit) of type (Pistol) from (Triggering Unit)
      • Hero - Create Item (Pistol) and give it to (Triggering Unit)
      • Game - Display to (All players) the text : You can only carry one pistol!!!
      • Else - Actions
        • Hero - Create Item (Pistol) and give it to (Triggering Unit)
 
Level 25
Joined
May 11, 2007
Messages
4,650
Thanks for the help!
But anyone know anything about requirements?

Edit: I've tried it, but it seems that it drops the item that is picked up. And why should he drop the item, and then recreate the same and give it to him?
 
Level 25
Joined
May 11, 2007
Messages
4,650
What I want is that IF a unit already got an item of artifact, then if the hero picks up another of that type, he will drop it. But I want it so the hero can have maximinium of 2 artifacts, after that, he will drop.
 
Level 4
Joined
Mar 15, 2008
Messages
71
  • Item dropping
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or-Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) equal to (item-type of (Pistol))
          • (Item-type of (Item being manipulated)) equal to (item-type of (*some other item you want to use this trigger for*))
    • Actions
      • Set Item_Number = 0 {//Integer//}
      • For each (Integer A) from 1 to 6 do (Actions)
        • Loop - Actions
          • If (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated)) then do (Set Item_Number = (Item_Number + 1 )) else do (Do nothing)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Item_Number Greater than 2
        • Then - Actions
          • For each (Integer B) from 2 to Item_Number, do (Actions)
            • Loop - Actions
              • Hero - Drop (Item carried by (Hero manipulating item) of type (Item-type of (Item being manipulated))) from (Hero manipulating item)
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: (You can only have two + (Name of (Item being manipulated)) + at a time!))
        • Else - Actions
          • Do nothing
+ rep pls :grin::grin::wink: this works 100% :D
 
Level 7
Joined
Mar 16, 2008
Messages
348
Code for verifying if upgrade is complete:
  • Events
    • Unit - A unit Finishes An Upgrade
  • Conditions
  • (researched tech-type) equal to (your upgrade)
  • Actions
    • Set ItemResearchFinish = true
When Item is bought verify if Upgrade has been researched:
  • Events
    • A unit acquires an item
  • Condition
    • (Item Being Manipulated) = to (your item)
  • Actions
    • If (All Conditions are True) then do (then actions) Else do (else actions)
      • If - Conditions
        • ItemResearchFinish = True
      • Then - Actions
        • Do Nothing
        • Else - Actions
          • Item - Item Remove (item being manipulated)
          • Game - Display to (Player Group(Owner of (Triggering Unit))) the text : You need (your research) to use that item, now you lost your money for not reading!!!!
If you need anything else TELL ME
 
Status
Not open for further replies.
Top