Ir para conteúdo

Featured Replies

Postado

Tenho esse Script aqui que não permite que eu ataque meu próprio Summon:

 

function onTarget(cid, target)
if(attacker and isMonster(target) and isSummon(attacker) and (type == STATSCHANGE_HEALTHLOSS)) then
return false
end
return true
end


function onStatsChange(cid, attacker, type, combat, value)
if(attacker and isMonster(target) and isSummon(attacker) and (type == STATSCHANGE_HEALTHLOSS)) then
if combat ~= COMBAT_HEALING then
return false
end 
end
return true
end


function onCast(cid, target)
if(attacker and isMonster(target) and isSummon(attacker) and (type == STATSCHANGE_HEALTHLOSS)) then
if combat ~= COMBAT_HEALING then
return false
end 
end
return true
end

No entanto, acabei de perceber que esse script também não me deixa atacar summons de monstros.

Como resolver?

Resolvido por Danves

Ir para solução
Postado
  • Solução
function onTarget(cid, target)
if isSummon(target) and isPlayer(cid) and getCreatureMaster(target) == cid then
return false
end
return true
end




function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHLOSS and isSummon(cid) and isPlayer(attacker) and getCreatureMaster(cid) == attacker  then
return false
end
return true
end

Acredito que não precisa do Oncast, vendo que você não poderá targetar ele e nem tirar dano com AOE por causa do statschange.

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96k
  • Posts 512.6k

Informação Importante

Confirmação de Termo