• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Item Restriction Trigger Issue

Status
Not open for further replies.
Level 6
Joined
Mar 6, 2006
Messages
169
Hello! Long ago since I last posted around here. Anyhow...

I've got an issue, well, actually I got several, but this is the one we're currently trying to figure out, but it's not going too well.

  • Hero Item restriction hero1
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Knight
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Last created item)) Equal to Long Sword
          • (Item-type of (Last created item)) Equal to Shield
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Item - Move (Item being manipulated) to (Position of (Triggering unit))

The problem is that I can't get it to work. The result of using that one, IDENTICAL to that one, is that the Knight cant pick anything up, it all falls out.

- Carrigage
 
Level 4
Joined
Sep 20, 2005
Messages
72
what are you trying to do? restrict the knight so that it can only pick up a long sword and shield?

well scrap the do nothing. It does nothing. (literally. its a waste of space. n put all your conditions in the triggers conditions, no need for if then)

and im assuming you made an error using last created item instead of item being manipulated in your conditions.
You should also use
  • Actions - Drop Item from Hero
instead of moving items

one last thing. You need an Or condition as no item is ever a long sword and a shield at the same time :wink:
 
Level 6
Joined
Mar 6, 2006
Messages
169
Thank you so very much!

It was as simple as just changing it from "Last created item" to "Item being manipulated"... I hadn't thought of that before.


Now, uh.. I havent got any working trigger for our next issue, but perhaps you could guide me in the right direction?

If any of the four heroes in the game walks up to a soldier, and enter a region surrounding that soldier, he'll recieve a quest, to kill an enemy boss.. You kill the boss, then you should be able to walk up to him again and recieve a new quest, but.. When I try to do this, it triggers both quests when you walk up to him the first time....

I'm not great at triggering, I've done mostly custom units, cinematics and such :)
 
Level 5
Joined
Jun 23, 2004
Messages
126
You could set up an Integer variable, say, called "QuestStats". Start it at 0. When they enter the region, check what it is. If it's zero, give them the new quest and set it to 1. When they return, if they've completed the quest, reward them, give them the new quest and set it to 2. (When they return, set it to 3...etc.)
 
Level 6
Joined
Mar 6, 2006
Messages
169
I've solved the primary item restriction trigger, to prevent one class from using another class' items, say - An axe wielding class cant pick up a sword, and so on.

However, I also want them to be limited to just ONE weapon each.
The way I want it, is so that when you attempt to pick up a new weapon, whilst already carrying one in your inventory, the weapon you're trying to pick up will instantly fall out, so the question is; how do I do this?

I'll post the item restriction trigger I am currently using:
<TRIGGER>


</TRIGGER>

I've solved the primary item restriction trigger, to prevent one class from using another class' items, say - An axe wielding class cant pick up a sword, and so on.

However, I also want them to be limited to just ONE weapon each.
The way I want it, is so that when you attempt to pick up a new weapon, whilst already carrying one in your inventory, the weapon you're trying to pick up will instantly fall out, so the question is; how do I do this?

I'll post the item restriction trigger I am currently using:
  • Hero Item restriction guardian
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Guardian
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Item-class of (Item being manipulated)) Equal to Purchasable) or ((Item-class of (Item being manipulated)) Equal to Miscellaneous)
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Item - Move (Item being manipulated) to (Position of (Triggering unit))
 
Last edited by a moderator:
Level 5
Joined
Jun 23, 2004
Messages
126
  • Restrict Items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to Paladin
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Set TempVar = 0
      • 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-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Permanent
            • Then - Actions
              • Set TempVar = (TempVar + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempVar Greater than 1
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
Of course you may want to mess around with the Item-Classes a bit or even use Item-Types, or possibly the Custom Values of items, but that's the general gist of it.
 
Level 6
Joined
Mar 6, 2006
Messages
169
Thank you! That worked perfectly fine, and it was easy to use.

However, my other trigger system wont work properly, never did actually, I realized this soon after I posted last time.

  • Hero Items restriction Knight
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Knight
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Item-class of (Item being manipulated)) Equal to Permanent)
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Item - Move (Item being manipulated) to (Position of (Triggering unit))
How do I make it so that he should be able to carry Miscellaneous Class-Items and Permanent Class-Items?

