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.

[Trigger] Just_Spectating's Item Carry System

Discussion in 'Triggers & Scripts' started by Just_Spectating, Jun 17, 2009.

  1. Just_Spectating

    Just_Spectating

    Joined:
    May 16, 2007
    Messages:
    7,023
    Resources:
    46
    Models:
    11
    Icons:
    9
    Skins:
    26
    Resources:
    46
    I would have updated my other post however it was closed, and since the trigger was still a bit inefficient, i wanted to change it.

    therefore i did.

    Now this system contains only 2 triggers, and allows for

    1 two handed weapon
    2 one handed weapons
    1 shield + 1 one handed weapon
    2 shields

    but you cannot do

    2 two handed weapons
    1 shield + 1 two handed weapon

    which makes perfect sense.

    These are the triggers

    Trigger 1:
    • One Class
      • Events
        • Unit - A unit Acquires an item
      • Conditions
      • Actions
        • -------- Permanent ---> weapons --------
        • -------- Artifact ---> Helmets --------
        • -------- Purchaseable ---> Armor --------
        • -------- Campaign ---> Shield --------
        • 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
                • And - All (Conditions) are true
                  • Conditions
                    • ((Hero manipulating item) has (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to True
                    • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
                    • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-class of (Item being manipulated))
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • And - All (Conditions) are true
                      • Conditions
                        • (Item-class of (Item being manipulated)) Equal to Permanent
                        • (Item level of (Item being manipulated)) Equal to 2
                  • Then - Actions
                    • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                    • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • And - All (Conditions) are true
                          • Conditions
                            • (Item-class of (Item being manipulated)) Equal to Artifact
                            • (Item level of (Item being manipulated)) Equal to 0
                      • Then - Actions
                        • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                        • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                      • Else - Actions
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • And - All (Conditions) are true
                              • Conditions
                                • (Item-class of (Item being manipulated)) Equal to Purchasable
                                • (Item level of (Item being manipulated)) Equal to 0
                          • Then - Actions
                            • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                            • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                          • Else - Actions
                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • (Item-class of (Item being manipulated)) Equal to Campaign
                                • (Item level of (Item being manipulated)) Equal to 2
                              • Then - Actions
                                • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                                • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                              • Else - Actions
              • Else - Actions


    Trigger 2:
    • Onehanded Weapons
      • 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
                • Or - Any (Conditions) are true
                  • Conditions
                    • (Item-class of (Item being manipulated)) Equal to Permanent
                    • (Item-class of (Item being manipulated)) Equal to Campaign
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • And - All (Conditions) are true
                      • Conditions
                        • ((Hero manipulating item) has (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to True
                        • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
                        • ((Item-class of (Item being manipulated)) Equal to Permanent) or ((Item-class of (Item being manipulated)) Equal to Campaign)
                  • Then - Actions
                    • For each (Integer B) from 1 to (Number of items carried by (Hero manipulating item)), do (Actions)
                      • Loop - Actions
                        • For each (Integer A) from 1 to 1, do (Actions)
                          • Loop - Actions
                            • For each (Integer B) from 2 to 2, do (Actions)
                              • Loop - Actions
                                • For each (Integer C) from 3 to 3, do (Actions)
                                  • Loop - Actions
                                    • For each (Integer D) from 4 to 4, do (Actions)
                                      • Loop - Actions
                                        • For each (Integer E) from 5 to 5, do (Actions)
                                          • Loop - Actions
                                            • For each (Integer F) from 6 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-class of (Item carried by (Hero manipulating item) in slot (Integer B))) Equal to Permanent
                                                        • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer B))) Equal to Campaign
                                                    • Or - Any (Conditions) are true
                                                      • Conditions
                                                        • (((((Item level of (Item carried by (Hero manipulating item) in slot A)) + (Item level of (Item carried by (Hero manipulating item) in slot B))) + (Item level of (Item carried by (Hero manipulating item) in slot C))) + (Item level of (Item carried by (Hero ma Equal to 3
                                                        • (((((Item level of (Item carried by (Hero manipulating item) in slot A)) + (Item level of (Item carried by (Hero manipulating item) in slot B))) + (Item level of (Item carried by (Hero manipulating item) in slot C))) + (Item level of (Item carried by (Hero ma Equal to 4
                                                        • (((((Item level of (Item carried by (Hero manipulating item) in slot A)) + (Item level of (Item carried by (Hero manipulating item) in slot B))) + (Item level of (Item carried by (Hero manipulating item) in slot C))) + (Item level of (Item carried by (Hero ma Equal to 5
                                                        • (((((Item level of (Item carried by (Hero manipulating item) in slot A)) + (Item level of (Item carried by (Hero manipulating item) in slot B))) + (Item level of (Item carried by (Hero manipulating item) in slot C))) + (Item level of (Item carried by (Hero ma Equal to 7
                                                        • (((((Item level of (Item carried by (Hero manipulating item) in slot A)) + (Item level of (Item carried by (Hero manipulating item) in slot B))) + (Item level of (Item carried by (Hero manipulating item) in slot C))) + (Item level of (Item carried by (Hero ma Equal to 9
                                                  • Then - Actions
                                                    • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000Your Hand...
                                                    • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                                                  • Else - Actions
                  • Else - Actions
              • Else - Actions



    All You must do is set your items according to the table

    Permanent: weapons
    Artifact: helmets
    Purchaseable: armor
    Campaign: shields

    and set item levels accordingly.

    1 handed weapons: level 1
    2 handed weapons: level 2
    Shields: level 1
    Armor: level 0
    Helmets: level 0


    I hope you find this useful
    See the old system here
     

    Attached Files:

    Last edited: Jun 18, 2009
  2. dimitri231

    dimitri231

    Joined:
    Aug 4, 2008
    Messages:
    265
    Resources:
    0
    Resources:
    0
    Very good system, I would use it if I have a RPG map.
    I think game display - Player Group leaks
     
  3. Just_Spectating

    Just_Spectating

    Joined:
    May 16, 2007
    Messages:
    7,023
    Resources:
    46
    Models:
    11
    Icons:
    9
    Skins:
    26
    Resources:
    46
    o.o does it?

    i dont think so. afaik

    im glad you like it.
     
  4. GhostWolf

    GhostWolf

    Joined:
    Jul 29, 2007
    Messages:
    4,840
    Resources:
    2
    Tools:
    1
    Tutorials:
    1
    Resources:
    2
    But I want two shields in order to bash my enemy Diablo-2 style (just, as mentioned, with two shields).
    *Uber-over-powered-Paladin-high-five*
     
  5. dimitri231

    dimitri231

    Joined:
    Aug 4, 2008
    Messages:
    265
    Resources:
    0
    Resources:
    0
    Yeah, 2 shields would be cool.
     
  6. Just_Spectating

    Just_Spectating

    Joined:
    May 16, 2007
    Messages:
    7,023
    Resources:
    46
    Models:
    11
    Icons:
    9
    Skins:
    26
    Resources:
    46
    lol, i purposely made it so you couldnt do 2 shields, but ok.. ill update it.



    Updated, now you may be able to use 2 shields.
     
  7. dimitri231

    dimitri231

    Joined:
    Aug 4, 2008
    Messages:
    265
    Resources:
    0
    Resources:
    0
    Perfect, +Rep

    Edit:Bah, cant +rep u, because i already + rep...
     
  8. X-OMG-X

    X-OMG-X

    Joined:
    Nov 10, 2008
    Messages:
    1,942
    Resources:
    16
    Icons:
    1
    Skins:
    3
    Maps:
    2
    Spells:
    8
    Template:
    1
    Tutorials:
    1
    Resources:
    16
    this is exactly what i needed :)
    5/5
     
  9. Darkmoon Hero

    Darkmoon Hero

    Joined:
    Aug 8, 2009
    Messages:
    900
    Resources:
    5
    Icons:
    4
    Skins:
    1
    Resources:
    5
    I needed this as well. Thanks, Just_Spectating!
     
  10. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
    i'm curious on if this would work better with mine, becuase currently what i'm using is listing ALL the items, so get back to me and if it would be i'll use this
     
  11. Just_Spectating

    Just_Spectating

    Joined:
    May 16, 2007
    Messages:
    7,023
    Resources:
    46
    Models:
    11
    Icons:
    9
    Skins:
    26
    Resources:
    46
    yeah i have no idea, as you see, i started this system 2 years ago (the link can prove) and i just only fixed this one to work efficiently, but the coding structure stayed the same.

    (plus now theres like Hashtables)
     
  12. Drenith

    Drenith

    Joined:
    Dec 6, 2005
    Messages:
    68
    Resources:
    0
    Resources:
    0
    yes, effectively its a more advanced version of what i gave you, only problem is that this one will not force items to be in specific slots, as u requested. However you don't have to list all the items with the version i gave you either, just set the item classifications (permanent, artifact, etc) to correspond with the item slots as set up in the comments on the map i attached in your other thread
     
  13. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
    yeah i saw i'm gonna do that and this is gonna work the way i want, Thanks :D
     
  14. Urmom

    Urmom

    Joined:
    Sep 9, 2009
    Messages:
    10
    Resources:
    0
    Resources:
    0
    Here I +rep for dimitri ^^
     
  15. HMC

    HMC

    Joined:
    Oct 31, 2009
    Messages:
    2
    Resources:
    0
    Resources:
    0
    hey... ders sumtin rong... why isit dat he can hold 2 shields at one time...
     
  16. HMC

    HMC

    Joined:
    Oct 31, 2009
    Messages:
    2
    Resources:
    0
    Resources:
    0
    ...

    can u post one which does NOT allow 2 shields or 2 one-handed weapons ?
    plz n ty
    :spell_breaker:great trigger btw:infl_thumbs_up:
     
  17. Bugbuster96

    Bugbuster96

    Joined:
    Aug 11, 2009
    Messages:
    152
    Resources:
    2
    Template:
    1
    Tutorials:
    1
    Resources:
    2
    AWESOME !!!! That's what I was looking for !!! THANKS Just_Spectating !!!
     
  18. Keilden

    Keilden

    Joined:
    Oct 28, 2008
    Messages:
    9
    Resources:
    0
    Resources:
    0
    What do I change so that you can only have 1 shield?
     
  19. KatOne

    KatOne

    Joined:
    Nov 8, 2009
    Messages:
    16
    Resources:
    0
    Resources:
    0
    Read the thread and - by golly - it's on purpose! :wink:
     
  20. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    nice system, but I dont think you need that And-All Conditions are true, by default the if will check if all of those are true anyway.. I think the And-all is only used in pair with the Or-Any conditions if you want 2 sets of numerous conditions.....