Mystery Item Box
I made this script a while back and thought I'd release it
Info:
Its like a normal quest chest that gives you an item, but instead of giving the same item to people, it gives you a random item from a list of 10 items!
You can change all the items I have listed, they are just examples.
mysterybox.lua
edit actions.xml:
Then add 16200 to the unique and action values of any chest or item in the map editor!
Hope this script comes in handy for some people, it did for me hehe. Rep++ if you like!
Note: This was written for 0.2+ compatibility! ;p not just 0.3+! (but ofc will work in 0.3)
I made this script a while back and thought I'd release it
Info:
Its like a normal quest chest that gives you an item, but instead of giving the same item to people, it gives you a random item from a list of 10 items!
You can change all the items I have listed, they are just examples.
mysterybox.lua
Lua:
--[[
!---------------------------------!
!---Created by Teh Maverick-------!
!-------www.otland.net------------!
!---------------------------------!
]]
local mystery_items =
{
[1]={id=8902, count=1, name='a Spellbook of Mind Control'},
[2]={id=10521, count=1, name='a Moon Backpack'},
[3]={id=7903, count=1, name='a Terra Hood'},
[4]={id=2195, count=1, name='Boots of Haste'},
[5]={id=2536, count=1, name='a Medusa Shield'},
[6]={id=7404, count=1, name='an Assassin Dagger'},
[7]={id=7414, count=1, name='an Abyss Hammer'},
[8]={id=7411, count=1, name='an Ornamented Axe'},
[9]={id=8857, count=1, name='a Silkweaver Bow'},
[10]={id=8853, count=1, name='an Ironworker'}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 16200 then
queststatus = getPlayerStorageValue(cid,9100)
if queststatus == -1 then
local random_pick = math.random(1,10)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You recive " .. mystery_items[random_pick].name .. " as your mystery item.")
doPlayerAddItem(cid,mystery_items[random_pick].id,mystery_items[random_pick].count)
setPlayerStorageValue(cid,9100,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
return true
end
end
edit actions.xml:
PHP:
<action uniqueid="16200" event="script" value="mysteryitem.lua"/>
Then add 16200 to the unique and action values of any chest or item in the map editor!
Hope this script comes in handy for some people, it did for me hehe. Rep++ if you like!
Note: This was written for 0.2+ compatibility! ;p not just 0.3+! (but ofc will work in 0.3)
Last edited: