Ir para conteúdo

[Encerrado] Como fazer, bicho morto vira portal


Heeyisis

Posts Recomendados

<?xml version="1.0" encoding="UTF-8"?>

<monster name="Lich" nameDescription="a lich" race="undead" experience="900" speed="320" manacost="0">

<health now="880" max="880"/>

<look type="99" head="95" body="116" legs="119" feet="115" corpse="6028"/>

<targetchange interval="5000" chance="8"/>

<strategy attack="100" defense="0"/>

<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 staticattack="90"/>

<flag runonhealth="0"/>

</flags>

<attacks>

<attack name="melee" interval="2000" skill="40" attack="30"/>

<attack name="lifedrain" interval="3000" chance="4" range="1" min="-50" max="-250">

<attribute key="areaEffect" value="blueshimmer"/>

</attack>

<attack name="speed" interval="4000" chance="15" range="7" speedchange="-600" duration="30000">

<attribute key="areaEffect" value="redshimmer"/>

</attack>

<attack name="lifedrain" interval="1000" chance="17" radius="3" target="0" min="-120" max="-200">

<attribute key="areaEffect" value="redshimmer"/>

</attack>

<attack name="lifedrain" interval="2000" chance="9" length="8" spread="0" min="-100" max="-200">

<attribute key="areaEffect" value="redshimmer"/>

</attack>

<attack name="poisoncondition" interval="3000" chance="9" length="8" spread="0" min="-300" max="-400">

<attribute key="areaEffect" value="greenspark"/>

</attack>

</attacks>

<defenses armor="20" defense="20">

<defense name="healing" interval="1000" chance="17" min="50" max="150">

<attribute key="areaEffect" value="redshimmer"/>

</defense>

</defenses>

<elements>

<element deathPercent="100"/>

<element earthPercent="100"/>

<element energyPercent="80"/>

<element holyPercent="-35"/>

</elements>

<immunities>

<immunity paralyze="1"/>

<immunity invisible="1"/>

</immunities>

<summons maxSummons="4">

<summon name="Bonebeast" interval="1000" chance="17" max="4"/>

</summons>

<voices interval="5000" chance="10">

<voice sentence="Doomed be the living!"/>

<voice sentence="You will endure agony beyond thy death!"/>

<voice sentence="Death awaits all!"/>

<voice sentence="Thy living flesh offends me!"/>

<voice sentence="Death and Decay!"/>

</voices>

<loot>

<item id="2148" countmax="70" chance="225000"/><!-- gold coin -->

<item id="2148" countmax="50" chance="225000"/><!-- gold coin -->

<item id="2401" chance="15000"/><!-- staff -->

<item id="2175" chance="10000"/><!-- spell book -->

<item id="2144" chance="6500"/><!-- black pearl -->

<item id="2143" chance="5500"/><!-- white pearl -->

<item id="2237" chance="45000"/><!-- dirty cape -->

<item id="2479" chance="6000"/><!-- strange helmet -->

<item id="2178" chance="5500"/><!-- mind stone -->

<item id="1987" chance="100000"><!-- bag -->

<inside>

<item id="7589" chance="2500"/><!-- strong mana potion -->

<item id="2171" chance="300"/><!-- platinium amulet -->

<item id="2214" chance="750"/><!-- ring of healing -->

<item id="7893" chance="600"/><!-- lightning boots -->

<item id="2656" chance="200"/><!-- blue robe -->

<item id="2535" chance="100"/><!-- castle shield -->

</inside>

</item>

</loot>

</monster>
Link para o comentário
Compartilhar em outros sites

Vá em data/creaturescripts/scripts e crie um arquivo chamado deadLich.lua e adicione dentro:

function onKill(cid, target, lastHit)

if not isMonster(target) then
    return true
end

if getCreatureName(target) == "Lich" then

    doSendMagicEffect({x = 1146, y = 1132, z = 10}, 65)
    doCreateTeleport(1387, {x = 1137, y = 1174, y = 10}, {x = 1146, y = 1132, z = 10})
    addEvent(doRemoveItem, 15 * 1000, getThingFromPos({x = 1146, y = 1132, z = 10, stackpos = 1}).uid)
     doPlayerSendTextMessage(cid, 20, "Você liberou o acesso para o portal, corra, ele fecha em 15 segundos!")
    return true
end

    return true
end

Em creaturescripts.xml adicione essa tag:

<event type="kill" name="deadLich" event="script" value="deadLich.lua"/>

Em login.lua:

registerCreatureEvent(cid, "deadLich")
Editado por Roksas
Link para o comentário
Compartilhar em outros sites

substitua seu monstro por esse aki.

 

<?xml version="1.0" encoding="UTF-8"?>

<monster name="Lich" nameDescription="a lich" race="undead" experience="900" speed="320" manacost="0">
<health now="880" max="880"/>
<look type="99" head="95" body="116" legs="119" feet="115" corpse="6028"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<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 staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="40" attack="30"/>
<attack name="lifedrain" interval="3000" chance="4" range="1" min="-50" max="-250">
<attribute key="areaEffect" value="blueshimmer"/>
</attack>
<attack name="speed" interval="4000" chance="15" range="7" speedchange="-600" duration="30000">
<attribute key="areaEffect" value="redshimmer"/>
</attack>
<attack name="lifedrain" interval="1000" chance="17" radius="3" target="0" min="-120" max="-200">
<attribute key="areaEffect" value="redshimmer"/>
</attack>
<attack name="lifedrain" interval="2000" chance="9" length="8" spread="0" min="-100" max="-200">
<attribute key="areaEffect" value="redshimmer"/>
</attack>
<attack name="poisoncondition" interval="3000" chance="9" length="8" spread="0" min="-300" max="-400">
<attribute key="areaEffect" value="greenspark"/>
</attack>
</attacks>
<defenses armor="20" defense="20">
<defense name="healing" interval="1000" chance="17" min="50" max="150">
<attribute key="areaEffect" value="redshimmer"/>
</defense>
</defenses>
<elements>
<element deathPercent="100"/>
<element earthPercent="100"/>
<element energyPercent="80"/>
<element holyPercent="-35"/>
</elements>
<immunities>
<immunity paralyze="1"/>
<immunity invisible="1"/>
</immunities>
<summons maxSummons="4">
<summon name="Bonebeast" interval="1000" chance="17" max="4"/>
</summons>
<voices interval="5000" chance="10">
<voice sentence="Doomed be the living!"/>
<voice sentence="You will endure agony beyond thy death!"/>
<voice sentence="Death awaits all!"/>
<voice sentence="Thy living flesh offends me!"/>
<voice sentence="Death and Decay!"/>
</voices>
<loot>
<item id="2148" countmax="70" chance="225000"/><!-- gold coin -->
<item id="2148" countmax="50" chance="225000"/><!-- gold coin -->
<item id="2401" chance="15000"/><!-- staff -->
<item id="2175" chance="10000"/><!-- spell book -->
<item id="2144" chance="6500"/><!-- black pearl -->
<item id="2143" chance="5500"/><!-- white pearl -->
<item id="2237" chance="45000"/><!-- dirty cape -->
<item id="2479" chance="6000"/><!-- strange helmet -->
<item id="2178" chance="5500"/><!-- mind stone -->
<item id="1987" chance="100000"><!-- bag -->
<inside>
<item id="7589" chance="2500"/><!-- strong mana potion -->
<item id="2171" chance="300"/><!-- platinium amulet -->
<item id="2214" chance="750"/><!-- ring of healing -->
<item id="7893" chance="600"/><!-- lightning boots -->
<item id="2656" chance="200"/><!-- blue robe -->
<item id="2535" chance="100"/><!-- castle shield -->
</inside>
</item>
</loot>
<script>
<event name="tpmonster"/>
</script>
</monster>

depois em data/creaturescripts/scripts copie um arquivo renomeie para tpmonster.lua e cole isso.
local config = {
message = "Eu Sou Imortal e Nao Vou Morrer Agora.......",
timeToRemove = 15, -- segundos
teleportId = 1387,
bosses = {
["NOME DO TEU MONSTRO AQUI!!!"] = { x = 2621, y = 232, z = 7 },
 
 
 
 
}
}
 
local function removal(position)
doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
return TRUE
end
 
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "teleportmonster")
local position = getCreaturePosition(cid)
 
for name, pos in pairs(config.bosses) do
if name == getCreatureName(cid) then
doCreateTeleport(config.teleportId, pos, position)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
doSendMagicEffect(position,10)
end
end
return TRUE
end
agora em login.lua adcione isso.
registerCreatureEvent(cid, "tpmonster")

em creaturescripts.xml adcione.

<event type="death" name="tpmonster" script="tpmonster.lua"/>

pra configurar pra onde o teleport vai levar basta modificar ali.

["NOME DO TEU MONSTRO AQUI!!!"] = { x = 2621, y = 232, z = 7 },
Editado por Maenilse
Link para o comentário
Compartilhar em outros sites

ae Rok cade o ultimo...

return true
end

u,U

 

tu ae decima...

pq tu boto isso? o.O

registerCreatureEvent(cid, "teleportmonster")

e tb ja q n vais usar a variavel 'teleport' eh melhor n criar ela...

teleport = doCreateTeleport(config.teleportId, pos, position)
Editado por Slicer
Link para o comentário
Compartilhar em outros sites

1* ele n deve ter esse evento aki... \/... ja q tu registrou diferente ali no .xml -e tb nem eh preciso ja q tu tem q por eh no login.lua-

registerCreatureEvent(cid, "teleportmonster")

e n eh questao de da erro... eh questao de n ser usado entao pra q ta ali, sabe? eh aquele velho principio...

Keep

It

Simple,

Stupid

 

-n leve o stupid a serio ta...-

http://pt.wikipedia.org/wiki/Keep_It_Simple

Editado por Slicer
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...