marcryzius
New Member
- Joined
- Mar 22, 2009
- Messages
- 61
- Reaction score
- 0
this is a small script to annihilator.
not have the system of rewards, because i use another system.
modify all msgs
script exclusive to otland. do not post in other forums.
not have the system of rewards, because i use another system.
Lua:
--[[> Annihilator script by Marcryzius D'evil <]]--
local config ={
pos_players ={--pos players in the lever
{x=247, y=659, z=13, stackpos=253},
{x=247, y=660, z=13, stackpos=253},
{x=247, y=661, z=13, stackpos=253},
{x=247, y=662, z=13, stackpos=253}
},
new_pos ={--pos players in the room of annihi
{x=189, y=653, z=13,stackpos=253},--do not change stackpos and not remove for all
{x=189, y=652, z=13,stackpos=253},
{x=189, y=651, z=13,stackpos=253},
{x=189, y=650, z=13,stackpos=253}
},
pos_demons ={--pos demons in the roon of annihi
{x=191, y=651, z=13,stackpos=253},
{x=191, y=653, z=13,stackpos=253},
{x=187, y=652, z=13,stackpos=253},
{x=187, y=650, z=13,stackpos=253},
{x=189, y=654, z=13,stackpos=253},
{x=189, y=655, z=13,stackpos=253}
}
}
local vezes = 0--do not change and not reload action for not reset the variable
function onUse(cid, item, fromPosition, itemEx, toPosition)
local quant = getConfigInfo('annihilatorperday')--add in config or remove in the script and add the number above zero
if(quant <= vezes)then
return TRUE,doPlayerSendCancel(cid,"A alavanca parece está emperrada.")
end
if(item.itemid == 1946)then
for p=1, #config.pos_players do
local player = getThingFromPos(config.pos_players[p])
if(isPlayer(player.uid) == TRUE)then
if(getPlayerLevel(player.uid) >= 100)then
if(getPlayerStorageValue(player.uid,100) ~= -1)then
return TRUE,doPlayerSendCancel(cid,"Alguem ja fez a Annihilator quest.")
end
else
return TRUE,doPlayerSendCancel(cid,"Todos necessitam ter level 100 ou mais.")
end
else
return TRUE,doPlayerSendCancel(cid,"voce precisa de "..#config.pos_players.." pessoas para poder entrar na sala.")
end
end
for pos = 1,#config.pos_demons do
if(pos <= #config.pos_players)then
local player = getThingFromPos(config.pos_players[pos])
if(player.uid ~= nil)then
doTeleportThing(player.uid,config.new_pos[pos], FALSE)
end
end
doSummonCreature("Demon", config.pos_demons[pos])
end
vezes = vezes+1
elseif(item.itemid == 1945)then
local player = getThingfromPos(config.new_pos[#config.new_pos])
for pos = 1,#config.pos_demons do
if(pos <= #config.new_pos)then
player = getThingfromPos(config.new_pos[pos])
end
local monster = getThingfromPos(config.pos_demons[pos])
if(isPlayer(player.uid) == TRUE)or(isPlayer(monster.uid) == TRUE)then
return TRUE,doPlayerSendCancel(cid,"Espere o time acabar de fazer a annihilator quest.")
else
if(isMonster(player.uid) == TRUE)then doRemoveCreature(player.uid)end
if(isMonster(monster.uid) == TRUE)then doRemoveCreature(monster.uid)end
end
end
end
end
script exclusive to otland. do not post in other forums.