Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Aug 28, 2024
1 parent 0e407ed commit 1dbaa2d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
30 changes: 15 additions & 15 deletions methods/CMangos/ItemMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace LuaItem
return 1;
}

#if ELUNA_EXPANSION >= WOTLK
#if ELUNA_EXPANSION >= EXP_WOTLK
/**
* Returns 'true' if the [Item] is account bound, 'false' otherwise
*
Expand Down Expand Up @@ -83,7 +83,7 @@ namespace LuaItem
return 1;
}

#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
/**
* Returns 'true' if the [Item] is a currency token, 'false' otherwise
*
Expand Down Expand Up @@ -125,7 +125,7 @@ namespace LuaItem
*/
int CanBeTraded(Eluna* E, Item* item)
{
#if ELUNA_EXPANSION <= TBC
#if ELUNA_EXPANSION <= EXP_TBC
E->Push(item->CanBeTraded());
#else
bool mail = E->CHECKVAL<bool>(2, false);
Expand Down Expand Up @@ -192,7 +192,7 @@ namespace LuaItem
return 1;
}

#if ELUNA_EXPANSION == WOTLK
#if ELUNA_EXPANSION == EXP_WOTLK
/**
* Returns 'true' if the [Item] is a weapon vellum, 'false' otherwise
*
Expand Down Expand Up @@ -259,10 +259,10 @@ namespace LuaItem
if (ItemLocale const* il = eObjectMgr->GetItemLocale(temp->ItemId))
ObjectMgr::GetLocaleString(il->Name, static_cast<LocaleConstant>(locale), name);

#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
if (int32 itemRandPropId = item->GetItemRandomPropertyId())
{
#if ELUNA_EXPANSION == CATA
#if ELUNA_EXPANSION == EXP_CATA
char* suffix = NULL;
#else
char* const* suffix = NULL;
Expand Down Expand Up @@ -291,7 +291,7 @@ namespace LuaItem
oss << "|c" << std::hex << ItemQualityColors[temp->Quality] << std::dec <<
"|Hitem:" << temp->ItemId << ":" <<
item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT) << ":" <<
#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT) << ":" <<
item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT_2) << ":" <<
item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT_3) << ":" <<
Expand Down Expand Up @@ -491,7 +491,7 @@ namespace LuaItem
return 1;
}

#if ELUNA_EXPANSION > TBC
#if ELUNA_EXPANSION > EXP_TBC
/**
* Returns the flags2 of the [Item]
*
Expand Down Expand Up @@ -603,7 +603,7 @@ namespace LuaItem
return 1;
}

#if ELUNA_EXPANSION == WOTLK
#if ELUNA_EXPANSION == EXP_WOTLK
int GetStatsCount(Eluna* E, Item* item)
{
E->Push(item->GetTemplate()->StatsCount);
Expand All @@ -622,7 +622,7 @@ namespace LuaItem
return 1;
}

#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
int GetRandomSuffix(Eluna* E, Item* item)
{
E->Push(item->GetTemplate()->RandomSuffix);
Expand Down Expand Up @@ -790,7 +790,7 @@ namespace LuaItem
{ "GetDisplayId", &LuaItem::GetDisplayId },
{ "GetQuality", &LuaItem::GetQuality },
{ "GetFlags", &LuaItem::GetFlags },
#if ELUNA_EXPANSION > TBC
#if ELUNA_EXPANSION > EXP_TBC
{ "GetFlags2", &LuaItem::GetFlags2 },
#else
{ "GetFlags2", METHOD_REG_NONE },
Expand All @@ -807,12 +807,12 @@ namespace LuaItem
{ "GetRandomProperty", &LuaItem::GetRandomProperty },
{ "GetItemSet", &LuaItem::GetItemSet },
{ "GetBagSize", &LuaItem::GetBagSize },
#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
{ "GetRandomSuffix", &LuaItem::GetRandomSuffix },
#else
{ "GetRandomSuffix", METHOD_REG_NONE },
#endif
#if ELUNA_EXPANSION == WOTLK
#if ELUNA_EXPANSION == EXP_WOTLK
{ "GetStatsCount", &LuaItem::GetStatsCount },
#else
{ "GetStatsCount", METHOD_REG_NONE },
Expand Down Expand Up @@ -840,12 +840,12 @@ namespace LuaItem
{ "IsConjuredConsumable", &LuaItem::IsConjuredConsumable },
{ "SetEnchantment", &LuaItem::SetEnchantment },
{ "ClearEnchantment", &LuaItem::ClearEnchantment },
#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
{ "IsCurrencyToken", &LuaItem::IsCurrencyToken },
#else
{ "IsCurrencyToken", METHOD_REG_NONE },
#endif
#if ELUNA_EXPANSION == WOTLK
#if ELUNA_EXPANSION == EXP_WOTLK
{ "IsBoundAccountWide", &LuaItem::IsBoundAccountWide },
{ "IsWeaponVellum", &LuaItem::IsWeaponVellum },
{ "IsArmorVellum", &LuaItem::IsArmorVellum },
Expand Down
34 changes: 17 additions & 17 deletions methods/CMangos/UnitMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace LuaUnit
int32 immunity = E->CHECKVAL<int32>(2);
bool apply = E->CHECKVAL<bool>(3, true);

#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
unit->ApplySpellImmune(nullptr, 5, immunity, apply);
#else
unit->ApplySpellImmune(0, 5, immunity, apply);
Expand Down Expand Up @@ -383,7 +383,7 @@ namespace LuaUnit
return 1;
}

#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
/**
* Returns true if the [Unit] is on a [Vehicle].
*
Expand Down Expand Up @@ -1126,7 +1126,7 @@ namespace LuaUnit
return 1;
}

#if ELUNA_EXPANSION >= WOTLK
#if ELUNA_EXPANSION >= EXP_WOTLK
/**
* Returns [Unit]'s [Vehicle] methods
*
Expand Down Expand Up @@ -1605,7 +1605,7 @@ namespace LuaUnit
return 0;
}

#if ELUNA_EXPANSION >= WOTLK
#if ELUNA_EXPANSION >= EXP_WOTLK
/**
* Sets the [Unit]'s FFA flag on or off.
*
Expand Down Expand Up @@ -1922,15 +1922,15 @@ namespace LuaUnit
float y = E->CHECKVAL<float>(4);
float z = E->CHECKVAL<float>(5);
bool genPath = E->CHECKVAL<bool>(6, true);
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
unit->GetMotionMaster()->MovePoint(id, x, y, z, FORCED_MOVEMENT_NONE, genPath);
#else
unit->GetMotionMaster()->MovePoint(id, x, y, z, genPath);
#endif
return 0;
}

#if ELUNA_EXPANSION >= WOTLK
#if ELUNA_EXPANSION >= EXP_WOTLK
/**
* Makes the [Unit] jump to the coordinates
*
Expand Down Expand Up @@ -2181,15 +2181,15 @@ namespace LuaUnit

for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i)
{
#if ELUNA_EXPANSION == CATA
#if ELUNA_EXPANSION == EXP_CATA
SpellEffectEntry const* spellEffect = spellEntry->GetSpellEffect(SpellEffectIndex(i));
if (!spellEffect)
continue;
uint8 eff = spellEffect->Effect;
#else
uint8 eff = spellEntry->Effect[i];
#endif
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
if (eff >= MAX_SPELL_EFFECTS)
#else
if (eff >= TOTAL_SPELL_EFFECTS)
Expand All @@ -2199,7 +2199,7 @@ namespace LuaUnit
eff == SPELL_EFFECT_APPLY_AURA ||
eff == SPELL_EFFECT_PERSISTENT_AREA_AURA)
{
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
Aura* aur = CreateAura(spellEntry, SpellEffIndex(i), NULL, NULL, holder, target);
#else
Aura* aur = CreateAura(spellEntry, SpellEffIndex(i), NULL, holder, target);
Expand Down Expand Up @@ -2234,7 +2234,7 @@ namespace LuaUnit
return 0;
}

#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
/**
* Removes all positive visible [Aura]'s from the [Unit].
*/
Expand Down Expand Up @@ -2326,7 +2326,7 @@ namespace LuaUnit
// flat melee damage without resistence/etc reduction
if (school == MAX_SPELL_SCHOOL)
{
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
Unit::DealDamage(unit, target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, durabilityloss);
unit->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_NORMAL, 0);
#else
Expand All @@ -2339,7 +2339,7 @@ namespace LuaUnit
SpellSchoolMask schoolmask = SpellSchoolMask(1 << school);

if (schoolmask & SPELL_SCHOOL_MASK_NORMAL)
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
damage = unit->CalcArmorReducedDamage(unit, target, damage);
#else
damage = unit->CalcArmorReducedDamage(target, damage);
Expand All @@ -2349,7 +2349,7 @@ namespace LuaUnit
if (!spell)
{
uint32 absorb = 0;
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
int32 resist = 0;
#else
uint32 resist = 0;
Expand All @@ -2361,7 +2361,7 @@ namespace LuaUnit
else
damage -= absorb + resist;

#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
unit->DealDamageMods(unit, target, damage, &absorb, DIRECT_DAMAGE);
unit->DealDamage(unit, target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
#else
Expand Down Expand Up @@ -2409,7 +2409,7 @@ namespace LuaUnit
Unit* target = E->CHECKOBJ<Unit>(2);
bool durLoss = E->CHECKVAL<bool>(3, true);

#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
unit->DealDamage(unit, target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, durLoss);
#else
unit->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, durLoss);
Expand Down Expand Up @@ -2570,10 +2570,10 @@ namespace LuaUnit
{ "DealHeal", &LuaUnit::DealHeal },

// Expansion specific methods
#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
{ "IsOnVehicle", &LuaUnit::IsOnVehicle },
{ "RemoveArenaAuras", &LuaUnit::RemoveArenaAuras },
#elif ELUNA_EXPANSION >= WOTLK
#elif ELUNA_EXPANSION >= EXP_WOTLK
{ "GetCritterGUID", &LuaUnit::GetCritterGUID },
{ "GetVehicleKit", &LuaUnit::GetVehicleKit },
{ "SetFFA", &LuaUnit::SetFFA },
Expand Down
8 changes: 4 additions & 4 deletions methods/CMangos/WorldObjectMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace LuaWorldObject
return 1;
}

