• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Making a hero only able to wear/wield 1 item type.

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2008
Messages
243
Common RPG standards, unit can only wield/wear 1 weapon, armour, ect at a time.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
Can't figure out how to do a search if the triggering unit has a specific item class. Any help?

Ofc, if you can suggest a better method than this (one that isn't item type dependant) I'd much more appreciate it.
 
Something like this:
  • Item Trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has (Item being manipulated)) Equal to True
        • Then - Actions
          • Set TempLoc = (Position of (Triggering unit))
          • Item - Remove (Item being manipulated)
          • Item - Create (Item-type of (Item being manipulated)) at TempLoc
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You can only carry ...
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc)
I dunno, didn't test it. Anyway, you can also try making it artifact. I am not sure if that makes it unique or not, doubt it but it is worth a shot. :\
 
Level 9
Joined
May 22, 2009
Messages
276
That won't work purge, you'll always have the item being manipulated in your inventory, so you'll always drop the item, even if you don't have another one

I've actually made such a system 2 days ago, even tho it checks item level instead of item class, but that can easily be changed, just use item-class condition instead of integer condition:

  • Pick up Permanent
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Set ItemsCarried = 0
      • 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 being manipulated)) Equal to (Item-type of (Item carried by (Triggering unit) in slot (Integer A)))
            • Then - Actions
              • Set ItemsCarried = (ItemsCarried + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 4
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ItemsCarried Greater than or equal to 3
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ItemsCarried Greater than or equal to 2
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
            • Else - Actions
the good thing about this trigger, is when you want to have the hero be able to carry 2 of the item type/level, you just need to change the number for it

EDIT: this is the trigger if you ony want one item of each class: (use OR conditions and make a condition for each class you want to have limited to 1 item)

  • Pick up Permanent Copy
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Set ItemsCarried = 0
      • 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 being manipulated)) Equal to (Item-Class of (Item carried by (Triggering unit) in slot (Integer A)))
            • Then - Actions
              • Set ItemsCarried = (ItemsCarried + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemsCarried Greater than or equal to 2
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Game - Display to (All players) the text: YOU ALREADY HAVE TH...
        • Else - Actions
 
Status
Not open for further replies.
Top