• 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.

Maximum item in invent

Status
Not open for further replies.
Level 1
Joined
May 9, 2012
Messages
1
Hello!
I'm making an wc3 map but im stuck.

Making a litle "rpg" a like thing.

But im wondering how you make the item class/hero bound + how you make it so the hero can just wield 1 of the item.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Suggestion: Start with something simpler. This will overwhelm you and you'll eventually leave the project behind.

Answer. You can use a Hashtable to save a value in the unit ID based on the acquired item. You can also use item Custom Value, or some Integer Array to check the busy slots.
 
Level 17
Joined
Jul 17, 2011
Messages
1,863
Or you can use something like this:
  • Untitled Trigger 006
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • -------- This checks for the hero class --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Hero manipulating item)) Equal to Footman
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-class of (Item being manipulated)) Not Equal to Permanent
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
            • Else - Actions
        • Else - Actions
      • -------- This checks if a hero already has an item of the same class --------
      • 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 level of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to 1
            • Then - Actions
              • Set hasitem = (hasitem + 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • hasitem Greater than 1
                • Then - Actions
                  • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                    • Set hasitem = 0
                • Else - Actions
nothing complex really
works by checking what type of hero aquires the item
example:A paladin can only wield "Permanent" item class
If a Paladin aquires a hammer this will check if the item class is permanent
if its not it will simply drop it
--------------------------------------------
the second one checks what the item type is
if a hero already has an item of the same level it will drop it
 
Status
Not open for further replies.
Top