Drop same type or same class items

S

SilentScream

Guest
Hi all. My english is not good but i will try to tell my problem.
i have a arena map but i dont want same and same type items carrying.
Example

Dwelling Hammer (artifact)
Thunder Mace (artifact)

player x purchased Dwelling hammer first. and the next one is thunder mace but i want if the player have a 1 artifact class item this player cannot pick other artifact items.
 
I

i-SCREAM

Guest
Code:
Item Drop
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Tome of Experience
        ((Item carried by (Triggering unit) of type Tome of Experience) is owned) Equal to True
    Actions
        Set Position = (Position of (Triggering unit))
        Item - Move (Item being manipulated) to Positiion
        Custom script:   call RemoveLocation(udg_Position)

Edit: What's so hard about using variables? I do think your trigger is probably better though.
 

Anything.

New Member
Reaction score
69
No offence to I-SCREAM, but I just got annoyed when I saw that code, when there's a simpler way which doesn't use variables (Simpler, but not necessarily shorter).

Code:
Double Check
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        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 (Item-class of (Item being manipulated))
                        (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
                        (Item-class of (Item being manipulated)) Not equal to Artifact
                    Then - Actions
                        Hero - Drop (Item being manipulated) from (Hero manipulating item)
                        Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffff0000You alrea...
                    Else - Actions
                        Do nothing
This is taken directly from my ORPG :rolleyes: Also, I'm skeptical about this part.
Code:
((Item carried by (Triggering unit) of type Tome of Experience) is owned) Equal to True
If you know what's good for you, and that condition works, then you should combine both of our triggers?
 
S

SilentScream

Guest
this ways is not working. im still try to make this trigger.
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Code:
hisItemOnlyOnce
    Events
        Unit - A unit Acquires an item
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Item-type of (Item being manipulated)) Equal to Healing Salve
                (Item-type of (Item being manipulated)) Equal to Rod of Necromancy
    Actions
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
                    Then - Actions
                        For each (Integer B) from ((Integer A) + 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 carried by (Hero manipulating item) in slot (Integer B))) Equal to (Item-type of (Item being manipulated))
                                    Then - Actions
                                        Hero - Drop the item from slot (Integer B) of (Hero manipulating item)
                                        Quest - Display to (Player group((Owner of (Hero manipulating item)))) the Warning message: Sorry, this item only once
                                    Else - Actions
                    Else - Actions

By AceHart. Look in the free trigger section, hero+item trigger to see the explenation by AceHart how this works.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Though that one compares particular items, not classes.
Post #3 had a decent try.

Or, some more inspiration:
Code:
Item Once Classes
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-class of (Item being manipulated)) Equal to Artifact
    Actions
        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 (Item-class of (Item being manipulated))
                        (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
                    Then - Actions
                        Item - Remove (Item being manipulated)
                        Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: Sorry.
                    Else - Actions


That said, "It doesn't work" is not a very good problem description.

If you tried a trigger and it's not really doing what it should, post it.
 
S

SilentScream

Guest
AceHart said:
Though that one compares particular items, not classes.
Post #3 had a decent try.

Or, some more inspiration:
Code:
Item Once Classes
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-class of (Item being manipulated)) Equal to Artifact
    Actions
        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 (Item-class of (Item being manipulated))
                        (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
                    Then - Actions
                        [COLOR=DarkRed]Hero - Drop (Item being manipulated) from (Triggering unit)(i will changed it)[/COLOR]
                        Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: Sorry.
                    Else - Actions

That said, "It doesn't work" is not a very good problem description.

If you tried a trigger and it's not really doing what it should, post it.

Thank you very much this works correctly :cool:
 
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