Saltar a contenido

Funciones de Efectos

GetMaxEffect(aIndex)

Retorna el número máximo de slots de efectos que un objeto puede tener.

local max = GetMaxEffect(player.Index)

AddEffect(lpObj, type, index, count, v1, v2, v3, v4, v5, v6, buffSendValue, attackerIndex, rmv)

Agrega un efecto de buff/debuff a un objeto.

  • Parámetros:
  • lpObj (GameObject) — objeto objetivo
  • type (number) — tipo de efecto (0 o 1)
  • index (number) — ID del efecto
  • count (number) — duración en segundos o cantidad de cargas
  • v1..v6 (number) — valores del efecto (daño, defensa, etc.)
  • buffSendValue (number) — valor del icono de buff en el cliente
  • attackerIndex (number) — índice de la fuente del efecto
  • rmv (number) — probabilidad de éxito (0-100), o -1 para siempre
  • Retorna: number — 1 en éxito, 0 en fallo
-- Add +50 physical damage buff for 60 seconds, guaranteed
AddEffect(player, 1, 15, 60, 50, 0, 0, 0, 0, 0, 0, player.Index, -1)

DelEffect(lpObj, index)

Elimina un efecto específico por su ID.

  • Retorna: boolean
if DelEffect(player, 1) then
    GCNoticeSend(player.Index, 1, "Poison cured!")
end

DelEffectByGroup(lpObj, group)

Elimina todos los efectos pertenecientes a un grupo.

  • Retorna: boolean
DelEffectByGroup(player, 20) -- Remove all scroll buffs

GetEffect(lpObj, index)

Retorna el objeto GameCEffect para el ID de efecto dado, o nil si no se encuentra.

local eff = GetEffect(player, 1)
if eff then
    LogAdd(LOG_RED, "Poison remaining: " .. eff.m_time .. "s")
end

GetEffectByGroup(lpObj, group)

Retorna el primer GameCEffect en el grupo dado, o nil.

local scroll = GetEffectByGroup(player, 20)
if scroll then
    LogAdd(LOG_BLUE, "Scroll value: " .. scroll.m_value[1])
end

CheckEffect(lpObj, index)

Retorna true si el objeto tiene el efecto activo.

if CheckEffect(target, 16) then -- Mana Shield
    LogAdd(LOG_BLUE, "Target has Mana Shield active.")
end

CheckEffectByGroup(lpObj, group)

Retorna true si el objeto tiene algun efecto del grupo dado.

if CheckEffectByGroup(player, 35) then
    GCNoticeSend(player.Index, 1, "You already have an event buff.")
end

CheckStunEffect(lpObj)

Retorna true si el objeto está aturdido.

if CheckStunEffect(target) then
    LogAdd(LOG_BLUE, "Target is stunned!")
end

CheckImmobilizeEffect(lpObj)

Retorna true si el objeto está inmovilizado.

if CheckImmobilizeEffect(player) then
    GCNoticeSend(player.Index, 1, "You are frozen and cannot move!")
end

CheckDebuffSend(index)

Retorna true si el índice de efecto dado está clasificado como debuff para la visualización del cliente.

local isDebuff = CheckDebuffSend(5)

ClearAllEffect(lpObj)

Elimina todos los efectos del objeto.

ClearAllEffect(player)
GCNoticeSend(player.Index, 1, "All effects cleared.")

ClearDebuffEffect(lpObj, count)

Elimina hasta count efectos de debuff del objeto.

ClearDebuffEffect(player, 3)
GCNoticeSend(player.Index, 1, "Removed 3 debuffs.")

UpgradeDamageByClass(lpObj)

Calcula y retorna el daño bonus basado en la clase y estadísticas del personaje.

  • Retorna: number
local bonus = UpgradeDamageByClass(player)
LogAdd(LOG_BLUE, "Class damage bonus: " .. bonus)