Postado Julho 31, 2018 6 anos Seguinte pessoal, Tenho um script que heala o boss Gaz'Haragoth no 8.60 - 0.4 Porem ele tem um problema, quando algum player ou qualquer outro bicho chegar a life que ta configurado no script. O script funciona, o certo seria APENAS PARA O MONSTRO Gaz'Haragoth. Então queria que ele apenas funcionasse apenas para o MONSTRO Gaz'Haragoth. E não para players e para outros monstros. Aqui está o script em creaturescripts. Spoiler local config = { life_ative = 500000, life_add = 300000, seconds_ative = 20, gStorage = 90702, } function AddHealth(cid) setGlobalStorageValue(config.gStorage, 0) if not isCreature(cid) then return false end doCreatureAddHealth(cid, config.life_add) doCreatureSay(cid, "Gaz'Haragoth HEALS himself!", TALKTYPE_MONSTER) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) end function onStatsChange(cid, attacker, type, combat, value) if (getGlobalStorageValue(config.gStorage) < 1 and type == STATSCHANGE_HEALTHLOSS and getCreatureHealth(cid) < config.life_ative) then doCreatureSay(cid, "Gaz'Haragoth beginns to draw on the miniums to HEAL himself!", TALKTYPE_MONSTER) addEvent(AddHealth, config.seconds_ative * 1000, cid) setGlobalStorageValue(config.gStorage, 1) end return true end E no meu creaturescript.xml está assim. Citar <event type="statschange" name="HealGaz" event="script" value="HealGaz.lua"/> Editado Julho 31, 2018 6 anos por DigoleraBlow (veja o histórico de edições)
Postado Julho 31, 2018 6 anos Tenta isso no script -- <event type="healthchange" name="HealGaz" script="heal_gaz.lua"/> local config = { life_ative = 500000, life_add = 300000, seconds_ative = 20, gStorage = 90702, } function AddHealth(cid) setGlobalStorageValue(config.gStorage, 0) if not isCreature(cid) then return false end doCreatureAddHealth(cid, config.life_add) doCreatureSay(cid, "Gaz'Haragoth HEALS himself!", TALKTYPE_MONSTER) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) end function onStatsChange(cid, attacker, type, combat, value) if (getGlobalStorageValue(config.gStorage) < 1 and type == STATSCHANGE_HEALTHLOSS and getCreatureHealth(cid) < config.life_ative) then doCreatureSay(cid, "Gaz'Haragoth beginns to draw on the miniums to HEAL himself!", TALKTYPE_MONSTER) addEvent(AddHealth, config.seconds_ative * 1000, cid) setGlobalStorageValue(config.gStorage, 1) end return true end e no creaturescript coloque isso <event type="healthchange" name="HealGaz" script="HealGaz.lua"/>
Postado Agosto 1, 2018 6 anos Autor [Error - CreatureEvent::configureEvent] No valid type for creature event: healthchange. [Warning - BaseEvents::loadFromXml] Cannot configure an event
Postado Agosto 1, 2018 6 anos Solução local config = { life_ative = 500000, life_add = 300000, seconds_ative = 20, gStorage = 90702, monster = "Gaz'Haragoth" -- nome do monstro } function AddHealth(cid) setGlobalStorageValue(config.gStorage, 0) if not isCreature(cid) then return false end doCreatureAddHealth(cid, config.life_add) doCreatureSay(cid, "Gaz'Haragoth HEALS himself!", TALKTYPE_MONSTER) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) end function onStatsChange(cid, attacker, type, combat, value) if (getGlobalStorageValue(config.gStorage) < 1 and type == STATSCHANGE_HEALTHLOSS and getCreatureName(cid) == config.monster and getCreatureHealth(cid) < config.life_ative) then doCreatureSay(cid, "Gaz'Haragoth beginns to draw on the miniums to HEAL himself!", TALKTYPE_MONSTER) addEvent(AddHealth, config.seconds_ative * 1000, cid) setGlobalStorageValue(config.gStorage, 1) end return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.