1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

How to dectec if unit has 2 same type of items.

Discussion in 'Map Development' started by kenyi, Sep 18, 2005.

  1. kenyi

    kenyi

    Joined:
    Aug 4, 2005
    Messages:
    8
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I'm making an item combo that requires 2 same type of item. I can only detect if the unit has the type of item but not the quantity of the items.
     
  2. Pyrodactyl

    Pyrodactyl

    Joined:
    Jun 9, 2004
    Messages:
    212
    Resources:
    1
    Maps:
    1
    Resources:
    1
    i think you need to check the inventory by slots, but i'm not sure it's possible. I'll try and make a trigger like that next day.
     
  3. qwerty

    qwerty

    Joined:
    Jul 2, 2004
    Messages:
    695
    Resources:
    0
    Resources:
    0
    try picking all units of unit type and use an integar variable to count how many are there.
     
  4. redpetfran

    redpetfran

    Joined:
    Sep 21, 2005
    Messages:
    5
    Resources:
    0
    Resources:
    0
    Code (Text):


    Combine Ore
        Events
            Unit - A unit owned by Player 1 (Red) Acquires an item
            Unit - A unit owned by Player 2 (Blue) Acquires an item
            Unit - A unit owned by Player 3 (Teal) Acquires an item
            Unit - A unit owned by Player 4 (Purple) Acquires an item
            Unit - A unit owned by Player 5 (Yellow) Acquires an item
        Conditions
            (Number of items carried by (Hero manipulating item)) Greater than or equal to 5
            And - All (Conditions) are true
                Conditions
                    (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Hero manipulating item) of type Lump of Ore))
                    And - All (Conditions) are true
                        Conditions
                            (Item-type of (Item carried by (Hero manipulating item) in slot 1)) Equal to Lump of Ore
                            (Item-type of (Item carried by (Hero manipulating item) in slot 2)) Equal to Lump of Ore
                            (Item-type of (Item carried by (Hero manipulating item) in slot 3)) Equal to Lump of Ore
                            (Item-type of (Item carried by (Hero manipulating item) in slot 4)) Equal to Lump of Ore
                            (Item-type of (Item carried by (Hero manipulating item) in slot 5)) Equal to Lump of Ore
        Actions
            Hero - Drop (Item carried by (Hero manipulating item) of type Lump of Ore) from (Hero manipulating item)
            Item - Remove (Last dropped item)
            Hero - Drop (Item carried by (Hero manipulating item) of type Lump of Ore) from (Hero manipulating item)
            Item - Remove (Last dropped item)
            Hero - Drop (Item carried by (Hero manipulating item) of type Lump of Ore) from (Hero manipulating item)
            Item - Remove (Last dropped item)
            Hero - Drop (Item carried by (Hero manipulating item) of type Lump of Ore) from (Hero manipulating item)
            Item - Remove (Last dropped item)
            Hero - Drop (Item carried by (Hero manipulating item) of type Lump of Ore) from (Hero manipulating item)
            Item - Remove (Last dropped item)
            Hero - Create Lump of 5 Ore and give it to (Hero manipulating item)

    I did this to create a lump of 5 ore when a player collects 5 ore and puts them in slots 1-5.  Just modify it for your items
     
  5. qwerty

    qwerty

    Joined:
    Jul 2, 2004
    Messages:
    695
    Resources:
    0
    Resources:
    0
    check the blizzard map called "Warchasers". they got a trigger that makes an item disappear when you pick it up, and gives gold instead. just change the trigger which gives gold to check if that unit has an item of the same type and if so, drop the item.
     
  6. kenyi

    kenyi

    Joined:
    Aug 4, 2005
    Messages:
    8
    Resources:
    1
    Maps:
    1
    Resources:
    1
    thanks guys.