Postado Janeiro 7, 2015 10 anos Eu gostaria de basicamente duas coisas: Monstros não atacar Jogadores que tenham X Storage (Isso vale para magias de área dadas pelos monstros). Players não atacar outros Players que tenha a mesma Storage. (Isso vale para magias de área).
Postado Janeiro 7, 2015 10 anos function onCombat(cid, target) local stor = {76543, 2} -- {storage, value} if isPlayer(target) and getPlayerStorageValue(target, stor[1]) == stor[2] then return false end return true end Registre o creature event tanto em login.lua, quanto no arquivo XML do monstro.
Postado Janeiro 7, 2015 10 anos Solução Não testei. o Statschange voce registra no login.lua, e o target voce registra no xml do monstro. function onStatsChange(cid, attacker, type, combat, value) if isPlayer(cid) and type == STATSCHANGE_HEALTHLOSS then if getPlayerStorageValue(cid, 12345) >= 1 then return false end end return true end function onTarget(cid, target) if isPlayer(target) and getPlayerStorageValue(target, 12345) >= 1 then return false end return true end
Postado Janeiro 7, 2015 10 anos Verdade, não entendi por que ele criou um script que evite dar target e outro que evite levar dano... Edit : mas esse statschange não vai se aplicar a todos os monstros não ? já que é pra registrar no login... Está certo ? : function onStatsChange(cid, attacker, type, combat, value) if isPlayer(cid) and type == STATSCHANGE_HEALTHLOSS and getMonsterInfo(name) == BLABLABLA then if getPlayerStorageValue(cid, 12345) >= 1 then return false end end return true end Editado Janeiro 8, 2015 10 anos por Caronte (veja o histórico de edições)
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.