Coé xtibianos.
Vi que alguns membros do fórum estavam com uma dúvida e não vi nenhum post sobre isso, decidi fazer um aqui. A galera tava com um bug na script e blá blá.
OBJETIVO: Fazer com que o mob, ao morrer, deixe um teleporte por um tempo (configurável) e que esse teleporte leve para tal lugar (configurável).
Vamos ao Script:
IREMOS USAR O MOB KYUUBI/CHAKRA BIJUU COMO EXEMPLO!
Primeiro de tudo vá em data/monster e adicione o chakrabijuu.xml
<?xml version="1.0" encoding="UTF-8"?><monster name="The Chakra Bijuu Control" nameDescription="The Chakra Bijuu Control" race="blood" experience="8000" speed="450" manacost="0"> <health now="76065000" max="76065000"/> <look type="124" head="0" body="94" legs="79" feet="79" corpse="2815"/> <targetchange interval="5000" chance="50"/> <strategy attack="90" defense="20"/> <flags> <flag summonable="1"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="1"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="65"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="800" min="-550" max="-640"/> <attack name="manadrain" interval="1000" chance="10" range="7" min="-760" max="-815"> <attribute key="areaEffect" value="redshimmer"/> </attack> <attack name="Bijuu Furie" interval="1000" chance="100" radius="4" target="0" min="-8340" max="-10600"> </attack> <attack name="Bijuu Punch" interval="2000" chance="100" target="0" min="-8440" max="-10100"> </attack> <attack name="Biju Dama" interval="2000" chance="100" target="0" min="-10440" max="-13100"> </attack> </attacks> <defenses armor="110" defense="110"> <defense name="healing" interval="2000" chance="40" min="300" max="300"> <attribute key="areaEffect" value="blueshimmer"/> </defense> <defense name="speed" interval="4000" chance="40" speedchange="600" duration="4000"> <attribute key="areaEffect" value="redshimmer"/> </defense> </defenses> <elements> <element physicalPercent="20"/> <element icePercent="10"/> <element holyPercent="-15"/> <element deathPercent="35"/> </elements> <immunities> <immunity poison="1"/> <immunity lifedrain="1"/> <immunity outfit="1"/> <immunity drunk="1"/> <immunity invisible="1"/> </immunities> <voices interval="5000" chance="10"> <voice sentence=".." yell="1"/> </voices> <loot> </loot> <script> <event name="the bijuu chakra control"/> </script> </monster>
(PARA SABER MAIS SOBRE COMO CRIAR UM MOB, DÊ UMA PROCURADA HEHEHEH)
Depois de ter feito isso, vá em monster.xml e adicione a tag:
<monster name="The Chakra Bijuu Control" file="pasta/chakrabijuu.xml"/>
Agora vá em data/creaturescripts/scripts, crie um .lua chamado chakrabijuu e adicione isso:
local boss = { ["The Chakra Bijuu Control"] = {destiny = {x=174, y=2019, z=7}, time = 50, portalid = 1026} } function removePortal(pos) doRemoveThing(getTileItemById(pos, b.portalid).uid, 1) return true end function onDeath(cid) local b, pos = boss[getCreatureName(cid)], getCreaturePosition(cid) if b then doSendMagicEffect(pos, CONST_ME_TELEPORT) doCreateTeleport(b.portalid, b.destiny, pos) addEvent(removePortal, b.time*1000, pos) doCreatureSay(cid, "Eu ainda retornarei, guarde isso. O teleporte irá sumir em "..b.time.." segundos.", TALKTYPE_ORANGE_1) end return true end
Em {destiny = {x=174, y=2019, z=7}, como já diz a palavra, você põem o destino do teleporte.
Em time = 50, você põem o tempo que o teleporte vai ficar spawnado.
Último passo, vá até data/creaturescripts, abra o creaturescripts.xml e adicione a tag:
<event type="death" name="the bijuu chakra control" event="script" value="chakrabijuu.lua"/>
Foi um tutorial curto mas acho que vai ajudar os membros que estavam com dúvida.
Créditos: Wise
Até a próxima, enjoy!!