I Tried using different OR commands, but it doesnt seem to work!
 
Level 3
Joined
May 4, 2007
Messages
66
How do I make it so that he should be able to carry Miscellaneous Class-Items and Permanent Class-Items?

I Tried using different OR commands, but it doesnt seem to work!

Here is the trigger:
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Knight
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Item-class of (Item being manipulated)) Equal to Miscellaneous
            • (Item-class of (Item being manipulated)) Equal to Permanent
      • Then - Actions
      • Else - Actions
        • Hero - Drop (Item being manipulated) from (Triggering unit)
If u want now u can change item classes that knight is capable of carying
 
Level 6
Joined
Mar 6, 2006
Messages
169
How odd...

I used that trigger, and at first it didnt seem to work..
But I later realized that it do work, but not on Miscellaneous Class-items??

I changed a Miscellaneous item to Campaign Class instead, and then it worked perfectly fine... Is there ANY way to fix this?

I also realized I probably need to change the whole system, because there are only so many different item-classes, but there are so many different item restrictions.

Knight: Swords, Shields
Guardian: Axes
Dragoon: Spear, Medium Armor
Librarian: Staff, Book, Light Armour
Knight & Guardian: Heavy Armor

That's a total of 9 different item classes, which each would need different item class, and in Wc3 there are only 7 different item classes, of which one (Miscellaneous) doesn't seem to work.

Is there any other way I can do it? Instead of using Item Classes that is.


Oh, and I'd like to apologize for my constant questions... I'm new to the whole triggering thing - I'm mostly used to terrain and custom objects, but as we lack a good trigger editor...
I picked up the task, being an easy learner and all that.
 
Level 5
Joined
Jun 23, 2004
Messages
126
How odd...

I used that trigger, and at first it didnt seem to work..
But I later realized that it do work, but not on Miscellaneous Class-items??

I changed a Miscellaneous item to Campaign Class instead, and then it worked perfectly fine... Is there ANY way to fix this?

I also realized I probably need to change the whole system, because there are only so many different item-classes, but there are so many different item restrictions.

Knight: Swords, Shields
Guardian: Axes
Dragoon: Spear, Medium Armor
Librarian: Staff, Book, Light Armour
Knight & Guardian: Heavy Armor

That's a total of 9 different item classes, which each would need different item class, and in Wc3 there are only 7 different item classes, of which one (Miscellaneous) doesn't seem to work.

Is there any other way I can do it? Instead of using Item Classes that is.


Oh, and I'd like to apologize for my constant questions... I'm new to the whole triggering thing - I'm mostly used to terrain and custom objects, but as we lack a good trigger editor...
I picked up the task, being an easy learner and all that.

Well I see you've come up against a bit of a barrier with using Item Classes. The only real way around this that I can see is simply checking for every type of item the character can use. There is something of a shortcut though. Make 2 types of items, say, Permanent and Miscellaneous. Make all class-specific items Permanent and make all items that can be used by anyone, Miscellaneous items. Then for the trigger do: (and this is approximate).

  • Restrict Items
  • Events
    • Unit - A unit acquires an Item
  • Conditions
    • (Item-Class of (Item being manipulated) Is equal to (Permanent))
  • Actions
    • If (All conditions are true) Then do (Then Actions) Else do (Else Actions)
      • If - Conditions
        • (Unit-Type of (Hero manipulating item) Is equal to (Knight))
        • Or - And (conditions) are true
          • Conditions
            • (Item-Type of (Item being manipulated) Is equal to (Sword))
            • (Item-Type of (Item being manipulated) Is equal to (Shield))
            • (Etc.)
      • Then - Actions
        • Skip remaining actions
      • Else - Actions
        • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Skip remaining actions
    • If (All conditions are true) Then do (Then Actions) Else do (Else Actions)
      • If - Conditions
        • (Unit-Type of (Hero manipulating item) Is equal to (Librarian))
        • Or - And (conditions) are true
          • Conditions
            • (Item-Type of (Item being manipulated) Is equal to (Staff))
            • (Item-Type of (Item being manipulated) Is equal to (Book))
            • (Etc.)
      • Then - Actions
        • Skip remaining actions
      • Else - Actions
        • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Skip remaining actions
Etc. for each hero type and item type. Helpful? :wink:

Edit: Fixed formatting and Mage -> Librarian. Also, your plans seem remarkably similar to mine...I'm doing a King Arthur RPG.

Edit2: Added some efficiency stuff.
 
Level 6
Joined
Mar 6, 2006
Messages
169
Hehe... Well, an RPG is always an RPG.
It's just a matter of how you execute it!

Mine's an RPG about Elves, its not directly related to the original warcraft universe. It's just based on it.

And it'll contain the most common Wc3 RPG elements, such as restricted items, save/load function, quests, bosses and in my opinion an EXCELLENT Hero selection system!
Bye bye walking on Circle of powers! And welcome keyboard selection!

Anywho, I'll try this trigger and see if it works.

And this'll probably sound rather retarded, but I wish terraining was as simply done as triggers... Triggers are easy to do, 'cause selecting different options in a list is far more easier than making an enormous map look detailed and natural-
...Although easier fixed than a bugged out trigger :p
 
Level 2
Joined
May 15, 2007
Messages
27
Not to be a dick, but keyboard controls is a rather average sub par method for hero selection. Not to mention nothing new.

However something new would involve making it much more like the methods used in modern games.

Maybe using something such as an arrow model to swap through large model representations of your choice.
Or maybe flat models with a picture of the hero on it when clicked brings up a model of the hero with some text describing him.


Just some random thoughts, because using the arrow keys for hero selection seems to me to be a waste. Unless the entire game is played with the keyboard.
 
Level 6
Joined
Mar 6, 2006
Messages
169
I just realized.. If I use that item restriction trigger, it means I'll have to change my current "Max one item-class" trigger.
The one that restricts you to only 1 sword / shield / etc. at a time.

I guess the easiest way to change it would be to change
  • (Item-class of (Item being manipulated)) Equal to Permanent
Into
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-Type of (Item being manipulated) Is equal to (Sword))
          • (Item-Type of (Item being manipulated) Is equal to (Shield))
          • (Item-Type of (Item being manipulated) Is equal to (Etc.))
This is the entire trigger I'm currently using.. I'm not sure if my solution will work or if I mess everything up...

  • One item Max
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to Knight
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Set TempVar = 0
      • 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-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Permanent
            • Then - Actions
              • Set TempVar = (TempVar + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempVar Greater than 1
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cffff0000You can o...
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
Would I have to create two different identical triggers, with the one differance that one got all the Swords in it, the other one got all the shields in it?

'Cause the one I got now only restricts the knight from wielding more than 1 sword at a time, and it says "You can only wield 1 sword at a time!" when you try to pick up a second sword.

Or is there another way to solve it?
 
Last edited by a moderator:
Level 5
Joined
Jun 23, 2004
Messages
126
I think you understand how to do it but just are a little hesitant. Or at least, I think so :p

Take the current trigger you have, the one right up there, and instead of doing
  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Permanent
Do a similar thing that I did with the OR function
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Item-Type of (Item being manipulated) Is equal to (Sword1))
        • (Item-Type of (Item being manipulated) Is equal to (Sword2)
        • (Item-Type of (Item being manipulated) Is equal to (Etc.))
Only change it like that so it's considering all Swords, instead of all Knight weapons.

Helpful? :)

Edit: Bit of an edit there, you don't need the If-Then-Else, just the Or condition.
 
