• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Basic Equipment System

Status
Not open for further replies.
Level 2
Joined
Apr 10, 2021
Messages
16
How to make basic equipment system;

If player have a Armor (Can't pick more than 1)
If player have a Sword (Can't pick more than 1)
If player is archer (Can't pick Sword)
etc.
 
Level 18
Joined
Oct 17, 2012
Messages
821
You can import Item Restriction System and then do the following:

The system is coded in plain JASS via ordinary means, so it should function properly in older patches.

Create these variables:
  • ItemType - Item-Type
  • ItemClass - String
  • HeroClass - String
  • Level - Integer
  • STR, AGI, INT - Integer
  • MeleeOrRange - Integer
  • Example
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet ItemType = Claws of Attack +15
      • Set VariableSet ItemClass = "Weapon"
      • Set VariableSet HeroClass = "Mountain King"
      • Set VariableSet Level = 10
      • Set VariableSet STR = 10
      • Set VariableSet AGI = 10
      • Set VariableSet INT = 10
      • -------- 0 for Both, 1 for Range Only, 2 for Melee Only --------
      • Set VariableSet MeleeOrRange = 1
      • Custom script: call IRS_ItemRegistration (udg_ItemType, udg_ItemClass, udg_HeroClass, udg_Level, udg_STR, udg_AGI, udg_INT, udg_MeleeOrRange)
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,378
you can also use item level. For example item level 1 = melee weapons, so if unit wants to pick an item, you check if it does not already have an item with level 1 and if yes, you prevent the unit from picking the new item.
Items by default allow levels between 0 and 8, but shift clicking the field allows you to paste in a custom value. I set it to 40 and the game also returned 40, so it should work for you.
 
Status
Not open for further replies.
Top