local config = {
leverUid = 1234,
leverPos = {x=, y=, z=, stackpos=},
effect = CONST_ME_TELEPORT,
messageTwo = "Sorry, not possible.",
timeRemove = 5,
}
local monster_n1 = {'Demon'}
local monster_p1 = { x=3939, y=3933, z=3930)
local monster_n2 = {'Rat'}
local monster_p2 = { x=4043, y=4894, z=3930)
local monster_n3 = { 'Skeleton'}
local monster_p3 = { x=4053, y=3894, z=3930)
local monster_n4 = { 'Demon Skeleton' }
local monster_p4 = { x=5932, y=4930, z=3930)
local monster_n5 = { 'Sheep'}
local monster_p5 = { x=3940, y=3849, z=3930)
function onUse(cid, item, frompos, item2, topos, position)
if item.uid == config.leverUid and item.itemid == 1945 then
doCreateCreature(monster_n1 ,monster_p1 ,true)
doSendMagicEffect(monster_p1, config.effect)
doCreateCreature(monster_n2 ,monster_p2 ,true)
doSendMagicEffect(monster_p2, config.effect)
doCreateCreature(monster_n3 ,monster_p3 ,true)
doSendMagicEffect(monster_p3, config.effect)
doCreateCreature(monster_n4 ,monster_p4 ,true)
doSendMagicEffect(monster_p4, config.effect)
doCreateCreature(monster_n5 ,monster_p5 ,true)
doSendMagicEffect(monster_p5, config.effect)
addEvent(returnLever, config.timeRemove * 1000)
elseif item.uid == config.leverUid and item.itemid == 1946 then
doPlayerSendCancel(cid, config.messageTwo)
return TRUE
end
end
function returnLever()
if getThingfromPos(config.leverPos).uid > 0 then
doTransformItem(getThingfromPos(config.leverPos).uid, 1945)
doSendMagicEffect(config.leverPos, CONST_ME_POFF)
end
end