mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Eluna classic support
This commit is contained in:
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# Copyright (C) 2010 - 2014 Eluna Lua Engine <http://emudevs.com/>
|
||||
# This program is free software licensed under GPL version 3
|
||||
# Please see the included DOCS/LICENSE.md for more information
|
||||
#
|
||||
|
||||
Includes.h
|
||||
@@ -227,7 +227,11 @@ namespace LuaGlobalFunctions
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << "|c" << std::hex << ItemQualityColors[temp->Quality] << std::dec <<
|
||||
"|Hitem:" << entry << ":0:0:0:0:0:0:0:0:0|h[" << name << "]|h|r";
|
||||
"|Hitem:" << entry << ":0:" <<
|
||||
#ifndef CLASSIC
|
||||
"0:0:0:0:" <<
|
||||
#endif
|
||||
"0:0:0:0|h[" << name << "]|h|r";
|
||||
|
||||
sEluna->Push(L, oss.str());
|
||||
return 1;
|
||||
@@ -531,7 +535,7 @@ namespace LuaGlobalFunctions
|
||||
float o = sEluna->CHECKVAL<float>(L, 8);
|
||||
bool save = sEluna->CHECKVAL<bool>(L, 9, false);
|
||||
uint32 durorresptime = sEluna->CHECKVAL<uint32>(L, 10, 0);
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
uint32 phase = sEluna->CHECKVAL<uint32>(L, 11, PHASEMASK_NORMAL);
|
||||
if (!phase)
|
||||
return 0;
|
||||
@@ -550,7 +554,7 @@ namespace LuaGlobalFunctions
|
||||
if (!cinfo)
|
||||
return 0;
|
||||
|
||||
#ifdef TBC
|
||||
#if (defined(TBC) || defined(CLASSIC))
|
||||
CreatureCreatePos pos(map, x, y, z, o);
|
||||
#else
|
||||
CreatureCreatePos pos(map, x, y, z, o, phase);
|
||||
@@ -569,6 +573,8 @@ namespace LuaGlobalFunctions
|
||||
|
||||
#ifdef TBC
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
|
||||
#elif defined(CLASSIC)
|
||||
pCreature->SaveToDB(map->GetId());
|
||||
#else
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase);
|
||||
#endif
|
||||
@@ -592,7 +598,7 @@ namespace LuaGlobalFunctions
|
||||
return 0;
|
||||
|
||||
TemporarySummon* pCreature = new TemporarySummon(GUID_TYPE(uint64(0)));
|
||||
#ifdef TBC
|
||||
#if (defined(TBC) || defined(CLASSIC))
|
||||
CreatureCreatePos pos(map, x, y, z, o);
|
||||
#else
|
||||
CreatureCreatePos pos(map, x, y, z, o, phase);
|
||||
@@ -636,7 +642,7 @@ namespace LuaGlobalFunctions
|
||||
return 0;
|
||||
|
||||
GameObject* pGameObj = new GameObject;
|
||||
#ifdef TBC
|
||||
#if (defined(TBC) || defined(CLASSIC))
|
||||
if (!pGameObj->Create(db_lowGUID, gInfo->id, map, x, y, z, o))
|
||||
#else
|
||||
if (!pGameObj->Create(db_lowGUID, gInfo->id, map, phase, x, y, z, o))
|
||||
@@ -652,6 +658,8 @@ namespace LuaGlobalFunctions
|
||||
// fill the gameobject data and save to the db
|
||||
#ifdef TBC
|
||||
pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
|
||||
#elif defined(CLASSIC)
|
||||
pGameObj->SaveToDB(map->GetId());
|
||||
#else
|
||||
pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase);
|
||||
#endif
|
||||
@@ -675,7 +683,7 @@ namespace LuaGlobalFunctions
|
||||
{
|
||||
GameObject* pGameObj = new GameObject;
|
||||
|
||||
#ifdef TBC
|
||||
#if (defined(TBC) || defined(CLASSIC))
|
||||
if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, x, y, z, o))
|
||||
#else
|
||||
if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, phase, x, y, z, o))
|
||||
@@ -807,7 +815,11 @@ namespace LuaGlobalFunctions
|
||||
#ifdef MANGOS
|
||||
if (!sObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, maxcount, incrtime, extendedcost, 0))
|
||||
return 0;
|
||||
#ifndef CLASSIC
|
||||
sObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost);
|
||||
#else
|
||||
sObjectMgr->AddVendorItem(entry, item, maxcount, incrtime);
|
||||
#endif
|
||||
#else
|
||||
#ifdef CATA
|
||||
if (!sObjectMgr->IsVendorItemValid(entry, item, maxcount, incrtime, extendedcost, 1))
|
||||
@@ -1072,8 +1084,6 @@ namespace LuaGlobalFunctions
|
||||
// optional
|
||||
entry->actionFlag = sEluna->CHECKVAL<uint32>(L, start + 4);
|
||||
entry->delay = sEluna->CHECKVAL<uint32>(L, start + 5);
|
||||
entry->arrivalEventID = sEluna->CHECKVAL<uint32>(L, start + 6);
|
||||
entry->departureEventID = sEluna->CHECKVAL<uint32>(L, start + 7);
|
||||
|
||||
nodes.push_back(*entry);
|
||||
|
||||
|
||||
@@ -135,7 +135,11 @@ namespace LuaGroup
|
||||
|
||||
int GetGUID(lua_State* L, Group* group)
|
||||
{
|
||||
#ifdef CLASSIC
|
||||
sEluna->Push(L, group->GetId());
|
||||
#else
|
||||
sEluna->Push(L, group->GET_GUID());
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ namespace LuaGuild
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CLASSIC
|
||||
int SetBankTabText(lua_State* L, Guild* guild)
|
||||
{
|
||||
uint8 tabId = sEluna->CHECKVAL<uint8>(L, 2);
|
||||
@@ -115,6 +116,7 @@ namespace LuaGuild
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* OTHER */
|
||||
// SendPacketToGuild(packet)
|
||||
@@ -173,6 +175,7 @@ namespace LuaGuild
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
// Move to Player methods
|
||||
int WithdrawBankMoney(lua_State* L, Guild* guild)
|
||||
{
|
||||
@@ -201,5 +204,6 @@ namespace LuaGuild
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
11
HookMgr.h
11
HookMgr.h
@@ -29,14 +29,9 @@
|
||||
#define SpellEffIndex SpellEffectIndex
|
||||
#define ItemTemplate ItemPrototype
|
||||
#define GetTemplate GetProto
|
||||
//#include "Common.h"
|
||||
//#include "Policies/Singleton.h"
|
||||
//#include "ObjectGuid.h"
|
||||
//#include "ace/Atomic_Op.h"
|
||||
//
|
||||
//enums
|
||||
//#include "DBCEnums.h"
|
||||
//#include "Includes.h"
|
||||
#ifdef CLASSIC
|
||||
#define Difficulty int
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct AreaTriggerEntry;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace LuaItem
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
int IsBoundAccountWide(lua_State* L, Item* item)
|
||||
{
|
||||
sEluna->Push(L, item->IsBoundAccountWide());
|
||||
@@ -50,11 +50,13 @@ namespace LuaItem
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int IsCurrencyToken(lua_State* L, Item* item)
|
||||
{
|
||||
sEluna->Push(L, item->IsCurrencyToken());
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int IsNotEmptyBag(lua_State* L, Item* item)
|
||||
{
|
||||
@@ -70,7 +72,7 @@ namespace LuaItem
|
||||
|
||||
int CanBeTraded(lua_State* L, Item* item)
|
||||
{
|
||||
#ifdef TBC
|
||||
#if (defined(TBC) || defined(CLASSIC))
|
||||
sEluna->Push(L, item->CanBeTraded());
|
||||
#else
|
||||
bool mail = sEluna->CHECKVAL<bool>(L, 2, false);
|
||||
@@ -163,6 +165,7 @@ namespace LuaItem
|
||||
if (ItemLocale const* il = sObjectMgr->GetItemLocale(temp->ItemId))
|
||||
ObjectMgr::GetLocaleString(il->Name, loc_idx, name);
|
||||
|
||||
#ifndef CLASSIC
|
||||
if (int32 itemRandPropId = item->GetItemRandomPropertyId())
|
||||
{
|
||||
#ifdef CATA
|
||||
@@ -192,15 +195,18 @@ namespace LuaItem
|
||||
/*}*/
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << "|c" << std::hex << ItemQualityColors[temp->Quality] << std::dec <<
|
||||
"|Hitem:" << temp->ItemId << ":" <<
|
||||
item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT) << ":" <<
|
||||
#ifndef CLASSIC
|
||||
item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT) << ":" <<
|
||||
item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT_2) << ":" <<
|
||||
item->GetEnchantmentId(SOCK_ENCHANTMENT_SLOT_3) << ":" <<
|
||||
item->GetEnchantmentId(BONUS_ENCHANTMENT_SLOT) << ":" <<
|
||||
#endif
|
||||
item->GetItemRandomPropertyId() << ":" << item->GetItemSuffixFactor() << ":" <<
|
||||
(uint32)item->GetOwner()->getLevel() << "|h[" << name << "]|h|r";
|
||||
|
||||
@@ -383,11 +389,13 @@ namespace LuaItem
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int GetRandomSuffix(lua_State* L, Item* item)
|
||||
{
|
||||
sEluna->Push(L, item->GetTemplate()->RandomSuffix);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int GetItemSet(lua_State* L, Item* item)
|
||||
{
|
||||
|
||||
12
LuaEngine.h
12
LuaEngine.h
@@ -19,7 +19,6 @@ extern "C"
|
||||
|
||||
// Required
|
||||
#include "AccountMgr.h"
|
||||
#include "ArenaTeam.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
#include "Cell.h"
|
||||
#include "CellImpl.h"
|
||||
@@ -58,9 +57,12 @@ extern "C"
|
||||
#include "SpellInfo.h"
|
||||
#include "WeatherMgr.h"
|
||||
#endif
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
#include "Vehicle.h"
|
||||
#endif
|
||||
#ifndef CLASSIC
|
||||
#include "ArenaTeam.h"
|
||||
#endif
|
||||
|
||||
typedef std::set<std::string> LoadedScripts;
|
||||
|
||||
@@ -95,7 +97,9 @@ typedef std::set<std::string> LoadedScripts;
|
||||
#define OVERRIDE override
|
||||
#define DIALOG_STATUS_SCRIPTED_NO_STATUS DIALOG_STATUS_UNDEFINED
|
||||
#define TempSummon TemporarySummon
|
||||
#ifndef CLASSIC
|
||||
#define PLAYER_FIELD_LIFETIME_HONORABLE_KILLS PLAYER_FIELD_LIFETIME_HONORBALE_KILLS
|
||||
#endif
|
||||
#define MAX_TALENT_SPECS MAX_TALENT_SPEC_COUNT
|
||||
#define Vehicle VehicleInfo
|
||||
#define GUID_ENPART(guid) ObjectGuid(guid).GetEntry()
|
||||
@@ -112,6 +116,10 @@ enum SelectAggroTarget
|
||||
#ifdef TBC
|
||||
#define SPELL_AURA_MOD_KILL_XP_PCT SPELL_AURA_MOD_XP_PCT
|
||||
#endif
|
||||
#ifdef CLASSIC
|
||||
#undef Opcodes
|
||||
#define Opcodes OpcodesList
|
||||
#endif
|
||||
#else
|
||||
#define GUID_TYPE uint64
|
||||
#define GET_GUID GetGUID
|
||||
|
||||
@@ -149,7 +149,7 @@ ElunaRegister<WorldObject> WorldObjectMethods[] =
|
||||
// Getters
|
||||
{ "GetName", &LuaWorldObject::GetName }, // :GetName()
|
||||
{ "GetMap", &LuaWorldObject::GetMap }, // :GetMap() - Returns the WorldObject's current map object
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "GetPhaseMask", &LuaWorldObject::GetPhaseMask }, // :GetPhaseMask()
|
||||
#endif
|
||||
{ "GetInstanceId", &LuaWorldObject::GetInstanceId }, // :GetInstanceId()
|
||||
@@ -214,7 +214,7 @@ ElunaRegister<Unit> UnitMethods[] =
|
||||
{ "GetCharmerGUID", &LuaUnit::GetCharmerGUID }, // :GetCharmerGUID() - Returns the UNIT_FIELD_CHARMEDBY charmer
|
||||
{ "GetCharmGUID", &LuaUnit::GetCharmGUID }, // :GetCharmGUID() - Returns the unit's UNIT_FIELD_CHARM guid
|
||||
{ "GetPetGUID", &LuaUnit::GetPetGUID }, // :GetPetGUID() - Returns the unit's pet GUID
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "GetCritterGUID", &LuaUnit::GetCritterGUID }, // :GetCritterGUID() - Returns the critter's GUID
|
||||
#endif
|
||||
{ "GetControllerGUID", &LuaUnit::GetControllerGUID }, // :GetControllerGUID() - Returns the Charmer or Owner GUID
|
||||
@@ -223,7 +223,7 @@ ElunaRegister<Unit> UnitMethods[] =
|
||||
{ "GetVictim", &LuaUnit::GetVictim }, // :GetVictim() - Returns creature's current target
|
||||
{ "GetStat", &LuaUnit::GetStat }, // :GetStat(stat)
|
||||
{ "GetBaseSpellPower", &LuaUnit::GetBaseSpellPower }, // :GetBaseSpellPower()
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "GetVehicleKit", &LuaUnit::GetVehicleKit }, // :GetVehicleKit() - Gets unit's Vehicle kit if the unit is a vehicle
|
||||
// {"GetVehicle", &LuaUnit::GetVehicle}, // :GetVehicle() - Gets the Vehicle kit of the vehicle the unit is on
|
||||
#endif
|
||||
@@ -239,7 +239,7 @@ ElunaRegister<Unit> UnitMethods[] =
|
||||
{ "SetNativeDisplayId", &LuaUnit::SetNativeDisplayId }, // :SetNativeDisplayId(id)
|
||||
{ "SetFacing", &LuaUnit::SetFacing }, // :SetFacing(o) - Sets the Unit facing to arg
|
||||
{ "SetFacingToObject", &LuaUnit::SetFacingToObject }, // :SetFacingToObject(worldObject) - Sets the Unit facing towards the WorldObject
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "SetPhaseMask", &LuaUnit::SetPhaseMask }, // :SetPhaseMask(Phase[, update]) - Sets the phase of the unit
|
||||
#endif
|
||||
{ "SetSpeed", &LuaUnit::SetSpeed }, // :SetSpeed(type, speed[, forced]) - Sets speed for the movement type (0 = walk, 1 = run ..)
|
||||
@@ -248,7 +248,7 @@ ElunaRegister<Unit> UnitMethods[] =
|
||||
// {"SetConfused", &LuaUnit::SetConfused}, // :SetConfused([enable]) - Sets confused or removes confusion
|
||||
// {"SetFeared", &LuaUnit::SetFeared}, // :SetFeared([enable]) - Fears or removes fear
|
||||
{ "SetPvP", &LuaUnit::SetPvP }, // :SetPvP([apply]) - Sets the units PvP on or off
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "SetFFA", &LuaUnit::SetFFA }, // :SetFFA([apply]) - Sets the units FFA tag on or off
|
||||
{ "SetSanctuary", &LuaUnit::SetSanctuary }, // :SetSanctuary([apply]) - Enables or disables units sanctuary flag
|
||||
#endif
|
||||
@@ -261,7 +261,7 @@ ElunaRegister<Unit> UnitMethods[] =
|
||||
{ "SetMinionGUID", &LuaUnit::SetMinionGUID }, // :SetCreatorGUID(uint64 creatorGUID) - Sets the UNIT_FIELD_CREATEDBY creator's guid
|
||||
{ "SetCharmerGUID", &LuaUnit::SetCharmerGUID }, // :SetCharmerGUID(uint64 ownerGUID) - Sets the UNIT_FIELD_CHARMEDBY charmer GUID
|
||||
{ "SetPetGUID", &LuaUnit::SetPetGUID }, // :SetPetGUID(uint64 guid) - Sets the pet's guid
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "SetCritterGUID", &LuaUnit::SetCritterGUID }, // :SetCritterGUID(uint64 guid) - Sets the critter's guid
|
||||
#endif
|
||||
{ "SetWaterWalk", &LuaUnit::SetWaterWalk }, // :SetWaterWalk([enable]) - Sets WaterWalk on or off
|
||||
@@ -310,7 +310,9 @@ ElunaRegister<Unit> UnitMethods[] =
|
||||
{ "IsFullHealth", &LuaUnit::IsFullHealth }, // :IsFullHealth() - Returns if the unit is full health
|
||||
{ "HasAura", &LuaUnit::HasAura }, // :HasAura(spellId) - Returns true if the unit has the aura from the spell
|
||||
{ "IsStandState", &LuaUnit::IsStandState }, // :IsStandState() - Returns true if the unit is standing
|
||||
#ifndef CLASSIC
|
||||
{ "IsOnVehicle", &LuaUnit::IsOnVehicle }, // :IsOnVehicle() - Checks if the unit is on a vehicle
|
||||
#endif
|
||||
|
||||
// Other
|
||||
{ "RegisterEvent", &LuaUnit::RegisterEvent }, // :RegisterEvent(function, delay, calls)
|
||||
@@ -356,7 +358,7 @@ ElunaRegister<Unit> UnitMethods[] =
|
||||
{ "MoveConfused", &LuaUnit::MoveConfused }, // :MoveConfused()
|
||||
{ "MoveFleeing", &LuaUnit::MoveFleeing }, // :MoveFleeing(enemy[, time])
|
||||
{ "MoveTo", &LuaUnit::MoveTo }, // :MoveTo(id, x, y, z[, genPath]) - Moves to point. id is sent to WP reach hook. genPath defaults to true
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "MoveJump", &LuaUnit::MoveJump }, // :MoveJump(x, y, z, zSpeed, maxHeight, id)
|
||||
#endif
|
||||
{ "MoveStop", &LuaUnit::MoveStop }, // :MoveStop()
|
||||
@@ -380,8 +382,10 @@ ElunaRegister<Player> PlayerMethods[] =
|
||||
{ "GetAccountId", &LuaPlayer::GetAccountId }, // :GetAccountId()
|
||||
{ "GetAccountName", &LuaPlayer::GetAccountName }, // :GetAccountName()
|
||||
#ifndef CATA
|
||||
#ifndef CLASSIC
|
||||
{ "GetArenaPoints", &LuaPlayer::GetArenaPoints }, // :GetArenaPoints()
|
||||
{ "GetHonorPoints", &LuaPlayer::GetHonorPoints }, // :GetHonorPoints()
|
||||
#endif
|
||||
#endif
|
||||
{ "GetLifetimeKills", &LuaPlayer::GetLifetimeKills }, // :GetLifetimeKills() - Returns the player's lifetime (honorable) kills
|
||||
{ "GetPlayerIP", &LuaPlayer::GetPlayerIP }, // :GetPlayerIP() - Returns the player's IP Address
|
||||
@@ -405,7 +409,7 @@ ElunaRegister<Player> PlayerMethods[] =
|
||||
{ "GetComboTarget", &LuaPlayer::GetComboTarget }, // :GetComboTarget() - Returns the player's combo target
|
||||
{ "GetGuildName", &LuaPlayer::GetGuildName }, // :GetGuildName() - Returns player's guild's name or nil
|
||||
{ "GetFreeTalentPoints", &LuaPlayer::GetFreeTalentPoints }, // :GetFreeTalentPoints() - Returns the amount of unused talent points
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "GetActiveSpec", &LuaPlayer::GetActiveSpec }, // :GetActiveSpec() - Returns the active specID
|
||||
{ "GetSpecsCount", &LuaPlayer::GetSpecsCount }, // :GetSpecsCount() - Returns the player's spec count
|
||||
#endif
|
||||
@@ -453,12 +457,16 @@ ElunaRegister<Player> PlayerMethods[] =
|
||||
{ "AdvanceAllSkills", &LuaPlayer::AdvanceAllSkills }, // :AdvanceAllSkills(value) - Advances all current skills to your input(value)
|
||||
{ "AddLifetimeKills", &LuaPlayer::AddLifetimeKills }, // :AddLifetimeKills(val) - Adds lifetime (honorable) kills to your current lifetime kills
|
||||
{ "SetCoinage", &LuaPlayer::SetCoinage }, // :SetCoinage(amount) - sets plr's coinage to this
|
||||
#ifndef CLASSIC
|
||||
{ "SetKnownTitle", &LuaPlayer::SetKnownTitle }, // :SetKnownTitle(id)
|
||||
{ "UnsetKnownTitle", &LuaPlayer::UnsetKnownTitle }, // :UnsetKnownTitle(id)
|
||||
#endif
|
||||
{ "SetBindPoint", &LuaPlayer::SetBindPoint }, // :SetBindPoint(x, y, z, map, areaid) - sets home for hearthstone
|
||||
#ifndef CATA
|
||||
#ifndef CLASSIC
|
||||
{ "SetArenaPoints", &LuaPlayer::SetArenaPoints }, // :SetArenaPoints(amount)
|
||||
{ "SetHonorPoints", &LuaPlayer::SetHonorPoints }, // :SetHonorPoints(amount)
|
||||
#endif
|
||||
#endif
|
||||
{ "SetLifetimeKills", &LuaPlayer::SetLifetimeKills }, // :SetLifetimeKills(val) - Sets the overall lifetime (honorable) kills of the player
|
||||
{ "SetGameMaster", &LuaPlayer::SetGameMaster }, // :SetGameMaster([on]) - Sets GM mode on or off
|
||||
@@ -492,11 +500,15 @@ ElunaRegister<Player> PlayerMethods[] =
|
||||
{ "IsGM", &LuaPlayer::IsGM }, // :IsGM()
|
||||
{ "IsAlliance", &LuaPlayer::IsAlliance }, // :IsAlliance()
|
||||
{ "IsHorde", &LuaPlayer::IsHorde }, // :IsHorde()
|
||||
#ifndef CLASSIC
|
||||
{ "HasTitle", &LuaPlayer::HasTitle }, // :HasTitle(id)
|
||||
#endif
|
||||
{ "HasItem", &LuaPlayer::HasItem }, // :HasItem(itemId[, count, check_bank]) - Returns true if the player has the item(itemId) and specified count, else it will return false
|
||||
{ "Teleport", &LuaPlayer::Teleport }, // :Teleport(Map, X, Y, Z, O) - Teleports player to specified co - ordinates. Returns true if success and false if not
|
||||
{ "AddItem", &LuaPlayer::AddItem }, // :AddItem(id, amount) - Adds amount of item to player. Returns true if success and false if not
|
||||
#ifndef CLASSIC
|
||||
{ "IsInArenaTeam", &LuaPlayer::IsInArenaTeam }, // :IsInArenaTeam(type) - type : 0 = 2v2, 1 = 3v3, 2 = 5v5
|
||||
#endif
|
||||
{ "CanEquipItem", &LuaPlayer::CanEquipItem }, // :CanEquipItem(entry/item, slot) - Returns true if the player can equip given item/item entry
|
||||
{ "IsFalling", &LuaPlayer::IsFalling }, // :IsFalling() - Returns true if the unit is falling
|
||||
{ "ToggleAFK", &LuaPlayer::ToggleAFK }, // :ToggleAFK() - Toggles AFK state for player
|
||||
@@ -514,7 +526,7 @@ ElunaRegister<Player> PlayerMethods[] =
|
||||
{ "HasAtLoginFlag", &LuaPlayer::HasAtLoginFlag }, // :HasAtLoginFlag(flag) - returns true if the player has the login flag
|
||||
// {"InRandomLfgDungeon", &LuaPlayer::InRandomLfgDungeon}, // :InRandomLfgDungeon() - Returns true if the player is in a random LFG dungeon
|
||||
// {"HasPendingBind", &LuaPlayer::HasPendingBind}, // :HasPendingBind() - Returns true if the player has a pending instance bind
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "HasAchieved", &LuaPlayer::HasAchieved }, // :HasAchieved(achievementID) - Returns true if the player has achieved the achievement
|
||||
#endif
|
||||
{ "CanUninviteFromGroup", &LuaPlayer::CanUninviteFromGroup }, // :CanUninviteFromGroup() - Returns true if the player can uninvite from group
|
||||
@@ -527,7 +539,7 @@ ElunaRegister<Player> PlayerMethods[] =
|
||||
{ "HasQuestForGO", &LuaPlayer::HasQuestForGO }, // :HasQuestForGO(entry) - Returns true if the player has the quest for the gameobject
|
||||
{ "CanShareQuest", &LuaPlayer::CanShareQuest }, // :CanShareQuest(entry) - Returns true if the quest entry is shareable by the player
|
||||
// {"HasReceivedQuestReward", &LuaPlayer::HasReceivedQuestReward}, // :HasReceivedQuestReward(entry) - Returns true if the player has recieved the quest's reward
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "HasTalent", &LuaPlayer::HasTalent }, // :HasTalent(talentId, spec) - Returns true if the player has the talent in given spec
|
||||
#endif
|
||||
{ "IsInSameGroupWith", &LuaPlayer::IsInSameGroupWith }, // :IsInSameGroupWith(player) - Returns true if the players are in the same group
|
||||
@@ -537,20 +549,26 @@ ElunaRegister<Player> PlayerMethods[] =
|
||||
{ "IsHonorOrXPTarget", &LuaPlayer::IsHonorOrXPTarget }, // :IsHonorOrXPTarget(victim) - Returns true if the victim gives honor or XP
|
||||
{ "CanParry", &LuaPlayer::CanParry }, // :CanParry() - Returns true if the player can parry
|
||||
{ "CanBlock", &LuaPlayer::CanBlock }, // :CanBlock() - Returns true if the player can block
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "CanTitanGrip", &LuaPlayer::CanTitanGrip }, // :CanTitanGrip() - Returns true if the player has titan grip
|
||||
#endif
|
||||
{ "InBattleground", &LuaPlayer::InBattleground }, // :InBattleground() - Returns true if the player is in a battleground
|
||||
#ifndef CLASSIC
|
||||
{ "InArena", &LuaPlayer::InArena }, // :InArena() - Returns true if the player is in an arena
|
||||
#endif
|
||||
// {"IsOutdoorPvPActive", &LuaPlayer::IsOutdoorPvPActive}, // :IsOutdoorPvPActive() - Returns true if the player is outdoor pvp active
|
||||
// {"IsARecruiter", &LuaPlayer::IsARecruiter}, // :IsARecruiter() - Returns true if the player is a recruiter
|
||||
{ "CanUseItem", &LuaPlayer::CanUseItem }, // :CanUseItem(item/entry) - Returns true if the player can use the item or item entry
|
||||
{ "HasSpell", &LuaPlayer::HasSpell }, // :HasSpell(id)
|
||||
{ "HasSpellCooldown", &LuaPlayer::HasSpellCooldown }, // :HasSpellCooldown(spellId) - Returns true if the spell is on cooldown
|
||||
{ "IsInWater", &LuaPlayer::IsInWater }, // :IsInWater() - Returns true if the player is in water
|
||||
#ifndef CLASSIC
|
||||
{ "CanFly", &LuaPlayer::CanFly }, // :CanFly() - Returns true if the player can fly
|
||||
#endif
|
||||
{ "IsMoving", &LuaPlayer::IsMoving }, // :IsMoving()
|
||||
#ifndef CLASSIC
|
||||
{ "IsFlying", &LuaPlayer::IsFlying }, // :IsFlying()
|
||||
#endif
|
||||
|
||||
// Gossip
|
||||
{ "GossipMenuAddItem", &LuaPlayer::GossipMenuAddItem }, // :GossipMenuAddItem(icon, msg, sender, intid[, code, popup, money])
|
||||
@@ -594,7 +612,7 @@ ElunaRegister<Player> PlayerMethods[] =
|
||||
// {"KilledPlayerCredit", &LuaPlayer::KilledPlayerCredit}, // :KilledPlayerCredit() - Satisfies a player kill for the player
|
||||
// {"KillGOCredit", &LuaPlayer::KillGOCredit}, // :KillGOCredit(GOEntry[, GUID]) - Credits the player for destroying a GO, guid is optional
|
||||
{ "TalkedToCreature", &LuaPlayer::TalkedToCreature }, // :TalkedToCreature(npcEntry, creature) - Satisfies creature talk objective for the player
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "ResetPetTalents", &LuaPlayer::ResetPetTalents }, // :ResetPetTalents() - Resets player's pet's talents
|
||||
#endif
|
||||
{ "AddComboPoints", &LuaPlayer::AddComboPoints }, // :AddComboPoints(target, count[, spell]) - Adds combo points to the target for the player
|
||||
@@ -614,14 +632,16 @@ ElunaRegister<Player> PlayerMethods[] =
|
||||
{ "DurabilityRepairAll", &LuaPlayer::DurabilityRepairAll }, // :DurabilityRepairAll([has_cost, discount, guildBank]) - Repairs all durability
|
||||
{ "DurabilityRepair", &LuaPlayer::DurabilityRepair }, // :DurabilityRepair(position[, has_cost, discount, guildBank]) - Repairs item durability of item in given position
|
||||
#ifndef CATA
|
||||
#ifndef CLASSIC
|
||||
{ "ModifyHonorPoints", &LuaPlayer::ModifyHonorPoints }, // :ModifyHonorPoints(amount) - Modifies the player's honor points
|
||||
{ "ModifyArenaPoints", &LuaPlayer::ModifyArenaPoints }, // :ModifyArenaPoints(amount) - Modifies the player's arena points
|
||||
#endif
|
||||
#endif
|
||||
{ "LeaveBattleground", &LuaPlayer::LeaveBattleground }, // :LeaveBattleground([teleToEntryPoint]) - The player leaves the battleground
|
||||
// {"BindToInstance", &LuaPlayer::BindToInstance}, // :BindToInstance() - Binds the player to the current instance
|
||||
{ "UnbindInstance", &LuaPlayer::UnbindInstance }, // :UnbindInstance(map, difficulty) - Unbinds the player from an instance
|
||||
{ "RemoveFromBattlegroundRaid", &LuaPlayer::RemoveFromBattlegroundRaid }, // :RemoveFromBattlegroundRaid() - Removes the player from a battleground or battlefield raid
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "ResetAchievements", &LuaPlayer::ResetAchievements }, // :ResetAchievements() - Resets player<65>s achievements
|
||||
#endif
|
||||
{ "KickPlayer", &LuaPlayer::KickPlayer }, // :KickPlayer() - Kicks player from server
|
||||
@@ -804,7 +824,9 @@ ElunaRegister<Item> ItemMethods[] =
|
||||
{ "GetStatsCount", &LuaItem::GetStatsCount }, // :GetStatsCount()
|
||||
#endif
|
||||
{ "GetRandomProperty", &LuaItem::GetRandomProperty }, // :GetRandomProperty()
|
||||
#ifndef CLASSIC
|
||||
{ "GetRandomSuffix", &LuaItem::GetRandomSuffix }, // :GetRandomSuffix()
|
||||
#endif
|
||||
{ "GetItemSet", &LuaItem::GetItemSet }, // :GetItemSet()
|
||||
{ "GetBagSize", &LuaItem::GetBagSize }, // :GetBagSize()
|
||||
|
||||
@@ -815,14 +837,16 @@ ElunaRegister<Item> ItemMethods[] =
|
||||
|
||||
// Boolean
|
||||
{ "IsSoulBound", &LuaItem::IsSoulBound }, // :IsSoulBound() - Returns true if the item is soulbound
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "IsBoundAccountWide", &LuaItem::IsBoundAccountWide }, // :IsBoundAccountWide() - Returns true if the item is account bound
|
||||
#endif
|
||||
{ "IsBoundByEnchant", &LuaItem::IsBoundByEnchant }, // :IsBoundByEnchant() - Returns true if the item is bound with an enchant
|
||||
{ "IsNotBoundToPlayer", &LuaItem::IsNotBoundToPlayer }, // :IsNotBoundToPlayer(player) - Returns true if the item is not bound with player
|
||||
{ "IsLocked", &LuaItem::IsLocked }, // :IsLocked() - Returns true if the item is locked
|
||||
{ "IsBag", &LuaItem::IsBag }, // :IsBag() - Returns true if the item is a bag
|
||||
#ifndef CLASSIC
|
||||
{ "IsCurrencyToken", &LuaItem::IsCurrencyToken }, // :IsCurrencyToken() - Returns true if the item is a currency token
|
||||
#endif
|
||||
{ "IsNotEmptyBag", &LuaItem::IsNotEmptyBag }, // :IsNotEmptyBag() - Returns true if the item is not an empty bag
|
||||
{ "IsBroken", &LuaItem::IsBroken }, // :IsBroken() - Returns true if the item is broken
|
||||
{ "CanBeTraded", &LuaItem::CanBeTraded }, // :CanBeTraded() - Returns true if the item can be traded
|
||||
@@ -910,7 +934,9 @@ ElunaRegister<Quest> QuestMethods[] =
|
||||
|
||||
// Boolean
|
||||
{ "HasFlag", &LuaQuest::HasFlag }, // :HasFlag(flag) - Returns true or false if the quest has the specified flag
|
||||
#ifndef CLASSIC
|
||||
{ "IsDaily", &LuaQuest::IsDaily }, // :IsDaily() - Returns true or false if the quest is a daily
|
||||
#endif
|
||||
{ "IsRepeatable", &LuaQuest::IsRepeatable }, // :IsRepeatable() - Returns true or false if the quest is repeatable
|
||||
|
||||
// Setters
|
||||
@@ -970,7 +996,9 @@ ElunaRegister<Guild> GuildMethods[] =
|
||||
{ "GetMemberCount", &LuaGuild::GetMemberCount }, // :GetMemberCount() - Returns the amount of players in the guild
|
||||
|
||||
// Setters
|
||||
#ifndef CLASSIC
|
||||
{ "SetBankTabText", &LuaGuild::SetBankTabText }, // :SetBankTabText(tabId, text)
|
||||
#endif
|
||||
{ "SetMemberRank", &LuaGuild::ChangeMemberRank }, // :SetMemberRank(player, newRank) - Sets the player rank in the guild to the new rank
|
||||
#ifndef CATA
|
||||
{ "SetLeader", &LuaGuild::SetLeader }, // :SetLeader() - Sets the guild's leader
|
||||
@@ -985,13 +1013,15 @@ ElunaRegister<Guild> GuildMethods[] =
|
||||
{ "Disband", &LuaGuild::Disband }, // :Disband() - Disbands the guild
|
||||
{ "AddMember", &LuaGuild::AddMember }, // :AddMember(player, rank) - adds the player to the guild. Rank is optional
|
||||
{ "DeleteMember", &LuaGuild::DeleteMember }, // :DeleteMember(player, disbanding, kicked) - Deletes the player from the guild. Disbanding and kicked are optional bools
|
||||
#ifndef CLASSIC
|
||||
{ "DepositBankMoney", &LuaGuild::DepositBankMoney }, // :DepositBankMoney(money) - Deposits money into the guild bank
|
||||
{ "WithdrawBankMoney", &LuaGuild::WithdrawBankMoney }, // :WithdrawBankMoney(money) - Withdraws money from the guild bank
|
||||
#endif
|
||||
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
ElunaRegister<Vehicle> VehicleMethods[] =
|
||||
{
|
||||
// Getters
|
||||
@@ -1081,11 +1111,15 @@ ElunaRegister<Map> MapMethods[] =
|
||||
{ "GetHeight", &LuaMap::GetHeight }, // :GetHeight(x, y[, phasemask]) - Returns ground Z coordinate. UNDOCUMENTED
|
||||
|
||||
// Booleans
|
||||
#ifndef CLASSIC
|
||||
{ "IsArena", &LuaMap::IsArena }, // :IsArena() - Returns the true if the map is an arena, else false UNDOCUMENTED
|
||||
#endif
|
||||
{ "IsBattleground", &LuaMap::IsBattleground }, // :IsBattleground() - Returns the true if the map is a battleground, else false UNDOCUMENTED
|
||||
{ "IsDungeon", &LuaMap::IsDungeon }, // :IsDungeon() - Returns the true if the map is a dungeon , else false UNDOCUMENTED
|
||||
{ "IsEmpty", &LuaMap::IsEmpty }, // :IsEmpty() - Returns the true if the map is empty, else false UNDOCUMENTED
|
||||
#ifndef CLASSIC
|
||||
{ "IsHeroic", &LuaMap::IsHeroic }, // :IsHeroic() - Returns the true if the map is a heroic dungeon, else false UNDOCUMENTED
|
||||
#endif
|
||||
{ "IsRaid", &LuaMap::IsRaid }, // :IsRaid() - Returns the true if the map is a raid map, else false UNDOCUMENTED
|
||||
|
||||
{ NULL, NULL },
|
||||
@@ -1128,7 +1162,7 @@ ElunaRegister<AuctionHouseObject> AuctionMethods[] =
|
||||
|
||||
template<typename T> const char* ElunaTemplate<T>::tname = NULL;
|
||||
template<typename T> bool ElunaTemplate<T>::manageMemory = false;
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
// fix compile error about accessing vehicle destructor
|
||||
template<> int ElunaTemplate<Vehicle>::gcT(lua_State* L) { return 0; }
|
||||
#endif
|
||||
@@ -1176,7 +1210,7 @@ void RegisterFunctions(lua_State* L)
|
||||
ElunaTemplate<Item>::SetMethods(L, ObjectMethods);
|
||||
ElunaTemplate<Item>::SetMethods(L, ItemMethods);
|
||||
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
ElunaTemplate<Vehicle>::Register(L, "Vehicle");
|
||||
ElunaTemplate<Vehicle>::SetMethods(L, VehicleMethods);
|
||||
#endif
|
||||
|
||||
10
MapMethods.h
10
MapMethods.h
@@ -10,11 +10,13 @@
|
||||
namespace LuaMap
|
||||
{
|
||||
/* BOOLEAN */
|
||||
#ifndef CLASSIC
|
||||
int IsArena(lua_State* L, Map* map)
|
||||
{
|
||||
sEluna->Push(L, map->IsBattleArena());
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int IsBattleground(lua_State* L, Map* map)
|
||||
{
|
||||
@@ -38,11 +40,13 @@ namespace LuaMap
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int IsHeroic(lua_State* L, Map* map)
|
||||
{
|
||||
sEluna->Push(L, map->IsHeroic());
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int IsRaid(lua_State* L, Map* map)
|
||||
{
|
||||
@@ -61,7 +65,7 @@ namespace LuaMap
|
||||
{
|
||||
float x = sEluna->CHECKVAL<float>(L, 2);
|
||||
float y = sEluna->CHECKVAL<float>(L, 3);
|
||||
#ifdef TBC
|
||||
#if (defined(TBC) || defined(CLASSIC))
|
||||
float z = map->GetHeight(x, y, MAX_HEIGHT);
|
||||
#else
|
||||
uint32 phasemask = sEluna->CHECKVAL<uint32>(L, 4, 1);
|
||||
@@ -75,7 +79,11 @@ namespace LuaMap
|
||||
|
||||
int GetDifficulty(lua_State* L, Map* map)
|
||||
{
|
||||
#ifndef CLASSIC
|
||||
sEluna->Push(L, map->GetDifficulty());
|
||||
#else
|
||||
sEluna->Push(L, (Difficulty)0);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
namespace LuaPlayer
|
||||
{
|
||||
/* BOOLEAN */
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
int CanTitanGrip(lua_State* L, Player* player)
|
||||
{
|
||||
sEluna->Push(L, player->CanTitanGrip());
|
||||
@@ -80,6 +80,7 @@ namespace LuaPlayer
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int HasTitle(lua_State* L, Player* player)
|
||||
{
|
||||
uint32 id = sEluna->CHECKVAL<uint32>(L, 2);
|
||||
@@ -90,6 +91,7 @@ namespace LuaPlayer
|
||||
sEluna->Push(L, false);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int HasItem(lua_State* L, Player* player)
|
||||
{
|
||||
@@ -153,11 +155,13 @@ namespace LuaPlayer
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int CanFly(lua_State* L, Player* player)
|
||||
{
|
||||
sEluna->Push(L, player->CanFly());
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int IsInWater(lua_State* L, Player* player)
|
||||
{
|
||||
@@ -171,11 +175,13 @@ namespace LuaPlayer
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int IsFlying(lua_State* L, Player* player) // enable for unit when mangos support it
|
||||
{
|
||||
sEluna->Push(L, player->IsFlying());
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int IsInGroup(lua_State* L, Player* player)
|
||||
{
|
||||
@@ -199,6 +205,7 @@ namespace LuaPlayer
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int IsInArenaTeam(lua_State* L, Player* player)
|
||||
{
|
||||
uint32 type = sEluna->CHECKVAL<uint32>(L, 2);
|
||||
@@ -208,6 +215,7 @@ namespace LuaPlayer
|
||||
sEluna->Push(L, false);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int IsHorde(lua_State* L, Player* player)
|
||||
{
|
||||
@@ -324,11 +332,13 @@ namespace LuaPlayer
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int InArena(lua_State* L, Player* player)
|
||||
{
|
||||
sEluna->Push(L, player->InArena());
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int InBattleground(lua_State* L, Player* player)
|
||||
{
|
||||
@@ -412,7 +422,7 @@ namespace LuaPlayer
|
||||
}*/
|
||||
|
||||
/* GETTERS */
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
int GetSpecsCount(lua_State* L, Player* player)
|
||||
{
|
||||
sEluna->Push(L, player->GetSpecsCount());
|
||||
@@ -435,6 +445,7 @@ namespace LuaPlayer
|
||||
#endif
|
||||
|
||||
#ifndef CATA
|
||||
#ifndef CLASSIC
|
||||
int GetArenaPoints(lua_State* L, Player* player)
|
||||
{
|
||||
sEluna->Push(L, player->GetArenaPoints());
|
||||
@@ -446,6 +457,7 @@ namespace LuaPlayer
|
||||
sEluna->Push(L, player->GetHonorPoints());
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int GetShieldBlockValue(lua_State* L, Player* player)
|
||||
{
|
||||
@@ -646,6 +658,8 @@ namespace LuaPlayer
|
||||
{
|
||||
#ifdef TBC
|
||||
sEluna->Push(L, player->GetDifficulty());
|
||||
#elif defined(CLASSIC)
|
||||
sEluna->Push(L, (Difficulty)0);
|
||||
#else
|
||||
bool isRaid = sEluna->CHECKVAL<bool>(L, 2, true);
|
||||
sEluna->Push(L, player->GetDifficulty(isRaid));
|
||||
@@ -1031,7 +1045,7 @@ namespace LuaPlayer
|
||||
uint32 points = sEluna->CHECKVAL<uint32>(L, 2);
|
||||
|
||||
player->SetFreeTalentPoints(points);
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
player->SendTalentsInfoData(false);
|
||||
#endif
|
||||
return 0;
|
||||
@@ -1146,6 +1160,7 @@ namespace LuaPlayer
|
||||
}
|
||||
|
||||
#ifndef CATA
|
||||
#ifndef CLASSIC
|
||||
int SetArenaPoints(lua_State* L, Player* player)
|
||||
{
|
||||
uint32 arenaP = sEluna->CHECKVAL<uint32>(L, 2);
|
||||
@@ -1159,6 +1174,7 @@ namespace LuaPlayer
|
||||
player->SetHonorPoints(honorP);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int SetLifetimeKills(lua_State* L, Player* player)
|
||||
@@ -1192,6 +1208,7 @@ namespace LuaPlayer
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int SetKnownTitle(lua_State* L, Player* player)
|
||||
{
|
||||
uint32 id = sEluna->CHECKVAL<uint32>(L, 2);
|
||||
@@ -1200,6 +1217,7 @@ namespace LuaPlayer
|
||||
player->SetTitle(t, false);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MANGOS
|
||||
int SetFFA(lua_State* L, Player* player)
|
||||
@@ -1220,7 +1238,7 @@ namespace LuaPlayer
|
||||
}*/
|
||||
|
||||
/* OTHER */
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
int ResetPetTalents(lua_State* L, Player* player)
|
||||
{
|
||||
#ifdef MANGOS
|
||||
@@ -1259,6 +1277,7 @@ namespace LuaPlayer
|
||||
#endif
|
||||
|
||||
#ifndef CATA
|
||||
#ifndef CLASSIC
|
||||
int ModifyArenaPoints(lua_State* L, Player* player)
|
||||
{
|
||||
int32 amount = sEluna->CHECKVAL<int32>(L, 2);
|
||||
@@ -1274,6 +1293,7 @@ namespace LuaPlayer
|
||||
player->ModifyHonorPoints(amount);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int SaveToDB(lua_State* L, Player* player)
|
||||
@@ -1431,10 +1451,14 @@ namespace LuaPlayer
|
||||
int UnbindInstance(lua_State* L, Player* player)
|
||||
{
|
||||
uint32 map = sEluna->CHECKVAL<uint32>(L, 2);
|
||||
#ifndef CLASSIC
|
||||
uint32 difficulty = sEluna->CHECKVAL<uint32>(L, 3);
|
||||
|
||||
if (difficulty < MAX_DIFFICULTY)
|
||||
player->UnbindInstance(map, (Difficulty)difficulty);
|
||||
#else
|
||||
player->UnbindInstance(map);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1453,7 +1477,11 @@ namespace LuaPlayer
|
||||
float discountMod = sEluna->CHECKVAL<float>(L, 4);
|
||||
bool guildBank = sEluna->CHECKVAL<bool>(L, 5, false);
|
||||
|
||||
#ifdef CLASSIC
|
||||
sEluna->Push(L, player->DurabilityRepair(position, cost, discountMod));
|
||||
#else
|
||||
sEluna->Push(L, player->DurabilityRepair(position, cost, discountMod, guildBank));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1463,7 +1491,11 @@ namespace LuaPlayer
|
||||
float discountMod = sEluna->CHECKVAL<float>(L, 3);
|
||||
bool guildBank = sEluna->CHECKVAL<bool>(L, 4, false);
|
||||
|
||||
#ifdef CLASSIC
|
||||
sEluna->Push(L, player->DurabilityRepairAll(cost, discountMod));
|
||||
#else
|
||||
sEluna->Push(L, player->DurabilityRepairAll(cost, discountMod, guildBank));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1546,7 +1578,7 @@ namespace LuaPlayer
|
||||
#else
|
||||
player->resetTalents(no_cost);
|
||||
#endif
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
player->SendTalentsInfoData(false);
|
||||
#endif
|
||||
return 0;
|
||||
@@ -1685,7 +1717,7 @@ namespace LuaPlayer
|
||||
if (!player->isAlive())
|
||||
return 0;
|
||||
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED))
|
||||
return 0;
|
||||
#endif
|
||||
@@ -1699,6 +1731,7 @@ namespace LuaPlayer
|
||||
if (level >= sWorld->getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
|
||||
return 0;
|
||||
|
||||
#ifndef CLASSIC
|
||||
if (!pureXP)
|
||||
{
|
||||
if (victim)
|
||||
@@ -1718,6 +1751,7 @@ namespace LuaPlayer
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// XP resting bonus for kill
|
||||
uint32 rested_bonus_xp = victim ? player->GetXPRestBonus(xp) : 0;
|
||||
@@ -1836,7 +1870,7 @@ namespace LuaPlayer
|
||||
return 0;
|
||||
}
|
||||
player->ItemAddedQuestCheck(entry, 1);
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, entry, 1);
|
||||
#endif
|
||||
}
|
||||
@@ -1887,6 +1921,7 @@ namespace LuaPlayer
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int UnsetKnownTitle(lua_State* L, Player* player)
|
||||
{
|
||||
uint32 id = sEluna->CHECKVAL<uint32>(L, 2);
|
||||
@@ -1895,6 +1930,7 @@ namespace LuaPlayer
|
||||
player->SetTitle(t, true);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int AdvanceSkillsToMax(lua_State* L, Player* player)
|
||||
{
|
||||
@@ -1911,9 +1947,12 @@ namespace LuaPlayer
|
||||
|
||||
static const uint32 skillsArray[] = { SKILL_BOWS, SKILL_CROSSBOWS, SKILL_DAGGERS, SKILL_DEFENSE, SKILL_UNARMED, SKILL_GUNS, SKILL_AXES, SKILL_MACES, SKILL_SWORDS, SKILL_POLEARMS,
|
||||
SKILL_STAVES, SKILL_2H_AXES, SKILL_2H_MACES, SKILL_2H_SWORDS, SKILL_WANDS, SKILL_SHIELD, SKILL_FISHING, SKILL_MINING, SKILL_ENCHANTING, SKILL_BLACKSMITHING,
|
||||
SKILL_ALCHEMY, SKILL_HERBALISM, SKILL_ENGINEERING, SKILL_JEWELCRAFTING, SKILL_LEATHERWORKING, SKILL_LOCKPICKING, SKILL_SKINNING, SKILL_TAILORING,
|
||||
#ifndef TBC
|
||||
SKILL_INSCRIPTION
|
||||
SKILL_ALCHEMY, SKILL_HERBALISM, SKILL_ENGINEERING, SKILL_LEATHERWORKING, SKILL_LOCKPICKING, SKILL_SKINNING, SKILL_TAILORING,
|
||||
#ifndef CLASSIC
|
||||
SKILL_JEWELCRAFTING,
|
||||
#endif
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
SKILL_INSCRIPTION,
|
||||
#endif
|
||||
};
|
||||
static const uint32 skillsSize = sizeof(skillsArray) / sizeof(*skillsArray);
|
||||
@@ -2122,7 +2161,11 @@ namespace LuaPlayer
|
||||
const char* _promptMsg = sEluna->CHECKVAL<const char*>(L, 7, "");
|
||||
uint32 _money = sEluna->CHECKVAL<uint32>(L, 8, 0);
|
||||
#ifdef MANGOS
|
||||
#ifndef CLASSIC
|
||||
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code);
|
||||
#else
|
||||
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _code);
|
||||
#endif
|
||||
#else
|
||||
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(-1, _icon, msg, _sender, _intid, _promptMsg, _money, _code);
|
||||
#endif
|
||||
|
||||
@@ -21,11 +21,13 @@ namespace LuaQuest
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int IsDaily(lua_State* L, Quest* quest)
|
||||
{
|
||||
sEluna->Push(L, quest->IsDaily());
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int IsRepeatable(lua_State* L, Quest* quest)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ If you need help regarding methods, hooks and other wiki related documentation,
|
||||
|
||||
## Source
|
||||
|
||||
[](https://travis-ci.org/ElunaLuaEngine/Eluna-TC-Wotlk) [Eluna TrinityCore WOTLK](https://github.com/ElunaLuaEngine/Eluna-TC-Wotlk)<br />
|
||||
[](https://travis-ci.org/ElunaLuaEngine/Eluna-TC-Wotlk) [Eluna TrinityCore WotLK](https://github.com/ElunaLuaEngine/Eluna-TC-Wotlk)<br />
|
||||
[](https://travis-ci.org/ElunaLuaEngine/Eluna-TC-Cata) [Eluna TrinityCore Cataclysm](https://github.com/ElunaLuaEngine/Eluna-TC-Cata)
|
||||
|
||||
[](https://travis-ci.org/eluna-dev-mangos/ElunaCoreClassic) [Eluna cMaNGOS Classic](https://github.com/eluna-dev-mangos/ElunaCoreClassic)<br />
|
||||
|
||||
@@ -284,6 +284,7 @@ namespace LuaUnit
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef CLASSIC
|
||||
int IsOnVehicle(lua_State* L, Unit* unit)
|
||||
{
|
||||
#ifdef MANGOS
|
||||
@@ -293,6 +294,7 @@ namespace LuaUnit
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int IsInCombat(lua_State* L, Unit* unit)
|
||||
{
|
||||
@@ -581,7 +583,7 @@ namespace LuaUnit
|
||||
case 4:
|
||||
type = POWER_ENERGY;
|
||||
break;
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
case 6:
|
||||
type = POWER_RUNIC_POWER;
|
||||
break;
|
||||
@@ -620,7 +622,7 @@ namespace LuaUnit
|
||||
case 4:
|
||||
type = POWER_ENERGY;
|
||||
break;
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
case 6:
|
||||
type = POWER_RUNIC_POWER;
|
||||
break;
|
||||
@@ -829,7 +831,7 @@ namespace LuaUnit
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
int GetVehicleKit(lua_State* L, Unit* unit)
|
||||
{
|
||||
#ifdef MANGOS
|
||||
@@ -955,7 +957,7 @@ namespace LuaUnit
|
||||
case POWER_ENERGY:
|
||||
unit->SetPower(POWER_ENERGY, amt);
|
||||
break;
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
case POWER_RUNIC_POWER:
|
||||
unit->SetMaxPower(POWER_RUNIC_POWER, amt);
|
||||
break;
|
||||
@@ -983,7 +985,7 @@ namespace LuaUnit
|
||||
case POWER_ENERGY:
|
||||
unit->SetMaxPower(POWER_ENERGY, amt);
|
||||
break;
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
case POWER_RUNIC_POWER:
|
||||
unit->SetMaxPower(POWER_RUNIC_POWER, amt);
|
||||
break;
|
||||
@@ -1085,7 +1087,7 @@ namespace LuaUnit
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
int SetFFA(lua_State* L, Unit* unit)
|
||||
{
|
||||
bool apply = sEluna->CHECKVAL<bool>(L, 2, true);
|
||||
@@ -1358,7 +1360,7 @@ namespace LuaUnit
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
int MoveJump(lua_State* L, Unit* unit)
|
||||
{
|
||||
float x = sEluna->CHECKVAL<float>(L, 2);
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Please see the included DOCS/LICENSE.md for more information
|
||||
*/
|
||||
|
||||
#ifndef TBC
|
||||
#ifndef VEHICLEMETHODS_H
|
||||
#define VEHICLEMETHODS_H
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
|
||||
namespace LuaVehicle
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace LuaWorldObject
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
int GetPhaseMask(lua_State* L, WorldObject* obj)
|
||||
{
|
||||
sEluna->Push(L, obj->GetPhaseMask());
|
||||
@@ -297,7 +297,7 @@ namespace LuaWorldObject
|
||||
case HIGHGUID_TRANSPORT:
|
||||
case HIGHGUID_MO_TRANSPORT:
|
||||
case HIGHGUID_GAMEOBJECT: sEluna->Push(L, obj->GetMap()->GetGameObject(GUID_TYPE(guid))); break;
|
||||
#ifndef TBC
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
case HIGHGUID_VEHICLE:
|
||||
#endif
|
||||
case HIGHGUID_UNIT:
|
||||
|
||||
Reference in New Issue
Block a user