Item Type condition

sionts

New Member
Reaction score
0
If i had Item_Type_Bow[(Integer A)] Equal to Tome of Experience
as a condition would "[(integer A)]" be all the items in the "Item type array"
 

sionts

New Member
Reaction score
0
i have 4 bows in a item type array

"set item_Type_Bow[1] = 1bow"
"set item_Type_Bow[2] = 2bow"
"set item_Type_Bow[3] = 3bow"
"set item_Type_Bow[4] = 4bow"

And certain hero types can use these items and these items cannot be manipulated.
 

sionts

New Member
Reaction score
0
i dont even get half of the triggers.

So how does this trigger, make certain heroes restricted from certain items?
Code:
Events
    Unit - A unit Acquires an item
Conditions
    ((Triggering unit) is A sapper) Equal to False
    Or - Any (Conditions) are true
        Conditions
            (Item-type of (Item being manipulated)) Equal to |cff007FFFMarkings of the Vampire|r
Actions
    Set TempUnit = (Triggering unit)
    Set TempItem = (Item being manipulated)
    Item - Set life of TempItem to 99999.00
    Player - Add (Integer((Current life of TempItem))) to TempPlayer Current gold
    Hero - Drop TempItem from TempUnit
    Item - Remove TempItem
    Game - Display to (Player group((Owner of (Triggering unit)))) for AAAADisplayTime seconds the text: |cff999999Only Warr...

It doesn't have any variables other then "tempunit, tempitem and Templayer."

It does't have anything like. "set warrior = (unit type array)" and there isn't any variables that resemble it.

If someone does get it please explain.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> It does't have anything like. "set warrior = (unit type array)"

Well, but it has a test that says "the unit that got this can not have the unit classification 'Sapper'".


Now, why it sets the item's life to some number, adds the life to the player's gold, then drops and removes the item... dunno.

Would be enough to simply add the gold and remove the item.

The "Or - multiple" condition isn't needed either, there's only one item type of interest here.


Event:
- A unit acquires an item
Conditions:
- Unit-type of (Hero manipulating item) equal to "some Hero type"
- Item-type of (Item being manipulated) equal to "item this type of Hero can not have"
Actions:
- Player - Add X to Owner of (Hero manipulating item) current Gold
- Item - Remove (Item being manipulated)
- Game - Display: "Sorry, you can't have this"


To restrict several Hero types from several item-types, use "better" conditions:

Or - Multiple conditions
- Item-type of (Item being manipulated) equal to Item1
- Item-type of (Item being manipulated) equal to Item2
- Item-type of (Item being manipulated) equal to Item3
- ...
Or - Multiple conditions
- Unit-type of (Hero manipulating item) equal to HeroType1
- Unit-type of (Hero manipulating item) equal to HeroType2
- Unit-type of (Hero manipulating item) equal to HeroType3
- ...

If any of those Heroes tries to get any of those items, they will be removed.
Or whatever you want to happen there.

And, a simple way to get the gold cost of an item is to set the hitpoints of the items to their gold cost.
Then you can simply add "Integer(Life of (Item being manipulated))" back to the player.
 

sionts

New Member
Reaction score
0
Would i need to create a new trigger to restrict heroes for having the same item? or is tehr a way to add this to the same trigger
 

sionts

New Member
Reaction score
0
just curious.

Code:
Conditions
    Or - Any (Conditions) are true
        Conditions
            (Unit-type of (Hero manipulating item)) Not equal to Paladin
            (Unit-type of (Hero manipulating item)) Not equal to Halarks
            (Unit-type of (Hero manipulating item)) Not equal to Arthas
            (Unit-type of (Hero manipulating item)) Not equal to Admiral Proudmoore
            (Unit-type of (Hero manipulating item)) Not equal to Warrior
            (Unit-type of (Hero manipulating item)) Not equal to Dark Knight
    Or - Any (Conditions) are true
        Conditions
            (Item-type of (Item being manipulated)) Equal to Reaver's Shield
            (Item-type of (Item being manipulated)) Equal to Thorium Disc
            (Item-type of (Item being manipulated)) Equal to Arcanite Disc
            (Item-type of (Item being manipulated)) Equal to Arcanite Shield

Having 2 "Or - any(conidtion) are true"
will work? like if the hero was not "any of those heroes AND he bought any of those shields" the shield would drop.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Having 2 "Or - any (conditions) are true" will work?

Why not?

If at least one condition inside the "or" is true, the entire "or" is true.
The result of both "or"s is used to check the entire "conditions" block.

So, the actions will only run if at least one condition is true in both blocks.

And, no, just having one "or" block returning true is not enough.

Or, with your example, if that Paladin would get a Cheese, which isn't in the list of items, nothing will happen.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top