System Wielding

XxShadyxX

I abused the rep system.
Reaction score
81
Equipment Wielding System

Wielding System
By: XxShadyxX

Table of Contents

Section 1 What is a Weapon Wielding System?
Section 2 What do I use it for?
Section 3 The Code
Section 4 How To Implement
Section 5 Q/A


Section 1
What is a Wielding System?
A weapon wielding system is a very easy system to use. What it does is that when you use a Item for example a piece of armor. You don't get the effect until you equip it. Also this system checks if you already have something equiped then it puts the item back in your inventory. An optional choice is to use weaponless models. And have when you equip it shows it on your hero. This system has no lags, no leaks, and very easy to implement into your map.


Section 2
What do I use it for?
Orpgs
Maps that need Inventory Space.
Whatever you want! :D


Section 3
The Code

Variables Needed
Armor_Ability
Ability Array

Attachment_Armor (Optional)
Special Effect Array

Equiping_Unit
Unit Array

Item_Type_Armor
Item Type array

Wielding_Armor
Boolean Array

Trigger:
  • Map Int
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Armor Unequip <gen> the event (Player - (Picked player) types a chat message containing -unequip armor as An exact match)

Map int. Must have!!

Armor Equip

Trigger:
  • Armor Equip
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • -------- Begginers Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff00ffffArmor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
              • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
              • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
              • Game - Display to (All players) the text: ((Name of (Item being manipulated)) + has been equiped.)
              • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Leather Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff008000Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
              • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
              • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
              • Unit - Add Item Armor Bonus (+1) to (Triggering unit)
              • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+1)
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
              • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Bronze Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff008000Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Triggering unit)) Less than or equal to 3
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You Do not meet the...
                • Else - Actions
                  • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
                  • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
                  • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
                  • Unit - Add Item Armor Bonus (+2) to (Triggering unit)
                  • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+2)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
                  • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Iron Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff008000Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Triggering unit)) Less than or equal to 4
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You Do not meet the...
                • Else - Actions
                  • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
                  • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
                  • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
                  • Unit - Add Item Armor Bonus (+3) to (Triggering unit)
                  • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+3)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
                  • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Steel Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff008000Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Triggering unit)) Less than or equal to 4
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You Do not meet the...
                • Else - Actions
                  • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
                  • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
                  • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
                  • Unit - Add Item Armor Bonus (+5) to (Triggering unit)
                  • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+5)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
                  • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Dark Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff008000Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Triggering unit)) Less than or equal to 4
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You Do not meet the...
                • Else - Actions
                  • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
                  • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
                  • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
                  • Unit - Add Item Armor Bonus (+6) to (Triggering unit)
                  • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+6)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
                  • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Half Plate Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff008000Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Triggering unit)) Less than or equal to 5
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You Do not meet the...
                • Else - Actions
                  • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
                  • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
                  • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
                  • Unit - Add Item Armor Bonus (+7) to (Triggering unit)
                  • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+7)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
                  • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Plate --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff008000Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Triggering unit)) Less than or equal to 5
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You Do not meet the...
                • Else - Actions
                  • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
                  • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
                  • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
                  • Unit - Add Item Armor Bonus (+8) to (Triggering unit)
                  • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+8)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
                  • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Double Plate --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff008000Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Triggering unit)) Less than or equal to 8
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You Do not meet the...
                • Else - Actions
                  • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
                  • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
                  • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
                  • Unit - Add Item Armor Bonus (+9) to (Triggering unit)
                  • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+9)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
                  • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Gold Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cff008000Armor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Triggering unit)) Less than or equal to 9
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You Do not meet the...
                • Else - Actions
                  • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
                  • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
                  • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
                  • Unit - Add Item Armor Bonus (+10) to (Triggering unit)
                  • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+10)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
                  • Item - Remove (Item being manipulated)
        • Else - Actions
      • -------- Bone Armor --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cffff80ffArmor|r
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Wielding_Armor[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You are already wea...
              • Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of (Triggering unit)) Less than or equal to 11
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You Do not meet the...
                • Else - Actions
                  • Set Equiping_Unit[(Player number of (Owner of (Triggering unit)))] = (Hero manipulating item)
                  • Set Wielding_Armor[(Player number of (Owner of (Triggering unit)))] = True
                  • Set Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item being manipulated))
                  • Unit - Add Item Armor Bonus (+12) to (Triggering unit)
                  • Set Armor_Ability1[(Player number of (Owner of (Triggering unit)))] = Item Armor Bonus (+12)
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: ((Name of (Item being manipulated)) + has been equiped.)
                  • Item - Remove (Item being manipulated)
        • Else - Actions


Trigger:
  • Armor Unequip
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wielding_Armor[(Player number of (Triggering player))] Equal to True
        • Then - Actions
          • Set Wielding_Armor[(Player number of (Triggering player))] = False
          • Hero - Create Item_Type_Armor[(Player number of (Owner of (Triggering unit)))] and give it to Equiping_Unit[(Player number of (Triggering player))]
          • Game - Display to (All players) the text: You have unequiped ...
          • Unit - Remove Armor_Ability[(Player number of (Triggering player))] from Equiping_Unit[(Player number of (Triggering player))]
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You are not wearing...


Section 4
How to Implement

Copy the Item and its abilities
Copy the folder to your map.
Copy the Armor Equip trigger for each type of equipment you want: Shield, Weapon, Armor etc...

Copy the Item for as many items you need.
Set up the stats of the equipment to the ability for the item.
Copy the whole armor part for the first armor and copy and paste for how many armor you have and the same for your other equipment.
The Special Effect and the weaponless models are all optional and easily removed

Section 5
Q/a
None yet






Section 6
Updates:
Fixed the unwield so the Item doesn't disapear
Added Level Restrictions
Made it more Implement easy





Soon to come!
Item restrict for certain classes!
Weapons and Shields




:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D
 

Attachments

  • Wielding System.w3x
    184.4 KB · Views: 208

XxShadyxX

I abused the rep system.
Reaction score
81
Hmm what do you mean?
Also sorry about the bumbs.
I think there is something wrong with my profile cuz i could not find my thread anywhere. It wouldn't show on new posts or in the tutorials section or even on search. The only way I was able to find it was with my use profile statistics/threads
 

Bloodcount

Starcraft II Moderator
Reaction score
297
Ok, I wasn't going to say anything but, since I see that you want feedback, and I know what it is when you don't get any feedback here:

one really long trigger :d

Overall, good and efficient and it is good for GUI users.

Cons are that.... it is not exactly easy to use. There are quite a lot of ways to do this kind of system. Tbh, I can think up of 3 ways that require no variables and are simpler (Oninuva proof :O ) But your system is also good. How about the Q&A's then :d
 

XxShadyxX

I abused the rep system.
Reaction score
81
Yea....
Thank you for the feedback
Hmm. So how do I simplify the code? I don't know Jass.
What About the Qand A?
 

Romek

Super Moderator
Reaction score
963
From a quick glance, it seems most of this could just be done in a loop, instead of one giant trigger.
This most certainly isn't a very easy to use system. It'd probably take longer to configure this, then it would to just recreate it.

Smiley spam isn't cool.
 

XxShadyxX

I abused the rep system.
Reaction score
81
Romek.
Hmm I tried figuring out another way but I just can't think of any.
So how would I do this in one giant loop?

Oh do you want me to take out the smileys?

Can you elaborate on what you said for me please?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top