Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/GlobalMethods.h b/GlobalMethods.h
- index d9e91d6..21e96d2 100644
- --- a/GlobalMethods.h
- +++ b/GlobalMethods.h
- @@ -8,13 +8,65 @@
- #define GLOBALMETHODS_H
- #include "BindingMap.h"
- +#include "Grumboz_VIP_Core.h"
- /***
- * These functions can be used anywhere at any time, including at start-up.
- */
- namespace LuaGlobalFunctions
- {
- - /**
- + // Grumboz VIP Engine player methods
- + int GetVIPMAX(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetVIPMAX());
- + return 1;
- + }
- + int GetVIPVOTE_ENABLE(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetVIPVOTE_ENABLE());
- + return 1;
- + }
- + int GetVIPVOTECOUNT(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetVIPVOTECOUNT());
- + return 1;
- + }
- + int GetVIPCOINID(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetVIPCOINID());
- + return 1;
- + }
- + int GetVIPSTONEID(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetVIPSTONEID());
- + return 1;
- + }
- + int GetVIPMGID(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetVIPMGID());
- + return 1;
- + }
- + int GetVIPOFFSET(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetVIPOFFSET());
- + return 1;
- + }
- + int GetTALENTBONUS(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetTALENTBONUS());
- + return 1;
- + }
- + int GetLEVELBONUS_ENABLE(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetLEVELBONUS_ENABLE());
- + return 1;
- + }
- + int GetLEVELBONUS(Eluna* /*E*/, lua_State* L)
- + {
- + Eluna::Push(L, VIP::GetLEVELBONUS());
- + return 1;
- + }
- + /**
- * Returns Lua engine's name.
- *
- * Always returns "ElunaEngine" on Eluna.
- diff --git a/ItemMethods.h b/ItemMethods.h
- index 14e244e..538dcc8 100644
- --- a/ItemMethods.h
- +++ b/ItemMethods.h
- @@ -7,12 +7,28 @@
- #ifndef ITEMMETHODS_H
- #define ITEMMETHODS_H
- +#include "Grumboz_VIP_Core.h"
- +
- /***
- * Inherits all methods from: [Object]
- */
- namespace LuaItem
- {
- - /**
- + // Grumboz VIP Engine item methods
- + int GetItemVIP(Eluna* /*E*/, lua_State* L, Item* item)
- + {
- + uint32 item_id = item->GetEntry();
- + Eluna::Push(L, VIP::GetItemVIP(item_id));
- + return 1;
- + }
- + int SetItemVIP(Eluna* /*E*/, lua_State* L, Item* item)
- + {
- + uint32 item_id = item->GetEntry();
- + uint8 vip = Eluna::CHECKVAL<uint8>(L, 2);
- + VIP::SetItemVIP(item_id, vip);
- + return 1;
- + }
- + /**
- * Returns 'true' if the [Item] is soulbound, 'false' otherwise
- *
- * @return bool isSoulBound
- diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp
- index a2dc53b..0662733 100644
- --- a/LuaFunctions.cpp
- +++ b/LuaFunctions.cpp
- @@ -24,6 +24,7 @@ extern "C"
- #include "PlayerMethods.h"
- #include "CreatureMethods.h"
- #include "GroupMethods.h"
- +#include "Grumboz_VIP_Core.h"
- #include "GuildMethods.h"
- #include "GameObjectMethods.h"
- #include "ElunaQueryMethods.h"
- @@ -75,7 +76,16 @@ ElunaGlobal::ElunaRegister GlobalMethods[] =
- { "ClearInstanceEvents", &LuaGlobalFunctions::ClearInstanceEvents },
- // Getters
- - { "GetLuaEngine", &LuaGlobalFunctions::GetLuaEngine },
- + // Grumboz VIP Engine global methods
- + { "GetVIPMAX", &LuaGlobalFunctions::GetVIPMAX }, // GetVIPMAX(); returns maximum VIP rank.
- + { "GetVIPVOTECOUNT", &LuaGlobalFunctions::GetVIPVOTECOUNT },// GetVIPVOTECOUNT(); returns how many votes to rank up VIP +1 rank.
- + { "GetVIPCOINID", &LuaGlobalFunctions::GetVIPCOINID }, // GetVIPCOINID(); returns item id.
- + { "GetVIPSTONEID", &LuaGlobalFunctions::GetVIPSTONEID }, // GetVIPSTONEID(); returns item id.
- + { "GetVIPMGID", &LuaGlobalFunctions::GetVIPMGID }, // GetVIPMGID(); returns item id.
- + { "GetVIPOFFSET", &LuaGlobalFunctions::GetVIPOFFSET }, // GetVIPOFFSET(); returns float offset value.
- + { "GetTALENTBONUS", &LuaGlobalFunctions::GetTALENTBONUS }, // GetTALENTBONUS(); returns how many extra tp per VIP rank.
- + { "GetLEVELBONUS", &LuaGlobalFunctions::GetLEVELBONUS }, // GetLEVELBONUS(); returns how many extra levels per VIP rank.
- + { "GetLuaEngine", &LuaGlobalFunctions::GetLuaEngine },
- { "GetCoreName", &LuaGlobalFunctions::GetCoreName },
- { "GetCoreVersion", &LuaGlobalFunctions::GetCoreVersion },
- { "GetCoreExpansion", &LuaGlobalFunctions::GetCoreExpansion },
- @@ -111,7 +121,10 @@ ElunaGlobal::ElunaRegister GlobalMethods[] =
- { "PrintDebug", &LuaGlobalFunctions::PrintDebug },
- // Boolean
- - { "IsInventoryPos", &LuaGlobalFunctions::IsInventoryPos },
- + // Grumboz VIP Engine global methods
- + { "GetVIPVOTE_ENABLE", &LuaGlobalFunctions::GetVIPVOTE_ENABLE }, // GetVIPVOTE_ENABLE(); returns bool value. ?Do Votes increase VIP ranks?
- + { "GetLEVELBONUS_ENABLE", &LuaGlobalFunctions::GetLEVELBONUS_ENABLE }, // GetLEVELBONUS_ENABLE(); returns bool value. do players get extra levels per VIP rank.
- + { "IsInventoryPos", &LuaGlobalFunctions::IsInventoryPos },
- { "IsEquipmentPos", &LuaGlobalFunctions::IsEquipmentPos },
- { "IsBankPos", &LuaGlobalFunctions::IsBankPos },
- { "IsBagPos", &LuaGlobalFunctions::IsBagPos },
- @@ -428,7 +441,11 @@ ElunaRegister<Unit> UnitMethods[] =
- ElunaRegister<Player> PlayerMethods[] =
- {
- // Getters
- - { "GetSelection", &LuaPlayer::GetSelection },
- + // Grumboz VIP Engine player getter methods
- + { "GetPlayerVIP", &LuaPlayer::GetPlayerVIP }, // player:GetPlayerVIP(); returns uint8 value of a players VIP rank.
- + { "GetPlayerMG", &LuaPlayer::GetPlayerMG }, // player:GetPlayerMG(); returns uint32 value of players total mg stored.(NOT IN INVENTORY)
- + { "GetPlayerVOTES", &LuaPlayer::GetPlayerVOTES }, // player:GetPlayerVOTES(); returns uint32 value of players total voting count.
- + { "GetSelection", &LuaPlayer::GetSelection },
- { "GetGMRank", &LuaPlayer::GetGMRank },
- { "GetGuildId", &LuaPlayer::GetGuildId },
- { "GetCoinage", &LuaPlayer::GetCoinage },
- @@ -512,7 +529,11 @@ ElunaRegister<Player> PlayerMethods[] =
- #endif
- // Setters
- - { "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax },
- + // Grumboz VIP Engine player setter methods
- + { "SetPlayerVIP", &LuaPlayer::SetPlayerVIP },
- + { "SetPlayerMG", &LuaPlayer::SetPlayerMG },
- + { "SetPlayerVOTES", &LuaPlayer::SetPlayerVOTES },
- + { "AdvanceSkillsToMax", &LuaPlayer::AdvanceSkillsToMax },
- { "AdvanceSkill", &LuaPlayer::AdvanceSkill },
- { "AdvanceAllSkills", &LuaPlayer::AdvanceAllSkills },
- { "AddLifetimeKills", &LuaPlayer::AddLifetimeKills },
- @@ -750,7 +771,10 @@ ElunaRegister<Player> PlayerMethods[] =
- ElunaRegister<Creature> CreatureMethods[] =
- {
- // Getters
- - { "GetAITarget", &LuaCreature::GetAITarget },
- + // Grumboz VIP Engine creature getter methods
- + { "GetCreatureVIP", &LuaCreature::GetCreatureVIP }, // creature:GetCreatureVIP(uint32 creature_id); returns uint8 value of a creatures VIP rank.
- + { "GetCreatureMG", &LuaCreature::GetCreatureMG }, // creature:GetCreatureMG(uint32 creature_id); returns uint32 value of creature mg .
- + { "GetAITarget", &LuaCreature::GetAITarget },
- { "GetAITargets", &LuaCreature::GetAITargets },
- { "GetAITargetsCount", &LuaCreature::GetAITargetsCount },
- { "GetHomePosition", &LuaCreature::GetHomePosition },
- @@ -778,7 +802,10 @@ ElunaRegister<Creature> CreatureMethods[] =
- { "GetDBTableGUIDLow", &LuaCreature::GetDBTableGUIDLow },
- // Setters
- - { "SetHover", &LuaCreature::SetHover },
- + // Grumboz VIP Engine creature setter methods
- + { "SetCreatureVIP", &LuaCreature::SetCreatureVIP }, // creature:SetCreatureVIP(uint32 creature_id); sets uint8 value of a creatures VIP rank.
- + { "SetCreatureMG", &LuaCreature::SetCreatureMG }, // creature:SetCreatureMG(uint32 creature_id); sets uint32 value of creature mg .
- + { "SetHover", &LuaCreature::SetHover },
- { "SetDisableGravity", &LuaCreature::SetDisableGravity },
- { "SetAggroEnabled", &LuaCreature::SetAggroEnabled },
- { "SetNoCallAssistance", &LuaCreature::SetNoCallAssistance },
- @@ -887,7 +914,9 @@ ElunaRegister<GameObject> GameObjectMethods[] =
- ElunaRegister<Item> ItemMethods[] =
- {
- // Getters
- - { "GetOwnerGUID", &LuaItem::GetOwnerGUID },
- + // Grumboz VIP Engine item getter methods
- + { "GetItemVIP", &LuaItem::GetItemVIP },
- + { "GetOwnerGUID", &LuaItem::GetOwnerGUID },
- { "GetOwner", &LuaItem::GetOwner },
- { "GetCount", &LuaItem::GetCount },
- { "GetMaxStackCount", &LuaItem::GetMaxStackCount },
- @@ -921,7 +950,9 @@ ElunaRegister<Item> ItemMethods[] =
- { "GetBagSize", &LuaItem::GetBagSize },
- // Setters
- - { "SetOwner", &LuaItem::SetOwner },
- + // Grumboz VIP Engine item Setter methods
- + { "SetItemVIP", &LuaItem::SetItemVIP },
- + { "SetOwner", &LuaItem::SetOwner },
- { "SetBinding", &LuaItem::SetBinding },
- { "SetCount", &LuaItem::SetCount },
- diff --git a/PlayerMethods.h b/PlayerMethods.h
- index 8e0d9ae..66fd665 100644
- --- a/PlayerMethods.h
- +++ b/PlayerMethods.h
- @@ -7,13 +7,55 @@
- #ifndef PLAYERMETHODS_H
- #define PLAYERMETHODS_H
- +#include "Grumboz_VIP_Core.h"
- +
- /***
- * Inherits all methods from: [Object], [WorldObject], [Unit]
- */
- namespace LuaPlayer
- {
- + // Grumboz VIP Engine player methods
- + int GetPlayerVIP(Eluna* /*E*/, lua_State* L, Player* player)
- + {
- + uint32 acctId = player->GetSession()->GetAccountId();
- + Eluna::Push(L, VIP::GetPlayerVIP(acctId));
- + return 1;
- + }
- + int GetPlayerMG(Eluna* /*E*/, lua_State* L, Player* player)
- + {
- + uint32 acctId = player->GetSession()->GetAccountId();
- + Eluna::Push(L, VIP::GetPlayerMG(acctId));
- + return 1;
- + }
- + int GetPlayerVOTES(Eluna* /*E*/, lua_State* L, Player* player)
- + {
- + uint32 acctId = player->GetSession()->GetAccountId();
- + Eluna::Push(L, VIP::GetPlayerVOTES(acctId));
- + return 1;
- + }
- + int SetPlayerVIP(Eluna* /*E*/, lua_State* L, Player* player)
- + {
- + uint32 acctId = player->GetSession()->GetAccountId();
- + uint8 vip = Eluna::CHECKVAL<uint8>(L, 2);
- + VIP::SetPlayerVIP(acctId, vip);
- + return 0;
- + }
- + int SetPlayerMG(Eluna* /*E*/, lua_State* L, Player* player)
- + {
- + uint32 acctId = player->GetSession()->GetAccountId();
- + uint32 mg = Eluna::CHECKVAL<uint32>(L, 2);
- + VIP::SetPlayerMG(acctId, mg);
- + return 0;
- + }
- + int SetPlayerVOTES(Eluna* /*E*/, lua_State* L, Player* player)
- + {
- + uint32 acctId = player->GetSession()->GetAccountId();
- + uint32 votes = Eluna::CHECKVAL<uint32>(L, 2);
- + VIP::SetPlayerVOTES(acctId, votes);
- + return 0;
- + }
- #if (!defined(TBC) && !defined(CLASSIC))
- - /**
- + /**
- * Returns 'true' if the [Player] can Titan Grip, 'false' otherwise.
- *
- * @return bool canTitanGrip
- diff --git a/CreatureMethods.h b/CreatureMethods.h
- index d3bf10a..8684ad6 100644
- --- a/CreatureMethods.h
- +++ b/CreatureMethods.h
- @@ -7,6 +7,8 @@
- #ifndef CREATUREMETHODS_H
- #define CREATUREMETHODS_H
- +#include "Grumboz_VIP_Core.h"
- +
- /***
- * Non-[Player] controlled [Unit]s (i.e. NPCs).
- *
- @@ -14,7 +16,38 @@
- */
- namespace LuaCreature
- {
- - /**
- + // Grumboz VIP Engine creature methods
- + int GetCreatureVIP(Eluna* /*E*/, lua_State* L, Creature* creature)
- + {
- + uint32 creature_id = creature->GetEntry();
- +
- + Eluna::Push(L, VIP::GetCreatureVIP(creature_id));
- + return 1;
- + }
- + int GetCreatureMG(Eluna* /*E*/, lua_State* L, Creature* creature)
- + {
- + uint32 creature_id = creature->GetEntry();
- +
- + Eluna::Push(L, VIP::GetCreatureMG(creature_id));
- + return 1;
- + }
- + int SetCreatureVIP(Eluna* /*E*/, lua_State* L, Creature* creature)
- + {
- + uint32 creature_id = creature->GetEntry();
- + uint8 vip = Eluna::CHECKVAL<uint8>(L, 2);
- +
- + VIP::SetCreatureVIP(creature_id, vip);
- + return 0;
- + }
- + int SetCreatureMG(Eluna* /*E*/, lua_State* L, Creature* creature)
- + {
- + uint32 creature_id = creature->GetEntry();
- + uint32 mg = Eluna::CHECKVAL<uint32>(L, 2);
- +
- + VIP::SetCreatureMG(creature_id, mg);
- + return 0;
- + }
- + /**
- * Returns `true` if the [Creature] is set to not give reputation when killed,
- * and returns `false` otherwise.
- *
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement