Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, frompos, item2, topos)
- --Config-->
- local statue_pos = {x=1164, y=746, z=10}
- local portal_quest01_pos = {x=1164, y=755, z=10, stackpos = 2}
- local portal_quest02_pos = {x=1165, y=757, z=9, stackpos = 2}
- local config = {
- fromPos = {x=1153,y=737,z=10}, -- posição superior esquerda do mapa, da area em que esta mapeado a area.
- toPos = {x=1173,y=755,z=10}, -- posição inferior direita do mapa, da area em que esta mapeado a area.
- boss = "Azerus" -- Aqui você bota o nome do monstro que você quer remover
- }
- --End Config-->
- function Potwory1()
- if math.random (1,8) == 4 then
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- addEvent(Potwory2, 30 * 1000)
- else
- doSummonCreature('Rat', {x = statue_pos.x, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- addEvent(Potwory2, 30 * 1000)
- end
- end
- function Potwory2()
- doSummonCreature('Azerus3', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
- addEvent(Potwory3, 35 * 1000)
- end
- function Potwory3()
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- addEvent(Potwory4, 40 * 1000)
- end
- function Potwory4()
- doSummonCreature('Rat', {x = statue_pos.x, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253})
- doSummonCreature('Rat', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253})
- addEvent(NewPortal, 90 * 1000)
- end
- function NewPortal()
- addEvent(RemoveAll, 60 * 1000)
- end
- function RemoveAll()
- doRemoveItem(getThingfromPos(portal_quest01_pos).uid,1)
- doRemoveItem(getThingfromPos(portal_quest02_pos).uid,1)
- end
- function removeMonsterInArea(fromPos, toPos)
- local positionsCheck = {}
- for i = config.fromPos.x, config.toPos.x do
- positionsCheck[#positionsCheck+1] = {x=i, y = config.fromPos.y, z = config.fromPos.z, stackpos = 0}
- for j = config.fromPos.y+1, config.toPos.y do
- positionsCheck[#positionsCheck+1] = {x=i, y = j, z = config.fromPos.z, stackpos = 0}
- end
- end
- for j=1, #positionsCheck do
- for i = 0, 255 do
- positionsCheck[j].stackpos = i
- local tile = getTileThingByPos(positionsCheck[j])
- if isMonster(tile.uid) then
- if getCreatureName(tile.uid) == config.boss then
- doRemoveCreature(tile.uid)
- end
- end
- end
- end
- end
- if item.uid == 11223 and getThingfromPos(portal_quest01_pos).itemid ~= 9772 then
- doCreateItem(9772,1,portal_quest01_pos)
- doCreateItem(9772,1,portal_quest02_pos)
- addEvent(Potwory1, 0)
- else
- doPlayerSendTextMessage(cid,22,"Sorry, not possible.")
- end
- return TRUE
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement