ME

[Spell] Exevo Port

Por Mehahbr, 28 de jan. de 2012 em Scripts

otserv
9
2.4k
MehahbrM
28 de janeiro de 2012 às 22:23

Procuro uma magia que se chame exevo port, ela abre um portal de 60 segundos numa area normal ( Não Abre em PZ, Nem PvP, Nem Na Arena).

 

Ela funciona assim. Ao player usar a magia, aparece um portal na frente dele que teleporta ele e outros jogadores que entrarem nesse portal para qualquer lugar random do mapa, mas todos os jogadores vao para o mesmo local.

 

Ja quando ele utiliza Exevo Port "City 1" ela teleporta para o templo da cidade 1.

 

Sera que teria como fazer essa Spell? Obrigado!

 

Vo postar uma foto para vocês verem no OTserver do meu colega!

 

121ap.jpg

Editado Janeiro 28 por Mehahbr

gabrielf10G
28 de janeiro de 2012 às 23:30

Não entendo muito de scripts, mas acho que ou é impossível, ou no mínimo muito difícil, pelo fato de que acho que teria que botar cada sqm em que o player pode parar, caso contrário, ele pode acabar dentro de uma parede ou alguma casa.

MehahbrM
29 de janeiro de 2012 às 01:09

mas tem os sqm certo pra ele teleportar entende??

jhon992J
29 de janeiro de 2012 às 10:26

tenta usar esse talkactions que modifiquei, ta testado jah:

 

function removeTp(lugardele)
doRemoveItem(getThingfromPos(lugardele).uid, 1)
end

function onSay(cid, words, param)

local config = {
exhaustionInSeconds = 30,  -- exausted em segundos.
storage = 34534,
pz = "no", -- players precisam estar em protection zone para usar? ("yes" or "no").
battle = "yes", -- players deve estar sem battle ("yes" or "no")
custo = "no", -- se os teleport irão custa ("yes" or "no")
premium = "no" -- se precisa ser premium account ("yes" or "no")
}

-------------Config Lugares----------------
local lugar = {
["sul"] = {{x=2461, y=2419, z=7}, 50, 2000}, -- posição={x,y,x}, lvl necessario=50, custo se tiver = 2000gps.
["west"] = {{x=2269, y=2264, z=7}, 50, 1000},
["east"] = {{x=2997, y=2163, z=7}, 50, 2000},
["nort"] = {{x=2531, y=1726, z=7}, 50, 2000},
["center"] = {{x=2577, y=2086, z=7}, 50, 2000}
}

local locais = {"sul", "west", "east", "nort", "center"} -- coloque os nomes dos locais
local tpmath = lugar[locais[math.random(1, 5)]] -- não mexa!
local position =  getPlayerPosition(cid) -- posição atual do player, não mexa!
local tempo = 30 -- tempo e segundos para o teleport sumir

-------------/Config Checkar não mecha----------------
local lugar = lugar[param]
if (param == "check") then
for name, pos in pairs(lugar) do
text = "Destination: "..name..", Level required: "..pos[2]..","
if(config.battle == "yes") then
text = text.." Sorry, you are in battle."
else
text = text.." You can use while fighting: No"
end
if(config.pz == "yes") then
text = text.." You should use in protection zone: Yes"
else
text = text.." You should use in protection zone: No"
end
if (pos[3] == TRUE) then
text = text..", Cost: "..pos[4]..";"
end
doPlayerSendTextMessage(cid, 20, ""..text.."")
end
return TRUE
end

if(exhaustion.check(cid, config.storage) == TRUE) then
  if (exhaustion.get(cid, 34534) >= 60) then
  doPlayerSendCancel(cid, "You can only teleport after [" .. math.floor(exhaustion.get(cid, 34534) / 60 + 1) .."] minutes.")
  end
   if (exhaustion.get(cid, 34534) <= 60) then
   doPlayerSendCancel(cid, "You can only teleport after [" .. exhaustion.get(cid, 34534).."] seconds.")
   end
