• 🏆 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!

Item Classes

Status
Not open for further replies.
Level 6
Joined
Apr 29, 2007
Messages
140
I recommend using this for all your item class needs: http://www.hiveworkshop.com/forums/...-279/ids-infinite-number-item-classes-162448/ made by -Kobas-

For your trigger however, you might have to make a dummy Item that looks like a bow but has no stats. When the Wizard picks up the normal bow, replace it with the dummy bow. When the wizard drops the Dummy bow, replace it with the normal bow. just a little example, I'm sure there are other ways
 
Ok, here:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_Hash = InitHashtable()
      • -------- Item Classes --------
      • Set Items[1] = Sword
      • Set Items[2] = Bow
      • Set Items[3] = Axe
      • -------- Sword class --------
      • Custom script: call SaveInteger (udg_Hash, udg_Items[1], StringHash("class"), 0)
      • -------- Bow class --------
      • Custom script: call SaveInteger (udg_Hash, udg_Items[2], StringHash("class"), 1)
      • -------- Axe class --------
      • Custom script: call SaveInteger (udg_Hash, udg_Items[3], StringHash("class"), 2)
      • -------- Character Classes --------
      • Set Heroes[1] = Blademaster
      • Set Heroes[2] = Priestess of the Moon
      • Set Heroes[3] = Tauren Chieftain
      • -------- Sword class --------
      • Custom script: call SaveInteger (udg_Hash, udg_Heroes[1], StringHash("class"), 0)
      • -------- Bow class --------
      • Custom script: call SaveInteger (udg_Hash, udg_Heroes[2], StringHash("class"), 1)
      • -------- Axe class --------
      • Custom script: call SaveInteger (udg_Hash, udg_Heroes[3], StringHash("class"), 2)
  • Items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Custom script: local sound s
      • Custom script: local integer array i
      • Custom script: set i[1] = GetUnitTypeId (GetTriggerUnit())
      • Custom script: set i[2] = GetItemTypeId (GetManipulatedItem())
      • Custom script: set i[3] = LoadInteger (udg_Hash, i[1], StringHash("class"))
      • Custom script: set i[4] = LoadInteger (udg_Hash, i[2], StringHash("class"))
      • Custom script: if i[3] != i[4] then
      • Custom script: set s = CreateSound ("Sound\\Interface\\Error.wav", false, false, false, 10, 10, "")
      • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
      • Custom script: call StartSound (s)
      • Custom script: endif
      • Custom script: call KillSoundWhenDone (s)
      • Game - Display to (Player group((Owner of (Triggering unit)))) for 2.00 seconds the text: ...
      • Hero - Drop (Item being manipulated) from (Triggering unit)
      • Custom script: endif
      • Custom script: set s = null
So, we create a numeric system, which will combine the classes of the items with the classes of the heroes/characters. This way, 0 will represent the "Warrior" class, 1 will represent the "Archer" class and 2 will represent the "Barbarian" class, which mean Sword, Bow and Axe respectively.

You can add as many extra item-types as you want.
What I did is actually save a value that will virtually represent the class on the item-type and the unit-type accordingly, to define what item-type is considered as which classe's restriction.

Test Map:
 

Attachments

  • Class Item Restriction.w3x
    18.3 KB · Views: 53
Artifact - 1h
Permanent - Head
Campaign - 2h


One-Hand:
1 - Swords
2 - Axes
3 - Shields
4 - Maces
5 - Daggers/Fist

Two-Hand
1 - Swords
2 - Axes
3 - Staves
4 - Maces
5 - Bows

Note that Sword[PN] etc. are set when you chose a class. So yes they can use this item

  • Equipment Classifications
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set PN = (Player number of (Owner of (Triggering unit)))
      • -------- ONE HANDED WEAPONS --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Artifact
            • (Item level of (Item being manipulated)) Equal to (==) 1
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Swords[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Artifact
            • (Item level of (Item being manipulated)) Equal to (==) 2
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Axes[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Artifact
            • (Item level of (Item being manipulated)) Equal to (==) 3
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Shields[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Artifact
            • (Item level of (Item being manipulated)) Equal to (==) 4
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Maces[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Artifact
            • (Item level of (Item being manipulated)) Equal to (==) 5
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Daggers[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
      • -------- HELMS --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Permanent
            • (Item level of (Item being manipulated)) Equal to (==) 1
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Multiple ConditionsAnd - All (Conditions) are true
                  • Conditions
                    • ArmorLevel[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Permanent
            • (Item level of (Item being manipulated)) Equal to (==) 2
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ArmorLevel[PN] Less than (<) 2
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
      • -------- TWO HANDED WEAPONS --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Campaign
            • (Item level of (Item being manipulated)) Equal to (==) 2
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Axes[PN] Less than (<) 1
                • TwoHandedWeapons[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Campaign
            • (Item level of (Item being manipulated)) Equal to (==) 1
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Swords[PN] Less than (<) 1
                • TwoHandedWeapons[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Campaign
            • (Item level of (Item being manipulated)) Equal to (==) 3
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Staves[PN] Less than (<) 1
                • TwoHandedWeapons[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Campaign
            • (Item level of (Item being manipulated)) Equal to (==) 4
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Maces[PN] Less than (<) 1
                • TwoHandedWeapons[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-class of (Item being manipulated)) Equal to (==) Campaign
            • (Item level of (Item being manipulated)) Equal to (==) 5
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Bows[PN] Less than (<) 1
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000You do no...
              • Else - Actions
          • Else - Actions
 
Status
Not open for further replies.
Top