HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Combine potions... read plz

05-01-2004, 06:25 PM#1
hitman_forever
Is it possible to : in the inventory of a hero, there is a potion of healing (1 charge), if the hero take another potion of the same type. is it possible to "combine" the two potions to make 2 charge in the same slot... because i'm working on a RPG... thx
05-01-2004, 06:42 PM#2
Kamux
Yes, you can do that with triggers, by setting the charge of the item that was there first and then remove the newly aquired item.
05-01-2004, 06:52 PM#3
weaaddar
or you can detect when one item is dragged on another. Get the dragged item, and the item currently in the slot and see if the two have the same item type. If true then add charge of dragged to the one in the slot. Remove Dragged item.
05-02-2004, 01:21 PM#4
hitman_forever
Thx ,,, It works but I have only 1 problem. How can i do for ADD charge to the item... i found only the "Item - Set Charges Remaining". I want to add 1 charge...
05-02-2004, 02:45 PM#5
Soultaker
Quote:
Originally Posted by hitman_forever
Thx ,,, It works but I have only 1 problem. How can i do for ADD charge to the item... i found only the "Item - Set Charges Remaining". I want to add 1 charge...

you just set charges to item charges + other items charges
05-02-2004, 04:39 PM#6
ThyFlame
Alright. WC3C isn't clogged anymore, so here.
Code:
Item Picked Up
    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
                        And - All (Conditions) are true
                            Conditions
                                (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot (Integer A))
                                (Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A)))
                                (Item-class of (Item being manipulated)) Equal to Charged
                    Then - Actions
                        Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
                        Hero - Drop (Item being manipulated) from (Hero manipulating item)
                        Item - Remove (Last dropped item)
                    Else - Actions
                        Do nothing