Duelo e Crywolf¶
Funções para verificar o status de duelo PvP e consultar o estado do evento Crywolf.
Duelo¶
CheckDuel(lpObj, lpTarget)¶
Verifica se dois jogadores estão atualmente engajados em um duelo entre si.
- Parâmetros:
lpObj(GameObject): Objeto do primeiro jogador.lpTarget(GameObject): Objeto do segundo jogador.
- Retorna:
boolean—truese ambos os jogadores estão duelando entre si.
function OnPlayerAttack(aIndex, bIndex)
local attacker = GetUser(aIndex)
local target = GetUser(bIndex)
if CheckDuel(attacker, target) then
LogAdd(LOG_BLUE, "[Duel] %s is dueling %s", attacker.Name, target.Name)
end
end
Tip
CheckDuel retorna true apenas quando ambos os jogadores estão pareados no mesmo duelo. Retornará false se qualquer um dos jogadores estiver duelando com outra pessoa.
Crywolf¶
GetCrywolfState()¶
Retorna o estado atual do evento Crywolf.
- Parâmetros: Nenhum
- Retorna:
integer— Valor do estado atual do Crywolf.
| Valor | Estado |
|---|---|
| 0 | Inativo |
| 1 | Notificação (anunciando) |
| 2 | Pronto |
| 3 | Iniciado (batalha em andamento) |
| 4 | Encerrado |
function OnPlayerMapMove(aIndex, map)
if map == 34 then -- Crywolf map
local state = GetCrywolfState()
if state == 3 then
GCNoticeSend(aIndex, 1, "The Crywolf battle is in progress!")
elseif state == 0 then
GCNoticeSend(aIndex, 1, "Crywolf is currently peaceful.")
end
end
return 1
end
Help