HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dropping Items when you alredy got it.

11-22-2003, 07:02 AM#1
linkmaster23
How do go about doing this? EXACTLY? i saw it eariler but it made ZERO sense he only said like 1 thing about it. Sorry for asking this, ino its been asked like 4000000 times but all of the old posts were delteed:( so thanks 4 you rhelp!:ggani: :ggani: :ggani: :ggani:
11-22-2003, 08:06 AM#2
FerretDruid
Code:
Generic Duplicate Item Drop
    Events
        Unit - A unit owned by Player 1 (Red) Acquires an item
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Item-type of (Item being manipulated)) Equal to Crown of Kings +5
                (Item-type of (Item being manipulated)) Equal to Cheese
    Actions
        Set GenericIntegerVariable = 0
        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-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Crown of Kings +5
                                (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Cheese
                    Then - Actions
                        Set GenericIntegerVariable = (GenericIntegerVariable + 1)
                    Else - Actions
                        Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                GenericIntegerVariable Greater than 1
            Then - Actions
                Hero - Drop (Item being manipulated) from (Triggering unit)
            Else - Actions
                Do nothing

I made that based off a trigger by CastleOrange, I'm really didn't know how to do that ;)
11-22-2003, 01:49 PM#3
linkmaster23
tha souunds harder than what they are saying, is there an easier way?They were talking about life and levels of the item
11-22-2003, 02:19 PM#4
FerretDruid
It may be just me, but I don't think COPYING a code, and using it for whatever you want, is harder than... doing this:

(This is what you were talking about)

Change the life of every item you want limited to it's own custom life, and then make triggers that check each inventory slot for items with a certain life amount, and if it matches the item being picked up then drop the new item on the ground. You COULD check an item's level, or even classification but that would limit you severaly in how many different items you could use for this function. (Highest level for an item is 8 and there are only.. 7 or so classes). Then make a trigger to set an items life to 100% whenever it is picked up so nobody could just attack an item to change it's hit point value and exploit your system (Or, alternately, make a trigger that makes an item invulnerable if a unit is given the order to attack it, which is the primitive method that I prefer to use.)

But, do whatever you feel is easier. There are other topic that exist right now explaining item life, I've posted in a couple of them myself (one is right on the front page I think).
11-22-2003, 08:20 PM#5
Vexorian
Code:
Generic Duplicate Item Drop
    Events
        Unit - Acquires an item
    Conditions
        Or - Any (Conditions) are true
            Conditions
               (post every item type comparision you want)
    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 carried by (Triggering unit) in slot (Integer A)) not equal to (item being manipulated)
                       (Item-type of by (Item carried by  (Triggering unit) in slot (Integer A)) equal to (item type of (item being manipulated))
                    Then - Actions
                          Drop (item being manipulated) from (triggering unit)
                          skip remainning actions
                    Else - Actions
                        Do nothing
11-22-2003, 08:56 PM#6
Primantis
thank you very much, i was trying to do something similar. But i was not using the correct if/thens and loops.
11-22-2003, 11:16 PM#7
linkmaster23
vex thats confusing, how do i get the

(Item carried by (Triggering unit) in slot (Integer A)) not equal to (item being manipulated)
(Item-type of by (Item carried by (Triggering unit) in slot (Integer A)) equal to (item type of (item being manipulated))

i don t get that.And ive never used loops b4, could you explain them?