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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. 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.

[Trigger] Item Ownership

Discussion in 'Triggers & Scripts' started by carlos17acc, May 13, 2009.

  1. carlos17acc

    carlos17acc

    Joined:
    Feb 19, 2009
    Messages:
    15
    Resources:
    0
    Resources:
    0
    Who can teach me a Item ownership trigger that when i drop the item no one can picked it or when i drop my item it will transfer in a selected region

    Thnx for advance
     
  2. Amigurumi

    Amigurumi

    Joined:
    Apr 7, 2008
    Messages:
    1,575
    Resources:
    45
    Models:
    27
    Icons:
    3
    Packs:
    3
    Maps:
    7
    Spells:
    4
    Tutorials:
    1
    Resources:
    45
    1. I don't know an action like this, so I think it must be a complicated trigger

    2. Try this :
    Trigger
    • Drop Item
      • Events
        • Unit - A unit Loses an item
      • Conditions
        • (Hero manipulating item) Equal to (Your Item)
      • Actions
        • Set Point = (YourPoint)
        • Item - Move (Item being manipulated) to Point
        • Custom script: call RemoveLocation( udg_Point )
     
  3. Justify

    Justify

    Joined:
    Mar 16, 2008
    Messages:
    935
    Resources:
    5
    Models:
    1
    Icons:
    1
    Spells:
    3
    Resources:
    5
    1. is pretty easy. Use the custom value of the item and set it to the owner of it, meaning when he picks it up the first time. When a player picks up an item, compare the number of the player with the custom value.
     
  4. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Actually, it is a very simple trigger...

    Trigger

    • Item Ownership
      • Events
        • Unit - A unit Acquires an item
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • (Custom value of (Item being manipulated)) Equal to (Player number of (Owner of (Triggering unit)))
                • (Custom value of (Item being manipulated)) Equal to 0
          • Then - Actions
            • Set TempLoc = (Position of (Item being manipulated))
            • Item - Move (Item being manipulated) to TempLoc
            • Custom script: call RemoveLocation(udg_TempLoc)
            • Skip remaining actions
          • Else - Actions
            • Item - Set the custom value of (Item being manipulated) to (Player number of (Owner of (Triggering unit)))

    Right, you can also use "Drop (Item being manipulated) from (Hero manipulating item)", but then you can move the item (and I think that's less effective than this).

    Variable Info

    TempLoc: Point variable, no array.


    Edit: Justify was faster than me... his post wasn't there when I posted mine :/
     
  5. carlos17acc

    carlos17acc

    Joined:
    Feb 19, 2009
    Messages:
    15
    Resources:
    0
    Resources:
    0
    It Does'nt work when i buy an item the item drops
     
  6. Lord_BoNes

    Lord_BoNes

    Joined:
    Sep 5, 2007
    Messages:
    264
    Resources:
    0
    Resources:
    0
    It would appear to be doing the check the wrong way around...
    That "or" should be an "and", and the "equal to" should be "not equal to".
    Or you could just swap the "then" and "else" blocks around :thumbs_up:
     
  7. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    The first part isn't correct (it needs to be "or", otherwise it will say "Custom Value equal to 0 AND 2" for example).

    You're right about the second part, i needs to be "not equal to" xD
    Mehh, I didn't test it... it's almost correct, though :p
     
  8. Teelo

    Teelo

    Joined:
    Mar 31, 2009
    Messages:
    709
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Don't forget:
    • Item - Change description of item to "Soulbound"
    :wink:
     
  9. reza sword2

    reza sword2

    Joined:
    Aug 3, 2008
    Messages:
    290
    Resources:
    0
    Resources:
    0
    Item Ownership

    • Item Ownership
      • Events
        • Unit - A unit Acquires an item
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • And - All (Conditions) are true
              • Conditions
                • (Owner of (Item being manipulated)) Not equal to Player 1 (Red)
                • (Owner of (Item being manipulated)) Not equal to Player 2 (Blue)
                • (Owner of (Item being manipulated)) Not equal to Player 3 (Teal)
                • (Owner of (Item being manipulated)) Not equal to Player 4 (Purple)
                • (Owner of (Item being manipulated)) Not equal to Player 5 (Yellow)
                • (Owner of (Item being manipulated)) Not equal to Player 6 (Orange)
                • (Owner of (Item being manipulated)) Not equal to Player 7 (Green)
                • (Owner of (Item being manipulated)) Not equal to Player 8 (Pink)
                • (Owner of (Item being manipulated)) Not equal to Player 9 (Gray)
                • (Owner of (Item being manipulated)) Not equal to Player 10 (Light Blue)
                • (Owner of (Item being manipulated)) Not equal to Player 11 (Dark Green)
                • (Owner of (Item being manipulated)) Not equal to Player 12 (Brown)
          • Then - Actions
            • Item - Change ownership of (Item being manipulated) to (Owner of (Hero manipulating item)) and Change color
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Owner of (Item being manipulated)) Not equal to (Owner of (Hero manipulating item))
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Hero manipulating item)
              • Else - Actions

     
  10. carlos17acc

    carlos17acc

    Joined:
    Feb 19, 2009
    Messages:
    15
    Resources:
    0
    Resources:
    0
    Reza Swords works
     
  11. Lord_BoNes

    Lord_BoNes

    Joined:
    Sep 5, 2007
    Messages:
    264
    Resources:
    0
    Resources:
    0
    I was meaning to do both:
    IF (Value <> 0 AND Value <> 2)
    LOL