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 Bom, suponhamos que seja TFS 1.0 >Não sei se tem mais erros no script, mas tenta algo assim.Vai no creaturescripts/scripts e cria algo assim:Salva com qualquer nome. Aqui vai ser tpmonster.lua local tpId = 1387 local tps = { ["New Mage"] = {pos = {x=288, y=125, z=8}, toPos = {x=160, y=54, z=7}, time = 60}, } function removeTp(tp) if getThingfromPos(tp).itemid == tpId then doRemoveItem(getThingfromPos(tp).uid) end return TRUE end function 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 end E o xml: <event type="death" name="Tpmonster" script="tpmonster.lua"/> E põe isso no monstro, depois de </flags>, ou edita o que ja tem <script> <event name="Tpmonster"/> </script>#editOpa, no seu monstro fica 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> <script> <event name="Tpmonster"/> </script> <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> Editado Outubro 22, 2015 9 anos por rogaforyn2 (veja o histórico de edições)
Postado Outubro 22, 2015 9 anos Autor Bom, suponhamos que seja TFS 1.0 >Não sei se tem mais erros no script, mas tenta algo assim.Vai no creaturescripts/scripts e cria algo assim:Salva com qualquer nome. Aqui vai ser tpmonster.lua local tpId = 1387 local tps = { ["New Mage"] = {pos = {x=288, y=125, z=8}, toPos = {x=160, y=54, z=7}, time = 60}, } function removeTp(tp) if getThingfromPos(tp).itemid == tpId then doRemoveItem(getThingfromPos(tp).uid) end return TRUE end function 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 end E o xml: <event type="death" name="Tpmonster" script="tpmonster.lua"/> E põe isso no monstro, depois de </flags>, ou edita o que ja tem <script> <event name="Tpmonster"/> </script> #edit Opa, no seu monstro fica assim: Conteúdo Oculto tem skype amigo? sou meio tapado com script alias com tudo até com a vida e.e dai agente conversa por lá
Postado Outubro 24, 2015 9 anos no meu deu certo obg, mais depois dos 30 segundos o tp não some :sajeita ai Editado Outubro 24, 2015 9 anos por Loouis (veja o histórico de edições)
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.