Skip to content

Commit

Permalink
Add method changes for MaNGOSThree
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Aug 31, 2024
1 parent 2ac45cb commit dd38cac
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
5 changes: 1 addition & 4 deletions ElunaIncludes.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ typedef Opcodes OpcodesList;
#if defined ELUNA_MANGOS
#define CORE_NAME "MaNGOS"
#define CORE_VERSION PROJECT_REVISION_NR
#if ELUNA_EXPANSION >= EXP_CATA
#define NUM_MSG_TYPES NUM_OPCODE_HANDLERS
#endif
#endif

#if defined ELUNA_TRINITY
Expand Down Expand Up @@ -186,7 +183,7 @@ typedef Opcodes OpcodesList;
#endif


#if ELUNA_EXPANSION >= EXP_CATA || defined ELUNA_VMANGOS
#if defined ELUNA_VMANGOS
#define PLAYER_FIELD_LIFETIME_HONORABLE_KILLS PLAYER_FIELD_LIFETIME_HONORBALE_KILLS
#endif

Expand Down
6 changes: 4 additions & 2 deletions methods/Mangos/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -701,18 +701,20 @@ namespace LuaCreature
return 1;
}

#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
/**
* Returns the [Creature]'s shield block value.
*
* @return uint32 shieldBlockValue
*/
int GetShieldBlockValue(Eluna* E, Creature* creature)
{
#if ELUNA_EXPANSION == EXP_CATA
E->Push(creature->GetShieldBlockDamageValue());
#else
E->Push(creature->GetShieldBlockValue());
#endif
return 1;
}
#endif

/**
* Returns the guid of the [Creature] that is used as the ID in the database
Expand Down
5 changes: 4 additions & 1 deletion methods/Mangos/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -1748,8 +1748,11 @@ namespace LuaGlobalFunctions

auto const itemlist = items->m_items;
for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr)
#if ELUNA_EXPANSION == EXP_CATA
eObjectMgr->RemoveVendorItem(entry, (*itr)->item, (*itr)->type);
#else
eObjectMgr->RemoveVendorItem(entry, (*itr)->item);

#endif
return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions methods/Mangos/GuildMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ namespace LuaGuild
return 1;
}

#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
/**
* Sets the leader of this [Guild]
*
Expand All @@ -128,7 +127,6 @@ namespace LuaGuild
guild->SetLeader(player->GET_GUID());
return 0;
}
#endif

#ifndef CLASSIC
/**
Expand Down
7 changes: 5 additions & 2 deletions methods/Mangos/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -724,18 +724,21 @@ namespace LuaPlayer
return 1;
}
#endif
#if defined(CLASSIC) || defined(TBC) || defined (WOTLK)

/**
* Returns the [Player]s current shield block value
*
* @return uint32 blockValue
*/
int GetShieldBlockValue(Eluna* E, Player* player)
{
#if ELUNA_EXPANSION == EXP_CATA
E->Push(player->GetShieldBlockDamageValue());
#else
E->Push(player->GetShieldBlockValue());
#endif
return 1;
}
#endif

/**
* Returns the [Player]s cooldown delay by specified [Spell] ID
Expand Down
7 changes: 6 additions & 1 deletion methods/Mangos/UnitMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ namespace LuaUnit
float maxHeight = E->CHECKVAL<float>(6);
uint32 id = E->CHECKVAL<uint32>(7, 0);

#if WOTLK
#if ELUNA_EXPANSION >= EXP_WOTLK
unit->GetMotionMaster()->MoveJump(x, y, z, zSpeed, maxHeight, id);
#else
Position pos(x, y, z);
Expand Down Expand Up @@ -2178,7 +2178,12 @@ namespace LuaUnit

for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i)
{
#if ELUNA_EXPANSION == EXP_CATA
SpellEffectEntry const* spellEffect = spellEntry->GetSpellEffect(SpellEffectIndex(i));
uint8 eff = spellEffect->Effect;
#else
uint8 eff = spellEntry->Effect[i];
#endif
if (eff >= TOTAL_SPELL_EFFECTS)
continue;

Expand Down

0 comments on commit dd38cac

Please sign in to comment.