Level 6
Joined
Mar 6, 2006
Messages
169
Well.. I've tried many different ways now, and no matter what I do it just wont work! I'm not too used to triggers as foretold, so I'm unable to locate the error without spending hours trying different directions of approach.

So I'll simply just post both triggers here that I'm trying to get to work together with the system that Permanent items are Item-class items (Knight, Librarian, Guardian, & Dragoon ONLY!), and Miscellaneous items can be picked up by anyone, and as many as you want.


Below is the trigger that's supposed to restrict each hero to 1 of each Type of item (Swords, Staves, etc.)

  • One item Max
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Hero manipulating item)) Equal to Knight
          • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Set TempVar = 0
      • 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-type of (Item being manipulated)) Equal to Animators Blade
              • (Item-type of (Item being manipulated)) Equal to Broadsword
              • (Item-type of (Item being manipulated)) Equal to Crystalsword
              • (Item-type of (Item being manipulated)) Equal to Death's Will
              • (Item-type of (Item being manipulated)) Equal to Fierce Sword
              • (Item-type of (Item being manipulated)) Equal to Glimmering Sword
              • (Item-type of (Item being manipulated)) Equal to Knight's Blade
              • (Item-type of (Item being manipulated)) Equal to Patriarch Blade
              • (Item-type of (Item being manipulated)) Equal to Quick Blade
              • (Item-type of (Item being manipulated)) Equal to Reaper's Executioner
              • (Item-type of (Item being manipulated)) Equal to Ezkalibael, the Dead
              • (Item-type of (Item being manipulated)) Equal to Kabot, the Silencer
              • (Item-type of (Item being manipulated)) Equal to Immolator, the Reaper
              • (Item-type of (Item being manipulated)) Equal to Arcis, the World Bearer
            • Then - Actions
              • Set TempVar = (TempVar + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempVar Greater than 1
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cffff0000You can o...
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
Below is the trigger that's supposed to restrict the hero to only being able to wield his assigned weapon type, (Knight can only use sword, Librarian only staff, etc.)

  • Item Restriction
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Hero manipulating item)) Equal to Knight
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Animators Blade
              • (Item-type of (Item being manipulated)) Equal to Broadsword
              • (Item-type of (Item being manipulated)) Equal to Crystalsword
              • (Item-type of (Item being manipulated)) Equal to Death's Will
              • (Item-type of (Item being manipulated)) Equal to Fierce Sword
              • (Item-type of (Item being manipulated)) Equal to Glimmering Sword
              • (Item-type of (Item being manipulated)) Equal to Knight's Blade
              • (Item-type of (Item being manipulated)) Equal to Patriarch Blade
              • (Item-type of (Item being manipulated)) Equal to Quick Blade
              • (Item-type of (Item being manipulated)) Equal to Reaper's Executioner
              • (Item-type of (Item being manipulated)) Equal to Ezkalibael, the Dead
              • (Item-type of (Item being manipulated)) Equal to Kabot, the Silencer
              • (Item-type of (Item being manipulated)) Equal to Immolator, the Reaper
              • (Item-type of (Item being manipulated)) Equal to Arcis, the World Bearer
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Hero manipulating item)) Equal to Guardian
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Arc Axe
              • (Item-type of (Item being manipulated)) Equal to Broad Axe
              • (Item-type of (Item being manipulated)) Equal to Crushing Axe
              • (Item-type of (Item being manipulated)) Equal to Doom Blade
              • (Item-type of (Item being manipulated)) Equal to Evil Axe
              • (Item-type of (Item being manipulated)) Equal to Grunt's Axe
              • (Item-type of (Item being manipulated)) Equal to Heavy Blade
              • (Item-type of (Item being manipulated)) Equal to Jinxed Axe
              • (Item-type of (Item being manipulated)) Equal to Killing Blade
              • (Item-type of (Item being manipulated)) Equal to Luminous Axe
              • (Item-type of (Item being manipulated)) Equal to Raw, End of Days
              • (Item-type of (Item being manipulated)) Equal to Fleshrender
              • (Item-type of (Item being manipulated)) Equal to Earthshatterer
              • (Item-type of (Item being manipulated)) Equal to Death Cleaver
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Hero manipulating item)) Equal to Librarian
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Zul'Fan's Dreadful Staff
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Hero manipulating item)) Equal to Dragoon
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Equal to Spear
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • Skip remaining actions
 
