Postado Julho 22, 2018 6 anos TEM COMO ADAPTAR PRA TFS 0.4 ??? POR FAVOR PESSOAL DA UMA AJUDA AI SE TIVER 8.60 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 end A tag que deve add ao creaturescript.xml esta como comentário no script, é só add. Depois para funcionar no Gaz, vá até o xml dele em monster e coloque em seu código: <script> <event name="HealGaz" /> </script> TELEPORT - Quem passa em cima do corpo dos summons do boss é teleportado para perto dele. 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 end Editado Julho 22, 2018 6 anos por ADM Mayk on BaiakME (veja o histórico de edições) 758x426.bmp
Postado Julho 22, 2018 6 anos @ADM Mayk on BaiakME local config = { life_ative = 50000, life_add = 300000, seconds_ative = 5, gStorage = 90702, } local function Uheal(cid) doCreatureAddHealth(cid, config.life_add) doCreatureSay(cid, "Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER_SAY) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) doSetStorage(config.gStorage, 0) end function onStatsChange(cid, attacker, type, combat, value) if attacker and type == STATSCHANGE_HEALTHLOSS then if getCreatureHealth(cid) < config.life_ative and getStorage(config.gStorage) < 1 then doCreatureSay(cid, "Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_SAY) addEvent(Uheal, 1000 * config.seconds_ative, cid) doSetStorage(config.gStorage, 1) end end return true end -- <movevent event="StepIn" itemid="22455" script="teleport_gaz.lua"/> function onStepIn(cid, item, position, fromPosition) local player = cid if player == nil then return false end local monster = getCreatureByName("Gaz'Haragoth") local monster_pos = getCreaturePosition(monster) if monster then doTeleportThing(cid, monster_pos) else doTeleportThing(cid, fromPosition) end return true end
Postado Julho 22, 2018 6 anos Autor 2 horas atrás, Sttorm disse: @ADM Mayk on BaiakME local config = { life_ative = 50000, life_add = 300000, seconds_ative = 5, gStorage = 90702, } local function Uheal(cid) doCreatureAddHealth(cid, config.life_add) doCreatureSay(cid, "Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER_SAY) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) doSetStorage(config.gStorage, 0) end function onStatsChange(cid, attacker, type, combat, value) if attacker and type == STATSCHANGE_HEALTHLOSS then if getCreatureHealth(cid) < config.life_ative and getStorage(config.gStorage) < 1 then doCreatureSay(cid, "Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_SAY) addEvent(Uheal, 1000 * config.seconds_ative, cid) doSetStorage(config.gStorage, 1) end end return true end -- <movevent event="StepIn" itemid="22455" script="teleport_gaz.lua"/> function onStepIn(cid, item, position, fromPosition) local player = cid if player == nil then return false end local monster = getCreatureByName("Gaz'Haragoth") local monster_pos = getCreaturePosition(monster) if monster then doTeleportThing(cid, monster_pos) else doTeleportThing(cid, fromPosition) end return true end [Error - CreatureEvent::configureEvent] No valid type for creature event.healthchange [13:59:36.390] [Warning - BaseEvents::loadFromXml] Cannot configure an event 758x426.bmp
Postado Julho 22, 2018 6 anos 38 minutos atrás, ADM Mayk on BaiakME disse: [Error - CreatureEvent::configureEvent] No valid type for creature event.healthchange [13:59:36.390] [Warning - BaseEvents::loadFromXml] Cannot configure an event troca para statschange em creaturescripts.xml
Postado Julho 22, 2018 6 anos Autor 44 minutos atrás, Lyu disse: troca para statschange em creaturescripts.xml [14:50:24.415] [Error - CreatureScript Interface] [14:50:24.418] In a timer event called from: [14:50:24.421] data/creaturescripts/scripts/heal_gaz.lua:onStatsChange [14:50:24.426] Description: [14:50:24.429] (LuaInterface::luaDoCreatureAddHealth) Creature not found [14:50:24.435] [Error - CreatureScript Interface] [14:50:24.439] In a timer event called from: [14:50:24.442] data/creaturescripts/scripts/heal_gaz.lua:onStatsChange [14:50:24.446] Description: [14:50:24.448] (LuaInterface::luaDoCreatureSay) Creature not found [14:50:24.452] [Error - CreatureScript Interface] [14:50:24.456] In a timer event called from: [14:50:24.459] data/creaturescripts/scripts/heal_gaz.lua:onStatsChange [14:50:24.463] Description: [14:50:24.466] (LuaInterface::luaGetThingPosition) Thing not found agora da DEBUG quando a vida dele chega em x CONSEGUI ESSE AQUI NÃO DA ERRO NEM NADA !!! <event type="statschange" name="HealGaz" event="script" value="heal_gaz.lua"/> Citar local config = { life_ative = 50000, life_add = 300000, seconds_ative = 5, gStorage = 90702, } local function getCreatureHealth(cid) local gaz = isMonster(cid) doCreatureAddHealth(cid, config.life_add) doCreatureSay(cid, "Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER_SAY) doSendMagicEffect(cid, CONST_ME_MAGIC_RED) getPlayerStorageValue(cid, config.gStorage, 0) end function onStatsChange(cid, creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) if isMonster(cid) and isPlayer(attacker) then if isCreature(cid) < config.life_ative and getPlayerStorageValue(cid, config.gStorage) < 1 then doCreatureSay(cid, "Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_SAY) addEvent(cid, Uheal, 1000 * config.seconds_ative, creature.uid) getPlayerStorageValue(cid, config.gStorage, 1) end end return primaryDamage, primaryType, secondaryDamage, secondaryType end POREM NO JOGO FICA ASSIM A MAGIA DO HEAL SAI mais não cura o monstro .... Editado Julho 22, 2018 6 anos por ADM Mayk on BaiakME (veja o histórico de edições) 758x426.bmp
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.