Warchief
User
- Joined
- Apr 3, 2010
- Messages
- 47
- Reaction score
- 6
Witam !
Dzisiaj udost?pni? wam item Surprise Bag !!!
Polega na tym, ?e jak u?yj? si? go to wylatuj? z niego s?odycze i r??ne inne ?eczy.
A wi?c:
w OTS/data/actions/actions.xml doklejamy linijk?:
Potem w OTS/data/actions/scripts tworzymy plik o nazwie surprise bag.lua
a w nim wklejamy:
Potem w OTS/data/items/items.xml doklejamz linijk? :
I Gotowe !!!
Oczywi?cie mo?na zmieni? to co surprise bag wy?uca
Dziekuj? i du?o zabawy z nowym bagiem
@Edit
Item tworzymy komend?:
/i 6570 = Blue Surprise Bag
/i 6571 = Red Surprise Bag (Wy?uca fajne fajerwerki )
Dzisiaj udost?pni? wam item Surprise Bag !!!
Polega na tym, ?e jak u?yj? si? go to wylatuj? z niego s?odycze i r??ne inne ?eczy.
A wi?c:
w OTS/data/actions/actions.xml doklejamy linijk?:
PHP:
<action fromid="6570" toid="6571" event="script" value="surprisebag.lua"/>
a w nim wklejamy:
PHP:
local PRESENT_BLUE = {2687, 6394, 6280, 6574, 6578, 6575, 6577, 6569, 6576, 6572, 2114}
local PRESENT_RED = {2152, 2152, 2152, 2153, 5944, 2112, 6568, 6566, 2492, 2520, 2195, 2114, 2114, 2114, 6394, 6394, 6576, 6576, 6578, 6578, 6574, 6574}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local count = 1
if(item.itemid == 6570) then
local randomChance = math.random(1, #PRESENT_BLUE)
if(randomChance == 1) then
count = 10
elseif(randomChance == 2) then
count = 3
end
doPlayerAddItem(cid, PRESENT_BLUE[randomChance], count)
elseif(item.itemid == 6571) then
local randomChance = math.random(1, #PRESENT_RED)
if randomChance > 0 and randomChance < 4 then
count = 10
end
doPlayerAddItem(cid, PRESENT_RED[randomChance], count)
end
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid, 1)
return true
end
PHP:
<item fromid="6570" toid="6571" article="a" name="surprise bag">
Oczywi?cie mo?na zmieni? to co surprise bag wy?uca
PHP:
local PRESENT_BLUE = {2687, 6394, 6280, 6574, 6578, 6575, 6577, 6569, 6576, 6572, 2114}
local PRESENT_RED = {2152, 2152, 2152, 2153, 5944, 2112, 6568, 6566, 2492, 2520, 2195, 2114, 2114, 2114, 6394, 6394, 6576, 6576, 6578, 6578, 6574, 6574}
@Edit
Item tworzymy komend?:
/i 6570 = Blue Surprise Bag
/i 6571 = Red Surprise Bag (Wy?uca fajne fajerwerki )