Ir para conteúdo

Posts Recomendados

e assim meu progeto e tfs 0.4 e to com um problema na yalahar eu tenhu um script muito bom funciono perfeito mais eu tentei adiciona uma parte de outro script para criar globo encima dos portais para ninguem sair ou entrar.

quando adicionei issu deu um erro de interface mais a quest rolo tudo normal mais os globo que criou encima do portal nao saia mais =/

 

o script e esse >

 

-- Config --

local BlindField = {x=1674, y=1737, z=10, stackpos=1}

-- Map checking --

local topLeft = {x=1667, y=1736, z=10}

local buttomRight = {x=1683, y=1755, z=10}

-- Position Of TP --

local tp = {x=1677, y=1757, z=10}

-- Position of Gllobus

local glo = {x=1676, y=1746, z=10}

local portal_quest01_pos = {x = 1676, y = 1755, z = 10, stackpos = 2}

local portal_quest02_pos = {x = 1677, y = 1757, z = 9, stackpos = 2}

local new_portal_pos = {x = 1674, y = 1737, z = 10, stackpos = 1}

local new_pos = {x = 1674, y = 1749, z = 14}

-- end --

 

local function mapArea(fromPos, toPos, stack)

-- Area iterator by Colandus.

local pos = {x=fromPos.x, y=fromPos.y-1, z=fromPos.z}

return function()

if (pos.y < toPos.y) then

pos.y = pos.y+1

elseif (pos.x <= toPos.x) then

pos.y = fromPos.y

pos.x = pos.x+1

else

pos.x = fromPos.x

pos.y = fromPos.y

pos.z = pos.z+1

end

if (pos.x <= toPos.x and pos.y <= toPos.y or pos.z < toPos.z) then

if (stack == nil) then

return pos

else

pos.stackpos = stack

return pos, getTopCreature(pos).uid

end

end

end

end

 

 

local function getMonstersfromArea(fromPos, toPos)

local monsters = {}

for _, thing in mapArea(fromPos, toPos, 253) do

if isMonster(thing) == TRUE then

table.insert(monsters, thing)

end

end

local bfm = getTopCreature(BlindField).uid

if isMonster(bfm) == TRUE then

table.insert(monsters, bfm)

end

return monsters

end

 

local function FirstWave()

doSummonCreature("Rift Worm", {x= glo.x - 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Worm", {x= glo.x + 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 4,z=glo.z})

doSummonCreature("Rift Worm", {x=glo.x,y=glo.y - 4,z=glo.z})

doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 5,z=glo.z})

doSummonCreature("Azerus", {x=glo.x,y=glo.y - 5,z=glo.z})

end

 

local function SecondWave()

local monsters1 = getMonstersfromArea(topLeft, buttomRight)

for _, monster in pairs(monsters1) do

if getCreatureName(monster) == "Azerus" then

doRemoveCreature(monster)

end

end

doSummonCreature("Azerus1", {x=glo.x,y=glo.y - 5,z=glo.z})

doSummonCreature("Rift Brood", {x= glo.x - 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Brood", {x= glo.x + 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 4,z=glo.z})

doSummonCreature("Rift Brood", {x=glo.x,y=glo.y - 4,z=glo.z})

doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 5,z=glo.z})

end

 

local function ThirdWave()

local monsters1 = getMonstersfromArea(topLeft, buttomRight)

for _, monster in pairs(monsters1) do

if getCreatureName(monster) == "Azerus" then

doRemoveCreature(monster)

end

end

doSummonCreature("Azerus2", {x= glo.x - 5,y=glo.y,z=glo.z})

doSummonCreature("Rift Scythe", {x= glo.x - 4,y=glo.y,z=glo.z})

doSummonCreature("Rift Scythe", {x= glo.x + 4,y=glo.y,z=glo.z})

end

 

local function ThirdWave1() -- with 2s delay

doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 4,z=glo.z})

doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y - 4,z=glo.z})

doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 5,z=glo.z})

end

 

local function FourthWave()

local monsters1 = getMonstersfromArea(topLeft, buttomRight)

for _, monster in pairs(monsters1) do

if getCreatureName(monster) == "Azerus" then

doRemoveCreature(monster)

end

end

doSummonCreature("Azerus3", {x= glo.x - 5,y=glo.y,z=glo.z})

doSummonCreature("War Golem", {x= glo.x - 4,y=glo.y,z=glo.z})

doSummonCreature("War Golem", {x= glo.x + 4,y=glo.y,z=glo.z})

doSummonCreature("War Golem", {x=glo.x,y=glo.y - 4,z=glo.z})

doSummonCreature("War Golem", {x=glo.x,y=glo.y + 4,z=glo.z})

end

 

local function Glllobe()

doItemSetAttribute(getTileItemById(glo,9767).uid, "aid", 58261)

end

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.actionid == 58261 then

doItemSetAttribute(item.uid, "aid", 58263)

if getTileItemById(tp,1387).uid > 0 then

doRemoveItem(getTileItemById(tp,1387).uid)

end

addEvent(FirstWave, 0)

addEvent(SecondWave, 10000)

addEvent(ThirdWave, 20000)

addEvent(ThirdWave1, 24000)

addEvent(FourthWave, 38000)

addEvent(Glllobe, 90000)

 

 

elseif item.actionid == 58263 then

doCreatureSay(cid, "You have to wait some time before this globe will charge.", TALKTYPE_ORANGE_1)

end

 

-- ADICIONEI PARA BLOKIAR OS PORTAL --

 

function NewPortal()

doCreateTeleport(1387, new_pos, new_portal_pos)

addEvent(RemoveAll, 60 * 1000)

end

 

function RemoveAll()

doRemoveItem(getThingfromPos(portal_quest01_pos).uid,1)

doRemoveItem(getThingfromPos(portal_quest02_pos).uid,1)

doRemoveItem(getThingfromPos(new_portal_pos).uid,1)

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

Editado por Dersinho
Link para o comentário
https://xtibia.com/forum/topic/182172-oi-gente-se-der-da-uma-ajudinha-ai-yalahar-script-o0/
Compartilhar em outros sites

×
×
  • Criar Novo...