- Fórum
- OTServ
- Recursos
- Scripting
- Mods, funções e outros
- [TFS 1.x] Gaz'Haragoth (Heal + Magia + Teleport)
LA
mod
[TFS 1.x] Gaz'Haragoth (Heal + Magia + Teleport)
Por larissaots, 03 de jun. de 2015 em Mods, funções e outros
script
1
3.1k
Por larissaots, 03 de jun. de 2015 em Mods, funções e outros
info
Grupo: Banidos
Registrado: 07/04/13
Posts: 648
Reputação: +163
Créditos: luanluciano93
HEAL - Se o life dele chega a 50k, ele solta um aviso, e depois de 5 segundos heala 300k.
Crie um arquivo em creaturescripts/scripts/ com o nome heal_gaz.lua e coloque esse código:
-- <event type="healthchange" name="HealGaz" script="heal_gaz.lua"/> local config = { life_ative = 50000, life_add = 300000, seconds_ative = 5, gStorage = 90702, } local function Uheal(cid) local gaz = Monster(cid) gaz:addHealth(config.life_add) gaz:say("Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER_SAY) gaz:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) Game.setStorageValue(config.gStorage, 0) end function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) if attacker then if creature:getHealth() < config.life_ative and Game.getStorageValue(config.gStorage) < 1 then creature:say("Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_SAY) addEvent(Uheal, 1000 * config.seconds_ative, creature.uid) Game.setStorageValue(config.gStorage, 1) end end return primaryDamage, primaryType, secondaryDamage, secondaryType endA tag que deve add ao creaturescript.xml esta como comentário no script, é só adicionar.
Depois para funcionar no Gaz, vá até o xml dele em monster e coloque em seu código:
<script> <event name="HealGaz" /> </script>Crie um arquivo em movements/scripts/ com o nome tp_gaz.lua e coloque esse código:
-- <movevent event="StepIn" itemid="22455" script="teleport_gaz.lua"/> function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if player == nil then return false end local monster = Creature("Gaz'Haragoth") if monster then player:teleportTo(monster:getPosition()) else player:teleportTo(fromPosition) end return true endA tag que deve add ao movements.xml esta como comentário no script, é só adicionar.