Postado Outubro 22, 2015 9 anos pessoal por favor alguem tem uma script ai por exemplo "matar o monstro e nascer um teleport que leva para o templo" por que fiz uma quest de addon, e para sair é necessario matar o boss para que o teleport apareça tentei essa script \/ não deu muito certo quando mata o bixo o servidor crasha =S local tpId = 1387local tps = { ["New Mage"] = {pos = {x=288, y=125, z=8}, toPos = {x=160, y=54, z=7}, time = 60},}function removeTp(tp) local t = getTileItemById(tp.pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos, CONST_ME_POFF) endendfunction onDeath(cid) local tp = tps[getCreatureName(cid)] if tp then doCreateTeleport(tpId, tp.toPos, tp.pos) doCreatureSay(cid, "Teleport fecha em 1 Min Clique Na Estatua "..tp.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tp.time*1000, tp) end return TRUE endou então estou vacilando nessa parte? no arquivo.xml do seu monstro adicione: <script> <event name="tp"/> </script> caso eu esteja errando no xml do monstro por favor me mandem como ficaria o monstro é assim <?xml version="1.0" encoding="UTF-8"?><monster name="New Mage" nameDescription="a master sorcerer" race="blood" experience="52500" speed="1390" manacost="0"> <health now="5550000" max="5550000"/> <look type="130" head="94" body="89" legs="94" feet="0" addons="1"/> <targetchange interval="2000" chance="5"/> <strategy attack="80" defense="10"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="2000" skill="110" attack="90"/> <attack name="death" interval="2000" chance="100" range="8" min="-600" max="-620"> <attribute key="shootEffect" value="suddendeath"/> </attack> <attack name="fire" interval="5000" chance="80" range="8" radius="2" target="1" min="-600" max="-620"> <attribute key="shootEffect" value="fire"/> <attribute key="areaEffect" value="firearea"/> </attack> </attacks> <defenses armor="45" defense="50"> <defense name="healing" interval="4000" chance="100" min="700" max="1100"> <attribute key="areaEffect" value="blueshimmer"/> </defense> <defense name="speed" interval="5000" chance="30" speedchange="700" duration="20000"> <attribute key="areaEffect" value="redshimmer"/> </defense> </defenses> <elements> <element energyPercent="50"/> <element earthPercent="50"/> <element firePercent="50"/> <element icePercent="50"/> <element deathPercent="50"/> <element physicalPercent="50"/> </elements> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity lifedrain="0"/> <immunity paralyze="0"/> <immunity outfit="0"/> <immunity drunk="0"/> <immunity invisible="1"/> </immunities> <summons maxSummons="2"> <summon name="orc berserker" interval="3000" chance="40" max="0"/> </summons> <voices interval="5000" chance="100"> <voice sentence="Noob!!" yell="1"/> </voices> <loot capacity="800"> <item id="2544" countmax="13" chance="27000"/> <item id="2456" countmax="1" chance="13000"/> <item id="2487" countmax="1" chance="600"/> <item id="2491" countmax="1" chance="500"/> <item id="2519" countmax="1" chance="400"/> <item id="2392" countmax="1" chance="500"/> <item id="2148" countmax="100" chance="60000"/> <item id="2681" countmax="1" chance="20000"/> <item id="2652" countmax="1" chance="8000"/> <item id="2071" countmax="1" chance="15000"/> <item id="2666" countmax="2" chance="18000"/> <item id="2164" countmax="1" chance="500"/> <item id="2744" countmax="1" chance="20000"/> <item id="2120" countmax="1" chance="20000"/> <item id="2661" countmax="1" chance="12000"/> <item id="1949" countmax="1" chance="45000"/> <item id="2377" countmax="1" chance="1500"/> <item id="2391" countmax="1" chance="1000"/> <item id="2121" countmax="1" chance="5000"/> </loot></monster>
Postado Outubro 22, 2015 9 anos Não esquece de registrar no login.lua local m = { ["New Mage"] = { time = 60, -- Seconds to = {x=1, y=2, z=3}, -- Where Teleport Goes tp = {x= 4, y=5, z=6} -- Where Teleport Creates } } function onKill(cid, target) local monster = m[getCreatureName(target)] local function deleteTeleport() local teleport = getTileItemById(monster.tp, 1387) if(teleport.uid > 0) then doRemoveItem(teleport.uid) doSendMagicEffect(monster.tp, CONST_ME_POFF) end return true end if(isPlayer(target) == true) then return true elseif(not monster) then return true else doCreateTeleport(1387, monster.to, monster.tp) addEvent(deleteTeleport, monster.time * 1000) doSendMagicEffect(monster.tp, CONST_ME_ENERGYAREA) doCreatureSay(cid, "You have " .. monster.time .. " seconds to escape!", TALKTYPE_ORANGE_1) end return true end Editado Outubro 22, 2015 9 anos por vankk (veja o histórico de edições) Discord: vankk #7765 Precisando de ajuda? Entre em contato comigo via Discord. Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.
Postado Outubro 22, 2015 9 anos local tps = { ["new mage"] = {pos = {x=288, y=125, z=8}, toPos = {x=160, y=54, z=7}, time = 60} } local function removeTp(tp) local t = getTileItemById(tp.pos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(tp.pos, CONST_ME_POFF) end function onDeath(cid) local tp = tps[getCreatureName(cid):lower()] if isMonster(cid) and tp then doCreateTeleport(1387, tp.toPos, tp.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tp.time*1000, tp) end return true end Editado Outubro 22, 2015 9 anos por Vodkart (veja o histórico de edições) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Outubro 22, 2015 9 anos Autor Não esquece de registrar no login.lua local m = { ["New Mage"] = { time = 60, -- Seconds to = {x=1, y=2, z=3}, -- Where Teleport Goes tp = {x= 4, y=5, z=6} -- Where Teleport Creates } } function onKill(cid, target) local monster = m[getCreatureName(target)] local function deleteTeleport() local teleport = getTileItemById(monster.tp, 1387) if(teleport.uid > 0) then doRemoveItem(teleport.uid) doSendMagicEffect(monster.tp, CONST_ME_POFF) end return true end if(isPlayer(target) == true) then return true elseif(not monster) then return true else doCreateTeleport(1387, monster.to, monster.tp) addEvent(deleteTeleport, monster.time * 1000) doSendMagicEffect(monster.tp, CONST_ME_ENERGYAREA) doCreatureSay(cid, "You have " .. monster.time .. " seconds to escape!", TALKTYPE_ORANGE_1) end return true end ja resolvi criei outro topico com outro erro irritante e.e http://www.tibiaking.com/forum/topic/63733-debug-tpmonster/
Postado Outubro 22, 2015 9 anos Autor local tps = { ["new mage"] = {pos = {x=288, y=125, z=8}, toPos = {x=160, y=54, z=7}, time = 60} } local function removeTp(tp) local t = getTileItemById(tp.pos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(tp.pos, CONST_ME_POFF) end function onDeath(cid) local tp = tps[getCreatureName(cid):lower()] if isMonster(cid) and tp then doCreateTeleport(1387, tp.toPos, tp.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tp.time*1000, tp) end return true end Vod não entendi.. sou iniciante em script se puder explicar melhor agradeço obrigado.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.