#if ELUNA_EXPANSION > TBC
#if ELUNA_EXPANSION > EXP_TBC
/**
* Returns the current phase of the [WorldObject]
*
Expand Down Expand Up @@ -1060,7 +1060,7 @@ namespace LuaWorldObject
return 0;

if (player)
#if ELUNA_EXPANSION == CATA
#if ELUNA_EXPANSION == EXP_CATA
obj->PlayDirectSound(soundId, player);
#else
obj->PlayDirectSound(soundId, PlayPacketParameters(PLAY_TARGET, (Player const*)player));
Expand Down Expand Up @@ -1090,7 +1090,7 @@ namespace LuaWorldObject
return 0;

if (player)
#if ELUNA_EXPANSION == CATA
#if ELUNA_EXPANSION == EXP_CATA
obj->PlayDistanceSound(soundId, player);
#else
obj->PlayDistanceSound(soundId, PlayPacketParameters(PLAY_TARGET, (Player const*)player));
Expand Down Expand Up @@ -1154,7 +1154,7 @@ namespace LuaWorldObject
{ "GetExactDistance2d", &LuaWorldObject::GetExactDistance2d },
{ "GetRelativePoint", &LuaWorldObject::GetRelativePoint },
{ "GetAngle", &LuaWorldObject::GetAngle },
#if ELUNA_EXPANSION == WOTLK
#if ELUNA_EXPANSION == EXP_WOTLK
{ "GetPhaseMask", &LuaWorldObject::GetPhaseMask },
{ "SetPhaseMask", &LuaWorldObject::SetPhaseMask },
#else
Expand Down

0 comments on commit 1dbaa2d

Please sign in to comment.