return TRUE
end

if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You should be in the protection zone for use.")
return TRUE
end

if(config.premium == "yes") and (not isPremium(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only players with premium account can use.")
return TRUE
end

if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You can not use in battle.")
return TRUE
end

if lugar ~= nil then
   if not(lugar) then
   doPlayerSendTextMessage(cid, 22, "Sorry, this place does not exist.")
   doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
   return TRUE
   end

   if (getPlayerLevel(cid) <= lugar[2]) then
   doPlayerSendTextMessage(cid, 22, "Sorry, you don't have level. You need "..lugar[2].." level or more to be teleported.")
   doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
   return TRUE
   end


   if(config.custo == "yes") and (doPlayerRemoveMoney(cid, lugar[3]) == FALSE) then
   doPlayerSendTextMessage(cid, 22, "Sorry, you do not have enough money. You need "..lugar[3].." zenis to be teleported.")
   doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
   return TRUE
   end
end    

if (param == "") then
doCreateTeleport(1387, tpmath[1], {x=position.x+1, y=position.y, z=position.z})
lugardele = {x=position.x+1, y=position.y, z=position.z, stackpos=1}
doCreatureSay(cid, "O teleport irá sumir em "..tempo.." segundos.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tempo*1000, lugardele)
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
return TRUE
end

exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doCreateTeleport(1387, lugar[1], {x=position.x+1, y=position.y, z=position.z})
lugardele = {x=position.x+1, y=position.y, z=position.z, stackpos=1}
doCreatureSay(cid, "O teleport irá sumir em "..tempo.." segundos.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tempo*1000, lugardele)
return TRUE
end

Editado Janeiro 29 por Jhon992

MehahbrM
29 de janeiro de 2012 às 12:08

mas não é um talkaction que eu preciso, e sim uma spell :S mas voo dar uma olhada

 

@edit

 

Ele só fala exevo port ele ja teleporta para um local automaticamente selecionado, ja quando da Exevo Port "City 1 ele vai pro templo da cidade nº 1

Editado Janeiro 29 por Mehahbr

Gabriel001G
29 de janeiro de 2012 às 12:46

eu acho q é só pegar o script do Jhon992 e fazer como talkactions..e lá nos talkactions...tu adiciona a linha em talkactions.lua

coloca assim

 

<talkaction words="exevo port" filter="word-spaced" event="script" value="nome do arquivo.lua" />

 

tenta isso e me avisa :D

MehahbrM
29 de janeiro de 2012 às 14:37

tentei o problema e que você tem que por localidade sul norte... a Spell que eu bolei ela teleporta aleatoriamentee entende?? agora se você quiser teleportar pra um lugar certo o unico lugar ée as cidades onde você da exevo port "City = ele abrira um portal pro templo da city entendeuu??/

Gabriel001G
29 de janeiro de 2012 às 19:34

editei o talk do Jhon992... testa esse dai ... !

 

function removeTp(lugardele)

doRemoveItem(getThingfromPos(lugardele).uid, 1)

end

 

function onSay(cid, words, param)

 

local config = {

exhaustionInSeconds = 30, -- exausted em segundos.

storage = 34534,

pz = "no", -- players precisam estar em protection zone para usar? ("yes" or "no").

battle = "yes", -- players deve estar sem battle ("yes" or "no")

custo = "no", -- se os teleport irão custa ("yes" or "no")

premium = "no" -- se precisa ser premium account ("yes" or "no")

}

 

-------------Config Lugares----------------

local lugar = {

[""] = {fromx="1121" fromy="452" fromz="7" tox="1244" toy="548" }, 50, 2000}, -- fromx a tox= vai da posição x até a outra x aleatorio e assim por diante no y e no z

[""] = {{x=2577, y=2086, z=7}, 50, 2000}

}

 

local locais = {"", "", "", "", ""} -- coloque os nomes dos locais

local tpmath = lugar[locais[math.random(1, 5)]] -- não mexa!

local position = getPlayerPosition(cid) -- posição atual do player, não mexa!

local tempo = 60 -- tempo e segundos para o teleport sumir

 

-------------/Config Checkar não mecha----------------

local lugar = lugar[param]

if (param == "check") then

for name, pos in pairs(lugar) do

text = "Destination: "..name..", Level required: "..pos[2]..","

if(config.battle == "yes") then

text = text.." Sorry, you are in battle."

else

text = text.." You can use while fighting: No"

end

if(config.pz == "yes") then

text = text.." You should use in protection zone: Yes"

else

text = text.." You should use in protection zone: No"

end

if (pos[3] == TRUE) then

text = text..", Cost: "..pos[4]..";"

end

doPlayerSendTextMessage(cid, 20, ""..text.."")

end

return TRUE

end

 

if(exhaustion.check(cid, config.storage) == TRUE) then

if (exhaustion.get(cid, 34534) >= 60) then

doPlayerSendCancel(cid, "You can only teleport after [" .. math.floor(exhaustion.get(cid, 34534) / 60 + 1) .."] minutes.")

end

if (exhaustion.get(cid, 34534) <= 60) then

doPlayerSendCancel(cid, "You can only teleport after [" .. exhaustion.get(cid, 34534).."] seconds.")

end

return TRUE

end

 

if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You should be in the protection zone for use.")

return TRUE

end

 

if(config.premium == "yes") and (not isPremium(cid)) then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only players with premium account can use.")

return TRUE

end

 

if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then

doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You can not use in battle.")

return TRUE

end

 

if lugar ~= nil then

if not(lugar) then

doPlayerSendTextMessage(cid, 22, "Sorry, this place does not exist.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

end

 

if (getPlayerLevel(cid) <= lugar[2]) then

doPlayerSendTextMessage(cid, 22, "Sorry, you don't have level. You need "..lugar[2].." level or more to be teleported.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

end

 

 

if(config.custo == "no") and (doPlayerRemoveMoney(cid, lugar[3]) == FALSE) then

doPlayerSendTextMessage(cid, 22, "Sorry, you do not have enough money. You need "..lugar[3].." zenis to be teleported.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

end

end

 

if (param == "") then

doCreateTeleport(1387, tpmath[1], {x=position.x+1, y=position.y, z=position.z})

lugardele = {x=position.x+1, y=position.y, z=position.z, stackpos=1}

doCreatureSay(cid, "O teleport irá sumir em "..tempo.." segundos.", TALKTYPE_ORANGE_1)

addEvent(removeTp, tempo*1000, lugardele)

exhaustion.set(cid, config.storage, config.exhaustionInSeconds)

return TRUE

end

 

exhaustion.set(cid, config.storage, config.exhaustionInSeconds)

doCreateTeleport(1387, lugar[1], {x=position.x+1, y=position.y, z=position.z})

lugardele = {x=position.x+1, y=position.y, z=position.z, stackpos=1}

doCreatureSay(cid, "O teleport irá sumir em "..tempo.." segundos.", TALKTYPE_ORANGE_1)

addEvent(removeTp, tempo*1000, lugardele)

return TRUE

end

modifiquei umas pequenas coisas no talkaction do Jhon992 .. testa ai e me fala

no fromx= tu poe da coordenada , por exemplo 25... tox até a coordenada 150

no fromy ... mesma coisa de cima

no fromz tu poe da coordenada 7 a tox 7...mas se for aleatorio vai poder cair em lugares q nao pode andar..tipo meio do mar !

Editado Janeiro 29 por GabrielOts

jhon992J
29 de janeiro de 2012 às 21:47

Eu entendi que era isso que se queria! Fiz uma talkaction que funciona como spell, tem exausted e talz. Sóh adicionar a linha do talk, dae quando fala "Exevo Port" cria um teleport aleatoriamente pra uma das cidades citadas e ao falar "Exevo Port sul" irá para as coordenadas da cidade do sul e assim susecivamente...