Level 5
Joined
Jun 23, 2004
Messages
126
Ok, can you explain exactly what you want done?

Include all the item names ect, and I will complete a trigger that will do exactly what you want.

Don't bother.

You're missing the OR function for your only-one-sword thing. The requirement for setting TempVar = TempVar + 1 is requiring that the Manipulated Item is ALL of the swords, which it can never be. So make sure all those item type checks are under one big OR. That should fix that.

I don't see anything wrong with the class-specific trigger. Does that work?
 
Level 6
Joined
Mar 6, 2006
Messages
169
I've done exactly what you said... and the result is that the Knight cant pick up any swords at all, it says he can only wield one at a time, when he havent even got one!

Everything else seems to work, he cant pickup axes, but he can pick up potions
 
Level 5
Joined
Jun 23, 2004
Messages
126
  • One item Max
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Hero manipulating item)) Equal to Knight
        • (Item-class of (Item being manipulated)) Equal to Permanent
  • Actions
    • Set TempVar = 0
    • 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
            • Or - Any (Conditions) are true
              • Conditions
                • (Item-type of (Item being manipulated)) Equal to Animators Blade
                • (Item-type of (Item being manipulated)) Equal to Broadsword
                • (Item-type of (Item being manipulated)) Equal to Crystalsword
                • (Item-type of (Item being manipulated)) Equal to Death's Will
                • (Item-type of (Item being manipulated)) Equal to Fierce Sword
                • (Item-type of (Item being manipulated)) Equal to Glimmering Sword
                • (Item-type of (Item being manipulated)) Equal to Knight's Blade
                • (Item-type of (Item being manipulated)) Equal to Patriarch Blade
                • (Item-type of (Item being manipulated)) Equal to Quick Blade
                • (Item-type of (Item being manipulated)) Equal to Reaper's Executioner
                • (Item-type of (Item being manipulated)) Equal to Ezkalibael, the Dead
                • (Item-type of (Item being manipulated)) Equal to Kabot, the Silencer
                • (Item-type of (Item being manipulated)) Equal to Immolator, the Reaper
                • (Item-type of (Item being manipulated)) Equal to Arcis, the World Bearer
          • Then - Actions
            • Set TempVar = (TempVar + 1)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • TempVar Greater than 1
              • Then - Actions
                • Game - Display to (Player group((Triggering player))) the text: |cffff0000You can o...
                • Hero - Drop (Item being manipulated) from (Hero manipulating item)
              • Else - Actions
Take a look at your trigger and the trigger here and see the difference. You were demanding that the item being picked up was somehow ALL the swords. You were missing the OR that would instead require the picked up item to be ANY of the swords. Or, did you already fix this?
 
Level 6
Joined
Mar 6, 2006
Messages
169
I already fixed that... So I can't quite see what the problem is.

For some reason, he can pickup several swords without any restriction whatsoever.

He can't pick up Axes / staves / spears however, so that seems to work properly.

*Nudge*

My project is at halt only because of this trigger issue.. I could use some help :p
 
Last edited by a moderator:
Level 5
Joined
Jun 23, 2004
Messages
126
Ohgod haha! Sorry man! XD I messed up a tad.

  • One item Max
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Hero manipulating item)) Equal to Knight
        • (Item-class of (Item being manipulated)) Equal to Permanent
  • Actions
    • Set TempVar = 0
    • 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
            • Or - Any (Conditions) are true
              • Conditions
                • (Item-type of (Item being manipulated)) Equal to Animators Blade
                • (Item-type of (Item being manipulated)) Equal to Broadsword
                • (Item-type of (Item being manipulated)) Equal to Crystalsword
                • (Item-type of (Item being manipulated)) Equal to Death's Will
                • (Item-type of (Item being manipulated)) Equal to Fierce Sword
                • (Item-type of (Item being manipulated)) Equal to Glimmering Sword
                • (Item-type of (Item being manipulated)) Equal to Knight's Blade
                • (Item-type of (Item being manipulated)) Equal to Patriarch Blade
                • (Item-type of (Item being manipulated)) Equal to Quick Blade
                • (Item-type of (Item being manipulated)) Equal to Reaper's Executioner
                • (Item-type of (Item being manipulated)) Equal to Ezkalibael, the Dead
                • (Item-type of (Item being manipulated)) Equal to Kabot, the Silencer
                • (Item-type of (Item being manipulated)) Equal to Immolator, the Reaper
                • (Item-type of (Item being manipulated)) Equal to Arcis, the World Bearer
          • Then - Actions
            • Set TempVar = (TempVar + 1)
          • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • TempVar Greater than 1
      • Then - Actions
        • Game - Display to (Player group((Triggering player))) the text: |cffff0000You can o...
        • Hero - Drop (Item being manipulated) from (Hero manipulating item)
      • Else - Actions
Change it to that so the second If-Then isn't under anything.
 
Level 6
Joined
Mar 6, 2006
Messages
169
It's still not working.. He just keeps dropping the item and it says that he can only wield one sword at a time, as if he already had a sword in his inventory...

It's identical to the trigger in your last post, I've checked it like 4 times now.. So, either it's a bad trigger, or perhaps I've set the TempVar incorrectly?

Is the TempVar variable supposed to be an Integer 0 (Default), no Array's ?
 
Level 5
Joined
Jun 23, 2004
Messages
126
Wow I'm really sorry, I did it again...I suppose that's what I get for cannibalizing your trigger and not double-checking everything.

  • One item Max
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Hero manipulating item)) Equal to Knight
        • (Item-class of (Item being manipulated)) Equal to Permanent
  • Actions
    • Set TempVar = 0
    • 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
            • Or - Any (Conditions) are true
              • Conditions
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Animators Blade
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Broadsword
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Crystalsword
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Death's Will
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Fierce Sword
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Glimmering Sword
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Knight's Blade
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Patriarch Blade
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Quick Blade
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Reaper's Executioner
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Ezkalibael, the Dead
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Kabot, the Silencer
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Immolator, the Reaper
                • (Item-type of (Item in inventory slot(Integer A))) Equal to Arcis, the World Bearer
          • Then - Actions
            • Set TempVar = (TempVar + 1)
          • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • TempVar Greater than 1
      • Then - Actions
        • Game - Display to (Player group((Triggering player))) the text: |cffff0000You can o...
        • Hero - Drop (Item being manipulated) from (Hero manipulating item)
      • Else - Actions
Anyway...once again, this should work.

Just in case it doesn't and there's some minor thing, lemme lay out the steps of what this trigger is supposed to do.

1) Set TempVar to 0.
2) Do a For Loop 1-6 checking all 6 inventory slots for swords. +1 to TempVar for each one.
3) Check to see if TempVar is above 1, and if so drop the item being manipulated.

Oh and yes, TempVar is Integer (Default 0) no array.

Edit: Note that the Item In Inventory Slot thing I slipped in there isn't the actual function I just did it from memory. I'm sure you can find the one I'm talking about.
 
Level 6
Joined
Mar 6, 2006
Messages
169
Awesome! Now it works perfectly fine.

There's one thing that I did seem to have an issue with earlier, when Guardian couldnt pick up axes because it said he was already carrying a sword.. Or something similar, I'll have to fix all the triggers up and test again.

One question though - Can I just copy this trigger, and change all the items to shields, and it'll restrict the knight to just one sword, and one shield?
 
Status
Not open for further replies.
Top