Class Items

EcHo_Tempest

New Member
Reaction score
1
hi :D

how would i make specific items for specific classes?

like i have a hero thats a warrior and a hero thats a mage. the shop has items only for warrior so only warrior can use but mage cant use it.

thanks for the help!
 

Exide

I am amazingly focused right now!
Reaction score
448
This should probably do it:

Trigger:
  • Class Items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set msgGroup = (Player group((Triggering player)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Triggering unit)) Not equal to 1
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Game - Display to msgGroup the text: Druids only!
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Triggering unit)) Not equal to 2
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Game - Display to msgGroup the text: Warriors only!
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Mask of Death
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Triggering unit)) Not equal to 3
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Game - Display to msgGroup the text: Assassins only!
            • Else - Actions
        • Else - Actions
      • Custom script: call DestroyForce(udg_msgGroup)


You will need to set the custom value of your heroes when the game starts. (In this example: Custom Value: 1 = Druids. CV: 2 = Warriors. 3 = Assassins.)
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
I think much better way would be adding all the Tank heroes to Group1, Fighting heroes to Group2 and Mage heroes to Group3 and check in which group is the unit since you may change their custom values during the game (it's used quite often you know)
 

Firezy

New Member
Reaction score
14
Well I'm using this trigger

Trigger:
  • Shield
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Kite Shield
          • (Item-type of (Item being manipulated)) Equal to Iron Shield
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Hero manipulating item)) Equal to Evil Incarnate
              • (Unit-type of (Hero manipulating item)) Equal to Crystal Titan
        • Then - Actions
        • Else - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cFFFFCC00You canno...
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)


Basically just change the items/heroes
 

EcHo_Tempest

New Member
Reaction score
1
OOooo Thanks!!! ill give that a try!

Edit: haha it worked wonders thanks much more easy than the first one. but i would recommend the first one since imo there will be less triggering since iam making a orpg i think doing it by item class is more simple.
 
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