• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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,864
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