Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- tag: <action fromaid="19000" toaid="20000" event="script" value="leveraid.lua"/>
- function onUse(cid, item, pos, item2, topos) -- By Byerne XTibia
- local raids, r = {
- [19000] = {msg = "Demons appeared somewhere!",exhaustion=120,price=10000,monsters = {
- ["Demon"]={x=1000,y=1000,z=7},
- ["Demon"]={x=1000,y=1001,z=7},
- ["Demon"]={x=1001,y=1000,z=7} }
- }
- }, raids[item.actionid]
- if not doPlayerRemoveMoney(cid, r.price) then
- doPlayerSendCancel(cid, "It seems that you need to insert "..r.price.." coins to this lever to work.")
- return true
- end
- if getGlobalStorageValue(item.actionid)-os.time >= raids[item.actionid].exhaustion then
- doPlayerSendCancel(cid, "This lever doesn\'t seems to work. Try again after waiting "..getGlobalStorageValue(item.actionid)-os.time".. seconds.")
- return true
- end
- for monster,position in pairs(raids[item.actionid].monsters) do
- if doCreateMonster(monster, position) then
- doSendMagicEffect(position, CONST_ME_TELEPORT)
- end
- end
- doBroadcastMessage(raids[item.actionid].msg)
- setGlobalStorageValue(item.actionid, os.time+raids[item.actionid].exhaustion)
- doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement