Ir para conteúdo
  • 0

Ganhar skull ao atacar determinado monstro


Chupacabradoesgoto

Pergunta

3 respostass a esta questão

Posts Recomendados

  • 0
Tags:

<event type="logout" name="skullLogin" event="script" value="nome_do_arquivo.lua"/> 
<event type="statschange" name="skullStatsChange" event="script" value="nome_do_arquivo.lua"/>
<event type="target" name="skullTarget" event="script" value="nome_do_arquivo.lua"/>

Código (data/creaturescripts/scripts):

local monsterName = "nome_do_monstro"

function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(attacker) and getCreatureSkullType(attacker) ~= SKULL_WHITE and isMonster(cid) and getCreatureName(cid) == monsterName and type == STATSCHANGE_HEALTHLOSS then
doCreatureSetSkullType(attacker, SKULL_WHITE)
end
return true
end
function onTarget(cid, target)
if isPlayer(cid) and getCreatureSkullType(cid) ~= SKULL_WHITE and isMonster(target) and getCreatureName(target) == monsterName then
doCreatureSetSkullType(cid, SKULL_WHITE)
end
return true
end
function onLogin(cid)
registerCreatureEvent(cid, "skullStatsChange")
registerCreatureEvent(cid, "skullTarget")
return true
end

Link para o comentário
Compartilhar em outros sites

  • 0

mt obrigado!!

 

Tags:
<event type="logout" name="skullLogin" event="script" value="nome_do_arquivo.lua"/> 
<event type="statschange" name="skullStatsChange" event="script" value="nome_do_arquivo.lua"/>
<event type="target" name="skullTarget" event="script" value="nome_do_arquivo.lua"/>
Código (data/creaturescripts/scripts):
local monsterName = "nome_do_monstro"
 
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(attacker) and getCreatureSkullType(attacker) ~= SKULL_WHITE and isMonster(cid) and getCreatureName(cid) == monsterName and type == STATSCHANGE_HEALTHLOSS then
        doCreatureSetSkullType(attacker, SKULL_WHITE)
    end
    return true
end
function onTarget(cid, target)
    if isPlayer(cid) and getCreatureSkullType(cid) ~= SKULL_WHITE and isMonster(target) and getCreatureName(target) == monsterName then
        doCreatureSetSkullType(cid, SKULL_WHITE)
    end
    return true
end
function onLogin(cid)
    registerCreatureEvent(cid, "skullStatsChange")
    registerCreatureEvent(cid, "skullTarget")
    return true
end

 

 

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...