Change Eluna to a global variable
Remove Eluna* from being passed. You can now get it through Eluna::GetEluna(L) Change function call cleanup to lua_settop instead of manual loop Explicitly delete the copy constructor and copy assignment operators
This commit is contained in:
@@ -20,7 +20,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool reputationDisabled
|
||||
*/
|
||||
int IsReputationGainDisabled(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsReputationGainDisabled(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->IsReputationGainDisabled());
|
||||
return 1;
|
||||
@@ -32,7 +32,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool regeneratesHealth
|
||||
*/
|
||||
int CanRegenerateHealth(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int CanRegenerateHealth(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifndef TRINITY
|
||||
Eluna::Push(L, creature->IsRegeneratingHealth());
|
||||
@@ -49,7 +49,7 @@ namespace LuaCreature
|
||||
* @param uint32 questID : the ID of a [Quest]
|
||||
* @return bool completesQuest
|
||||
*/
|
||||
int CanCompleteQuest(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int CanCompleteQuest(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 quest_id = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace LuaCreature
|
||||
* @param bool mustBeDead = false : if `true`, only returns `true` if the [Creature] is also dead. Otherwise, it must be alive.
|
||||
* @return bool targetable
|
||||
*/
|
||||
int IsTargetableForAttack(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsTargetableForAttack(lua_State* L, Creature* creature)
|
||||
{
|
||||
bool mustBeDead = Eluna::CHECKVAL<bool>(L, 2, false);
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace LuaCreature
|
||||
* @param bool checkFaction = true : if `true`, the [Creature] must be the same faction as `friend` to assist
|
||||
* @return bool canAssist
|
||||
*/
|
||||
int CanAssistTo(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int CanAssistTo(lua_State* L, Creature* creature)
|
||||
{
|
||||
Unit* u = Eluna::CHECKOBJ<Unit>(L, 2);
|
||||
Unit* enemy = Eluna::CHECKOBJ<Unit>(L, 3);
|
||||
@@ -105,7 +105,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool searchedForAssistance
|
||||
*/
|
||||
int HasSearchedAssistance(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int HasSearchedAssistance(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->HasSearchedAssistance());
|
||||
return 1;
|
||||
@@ -117,7 +117,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool tapped
|
||||
*/
|
||||
int IsTappedBy(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsTappedBy(lua_State* L, Creature* creature)
|
||||
{
|
||||
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool hasLootRecipient
|
||||
*/
|
||||
int HasLootRecipient(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int HasLootRecipient(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifndef TRINITY
|
||||
Eluna::Push(L, creature->HasLootRecipient());
|
||||
@@ -151,7 +151,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool canAggro
|
||||
*/
|
||||
int CanAggro(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int CanAggro(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifdef TRINITY
|
||||
Eluna::Push(L, !creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC));
|
||||
@@ -168,7 +168,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool canSwim
|
||||
*/
|
||||
int CanSwim(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int CanSwim(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->CanSwim());
|
||||
return 1;
|
||||
@@ -180,7 +180,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool canWalk
|
||||
*/
|
||||
int CanWalk(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int CanWalk(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->CanWalk());
|
||||
return 1;
|
||||
@@ -192,7 +192,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool inEvadeMode
|
||||
*/
|
||||
int IsInEvadeMode(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsInEvadeMode(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->IsInEvadeMode());
|
||||
return 1;
|
||||
@@ -204,7 +204,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool isElite
|
||||
*/
|
||||
int IsElite(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsElite(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifndef TRINITY
|
||||
Eluna::Push(L, creature->IsElite());
|
||||
@@ -220,7 +220,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool isGuard
|
||||
*/
|
||||
int IsGuard(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsGuard(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->IsGuard());
|
||||
return 1;
|
||||
@@ -232,7 +232,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool isCivilian
|
||||
*/
|
||||
int IsCivilian(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsCivilian(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->IsCivilian());
|
||||
return 1;
|
||||
@@ -244,7 +244,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool isLeader
|
||||
*/
|
||||
int IsRacialLeader(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsRacialLeader(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->IsRacialLeader());
|
||||
return 1;
|
||||
@@ -256,7 +256,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool isWorldBoss
|
||||
*/
|
||||
int IsWorldBoss(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsWorldBoss(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifndef TRINITY
|
||||
Eluna::Push(L, creature->IsWorldBoss());
|
||||
@@ -273,7 +273,7 @@ namespace LuaCreature
|
||||
* @param uint32 spellId : the ID of a [Spell]
|
||||
* @return bool hasCooldown
|
||||
*/
|
||||
int HasCategoryCooldown(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int HasCategoryCooldown(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 spell = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace LuaCreature
|
||||
* @param uint32 spellId : the ID of a [Spell]
|
||||
* @return bool hasSpell
|
||||
*/
|
||||
int HasSpell(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int HasSpell(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 id = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace LuaCreature
|
||||
* @param uint32 questId : the ID of a [Quest]
|
||||
* @return bool hasQuest
|
||||
*/
|
||||
int HasQuest(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int HasQuest(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 questId = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
@@ -329,7 +329,7 @@ namespace LuaCreature
|
||||
* @param uint32 spellId : the ID of a [Spell]
|
||||
* @return bool hasCooldown
|
||||
*/
|
||||
int HasSpellCooldown(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int HasSpellCooldown(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 spellId = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool canFly
|
||||
*/
|
||||
int CanFly(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int CanFly(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->CanFly());
|
||||
return 1;
|
||||
@@ -360,7 +360,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool canFly
|
||||
*/
|
||||
int IsTrigger(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsTrigger(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->IsTrigger());
|
||||
return 1;
|
||||
@@ -371,7 +371,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return bool isDamagedEnough
|
||||
*/
|
||||
int IsDamageEnoughForLootingAndReward(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int IsDamageEnoughForLootingAndReward(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->IsDamageEnoughForLootingAndReward());
|
||||
return 1;
|
||||
@@ -385,7 +385,7 @@ namespace LuaCreature
|
||||
* @param [Unit] target
|
||||
* @param bool force = true : force [Creature] to attack
|
||||
*/
|
||||
int CanStartAttack(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement core side
|
||||
int CanStartAttack(lua_State* L, Creature* creature) // TODO: Implement core side
|
||||
{
|
||||
Unit* target = Eluna::CHECKOBJ<Unit>(L, 2);
|
||||
bool force = Eluna::CHECKVAL<bool>(L, 3, true);
|
||||
@@ -400,7 +400,7 @@ namespace LuaCreature
|
||||
* @param uint16 lootMode
|
||||
* @return bool hasLootMode
|
||||
*/
|
||||
int HasLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
int HasLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
{
|
||||
uint16 lootMode = Eluna::CHECKVAL<uint16>(L, 2);
|
||||
|
||||
@@ -417,7 +417,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return uint32 respawnDelay : the respawn delay, in seconds
|
||||
*/
|
||||
int GetRespawnDelay(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetRespawnDelay(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetRespawnDelay());
|
||||
return 1;
|
||||
@@ -429,7 +429,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return float wanderRadius
|
||||
*/
|
||||
int GetWanderRadius(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetWanderRadius(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetRespawnRadius());
|
||||
return 1;
|
||||
@@ -441,7 +441,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return uint32 pathId
|
||||
*/
|
||||
int GetWaypointPath(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetWaypointPath(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetWaypointPath());
|
||||
return 1;
|
||||
@@ -453,7 +453,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return uint32 wpId
|
||||
*/
|
||||
int GetCurrentWaypointId(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetCurrentWaypointId(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifdef TRINITY
|
||||
Eluna::Push(L, creature->GetCurrentWaypointID());
|
||||
@@ -468,7 +468,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return [MovementGeneratorType] defaultMovementType
|
||||
*/
|
||||
int GetDefaultMovementType(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetDefaultMovementType(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetDefaultMovementType());
|
||||
return 1;
|
||||
@@ -480,7 +480,7 @@ namespace LuaCreature
|
||||
* @param [Unit] target
|
||||
* @return float aggroRange
|
||||
*/
|
||||
int GetAggroRange(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetAggroRange(lua_State* L, Creature* creature)
|
||||
{
|
||||
Unit* target = Eluna::CHECKOBJ<Unit>(L, 2);
|
||||
|
||||
@@ -503,7 +503,7 @@ namespace LuaCreature
|
||||
* @param [Unit] target
|
||||
* @return float attackDistance
|
||||
*/
|
||||
int GetAttackDistance(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetAttackDistance(lua_State* L, Creature* creature)
|
||||
{
|
||||
Unit* target = Eluna::CHECKOBJ<Unit>(L, 2);
|
||||
|
||||
@@ -516,7 +516,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return [Group] lootRecipientGroup : the group or `nil`
|
||||
*/
|
||||
int GetLootRecipientGroup(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetLootRecipientGroup(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifndef TRINITY
|
||||
Eluna::Push(L, creature->GetGroupLootRecipient());
|
||||
@@ -531,7 +531,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return [Player] lootRecipient : the player or `nil`
|
||||
*/
|
||||
int GetLootRecipient(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetLootRecipient(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetLootRecipient());
|
||||
return 1;
|
||||
@@ -546,7 +546,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return string scriptName
|
||||
*/
|
||||
int GetScriptName(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetScriptName(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetScriptName());
|
||||
return 1;
|
||||
@@ -561,7 +561,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return string AIName
|
||||
*/
|
||||
int GetAIName(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetAIName(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetAIName());
|
||||
return 1;
|
||||
@@ -575,7 +575,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return uint32 scriptID
|
||||
*/
|
||||
int GetScriptId(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetScriptId(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetScriptId());
|
||||
return 1;
|
||||
@@ -587,7 +587,7 @@ namespace LuaCreature
|
||||
* @param uint32 spellID
|
||||
* @return uint32 cooldown : the cooldown, in milliseconds
|
||||
*/
|
||||
int GetCreatureSpellCooldownDelay(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetCreatureSpellCooldownDelay(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 spell = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
@@ -607,7 +607,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return uint32 corpseDelay : the delay, in seconds
|
||||
*/
|
||||
int GetCorpseDelay(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetCorpseDelay(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetCorpseDelay());
|
||||
return 1;
|
||||
@@ -622,7 +622,7 @@ namespace LuaCreature
|
||||
* @return float z
|
||||
* @return float o
|
||||
*/
|
||||
int GetHomePosition(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetHomePosition(lua_State* L, Creature* creature)
|
||||
{
|
||||
float x, y, z, o;
|
||||
#ifndef TRINITY
|
||||
@@ -647,7 +647,7 @@ namespace LuaCreature
|
||||
* @param float z
|
||||
* @param float o
|
||||
*/
|
||||
int SetHomePosition(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetHomePosition(lua_State* L, Creature* creature)
|
||||
{
|
||||
float x = Eluna::CHECKVAL<float>(L, 2);
|
||||
float y = Eluna::CHECKVAL<float>(L, 3);
|
||||
@@ -689,7 +689,7 @@ namespace LuaCreature
|
||||
* @param int32 aura = 0 : if positive, the target must have this [Aura]. If negative, the the target must not have this Aura
|
||||
* @return [Unit] target : the target, or `nil`
|
||||
*/
|
||||
int GetAITarget(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetAITarget(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 targetType = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
bool playerOnly = Eluna::CHECKVAL<bool>(L, 3, false);
|
||||
@@ -777,7 +777,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return table targets
|
||||
*/
|
||||
int GetAITargets(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetAITargets(lua_State* L, Creature* creature)
|
||||
{
|
||||
lua_newtable(L);
|
||||
int tbl = lua_gettop(L);
|
||||
@@ -810,7 +810,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return int targetsCount
|
||||
*/
|
||||
int GetAITargetsCount(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetAITargetsCount(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifdef MANGOS
|
||||
Eluna::Push(L, creature->GetThreatManager().getThreatList().size());
|
||||
@@ -828,7 +828,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return [NPCFlags] npcFlags
|
||||
*/
|
||||
int GetNPCFlags(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetNPCFlags(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetUInt32Value(UNIT_NPC_FLAGS));
|
||||
return 1;
|
||||
@@ -840,7 +840,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return uint32 shieldBlockValue
|
||||
*/
|
||||
int GetShieldBlockValue(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetShieldBlockValue(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetShieldBlockValue());
|
||||
return 1;
|
||||
@@ -848,7 +848,7 @@ namespace LuaCreature
|
||||
#endif
|
||||
|
||||
#ifdef TRINITY
|
||||
int GetLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
int GetLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
{
|
||||
Eluna::Push(L, creature->GetLootMode());
|
||||
return 1;
|
||||
@@ -860,7 +860,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @return uint32 dbguid
|
||||
*/
|
||||
int GetDBTableGUIDLow(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int GetDBTableGUIDLow(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifdef TRINITY
|
||||
Eluna::Push(L, creature->GetSpawnId());
|
||||
@@ -876,7 +876,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param [NPCFlags] flags
|
||||
*/
|
||||
int SetNPCFlags(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetNPCFlags(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 flags = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
@@ -890,7 +890,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param bool enable = true
|
||||
*/
|
||||
int SetDisableGravity(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetDisableGravity(lua_State* L, Creature* creature)
|
||||
{
|
||||
bool enable = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
|
||||
@@ -903,7 +903,7 @@ namespace LuaCreature
|
||||
}
|
||||
|
||||
#ifdef TRINITY
|
||||
int SetLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
int SetLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
{
|
||||
uint16 lootMode = Eluna::CHECKVAL<uint16>(L, 2);
|
||||
|
||||
@@ -917,7 +917,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param [DeathState] deathState
|
||||
*/
|
||||
int SetDeathState(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetDeathState(lua_State* L, Creature* creature)
|
||||
{
|
||||
int32 state = Eluna::CHECKVAL<int32>(L, 2);
|
||||
|
||||
@@ -934,7 +934,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param bool enable = true : `true` to enable walking, `false` for running
|
||||
*/
|
||||
int SetWalk(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Move same to Player ?
|
||||
int SetWalk(lua_State* L, Creature* creature) // TODO: Move same to Player ?
|
||||
{
|
||||
bool enable = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
|
||||
@@ -949,7 +949,7 @@ namespace LuaCreature
|
||||
* @param uint32 off_hand : off hand [Item]'s entry
|
||||
* @param uint32 ranged : ranged [Item]'s entry
|
||||
*/
|
||||
int SetEquipmentSlots(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetEquipmentSlots(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 main_hand = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
uint32 off_hand = Eluna::CHECKVAL<uint32>(L, 3);
|
||||
@@ -972,7 +972,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param bool allow = true : `true` to allow aggro, `false` to disable aggro
|
||||
*/
|
||||
int SetAggroEnabled(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetAggroEnabled(lua_State* L, Creature* creature)
|
||||
{
|
||||
bool allow = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
|
||||
@@ -996,7 +996,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param bool disable = true : `true` to disable reputation, `false` to enable
|
||||
*/
|
||||
int SetDisableReputationGain(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetDisableReputationGain(lua_State* L, Creature* creature)
|
||||
{
|
||||
bool disable = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
|
||||
@@ -1010,7 +1010,7 @@ namespace LuaCreature
|
||||
* This is used by raid bosses to prevent Players from using out-of-combat
|
||||
* actions once the encounter has begun.
|
||||
*/
|
||||
int SetInCombatWithZone(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
|
||||
int SetInCombatWithZone(lua_State* /*L*/, Creature* creature)
|
||||
{
|
||||
creature->SetInCombatWithZone();
|
||||
return 0;
|
||||
@@ -1021,7 +1021,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param float distance
|
||||
*/
|
||||
int SetWanderRadius(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetWanderRadius(lua_State* L, Creature* creature)
|
||||
{
|
||||
float dist = Eluna::CHECKVAL<float>(L, 2);
|
||||
|
||||
@@ -1034,7 +1034,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param uint32 delay : the delay, in seconds
|
||||
*/
|
||||
int SetRespawnDelay(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetRespawnDelay(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 delay = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
|
||||
@@ -1047,7 +1047,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param [MovementGeneratorType] type
|
||||
*/
|
||||
int SetDefaultMovementType(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetDefaultMovementType(lua_State* L, Creature* creature)
|
||||
{
|
||||
int32 type = Eluna::CHECKVAL<int32>(L, 2);
|
||||
|
||||
@@ -1060,7 +1060,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param bool enable = true : `true` to disable searching, `false` to allow
|
||||
*/
|
||||
int SetNoSearchAssistance(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetNoSearchAssistance(lua_State* L, Creature* creature)
|
||||
{
|
||||
bool val = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
|
||||
@@ -1073,7 +1073,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param bool enable = true : `true` to disable calling for help, `false` to enable
|
||||
*/
|
||||
int SetNoCallAssistance(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetNoCallAssistance(lua_State* L, Creature* creature)
|
||||
{
|
||||
bool val = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
|
||||
@@ -1086,7 +1086,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param bool enable = true : `true` to enable hovering, `false` to disable
|
||||
*/
|
||||
int SetHover(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SetHover(lua_State* L, Creature* creature)
|
||||
{
|
||||
bool enable = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
|
||||
@@ -1116,7 +1116,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param uint32 delay = 0 : dely to despawn in milliseconds
|
||||
*/
|
||||
int DespawnOrUnsummon(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int DespawnOrUnsummon(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 msTimeToDespawn = Eluna::CHECKVAL<uint32>(L, 2, 0);
|
||||
|
||||
@@ -1131,7 +1131,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Respawn this [Creature].
|
||||
*/
|
||||
int Respawn(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
|
||||
int Respawn(lua_State* /*L*/, Creature* creature)
|
||||
{
|
||||
creature->Respawn();
|
||||
return 0;
|
||||
@@ -1140,7 +1140,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Remove this [Creature]'s corpse.
|
||||
*/
|
||||
int RemoveCorpse(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
|
||||
int RemoveCorpse(lua_State* /*L*/, Creature* creature)
|
||||
{
|
||||
creature->RemoveCorpse();
|
||||
return 0;
|
||||
@@ -1149,7 +1149,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Make the [Creature] start following its waypoint path.
|
||||
*/
|
||||
int MoveWaypoint(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
|
||||
int MoveWaypoint(lua_State* /*L*/, Creature* creature)
|
||||
{
|
||||
#ifndef TRINITY
|
||||
creature->GetMotionMaster()->MoveWaypoint();
|
||||
@@ -1162,7 +1162,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Make the [Creature] call for assistance in combat from other nearby [Creature]s.
|
||||
*/
|
||||
int CallAssistance(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
|
||||
int CallAssistance(lua_State* /*L*/, Creature* creature)
|
||||
{
|
||||
creature->CallAssistance();
|
||||
return 0;
|
||||
@@ -1173,7 +1173,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param float radius
|
||||
*/
|
||||
int CallForHelp(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int CallForHelp(lua_State* L, Creature* creature)
|
||||
{
|
||||
float radius = Eluna::CHECKVAL<float>(L, 2);
|
||||
|
||||
@@ -1184,7 +1184,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Make the [Creature] flee combat to get assistance from a nearby friendly [Creature].
|
||||
*/
|
||||
int FleeToGetAssistance(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
|
||||
int FleeToGetAssistance(lua_State* /*L*/, Creature* creature)
|
||||
{
|
||||
creature->DoFleeToGetAssistance();
|
||||
return 0;
|
||||
@@ -1195,7 +1195,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param [Unit] target
|
||||
*/
|
||||
int AttackStart(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int AttackStart(lua_State* L, Creature* creature)
|
||||
{
|
||||
Unit* target = Eluna::CHECKOBJ<Unit>(L, 2);
|
||||
|
||||
@@ -1206,7 +1206,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Save the [Creature] in the database.
|
||||
*/
|
||||
int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, Creature* creature)
|
||||
int SaveToDB(lua_State* /*L*/, Creature* creature)
|
||||
{
|
||||
creature->SaveToDB();
|
||||
return 0;
|
||||
@@ -1217,7 +1217,7 @@ namespace LuaCreature
|
||||
*
|
||||
* This should be called every update cycle for the Creature's AI.
|
||||
*/
|
||||
int SelectVictim(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int SelectVictim(lua_State* L, Creature* creature)
|
||||
{
|
||||
#ifndef TRINITY
|
||||
Eluna::Push(L, creature->SelectHostileTarget());
|
||||
@@ -1233,7 +1233,7 @@ namespace LuaCreature
|
||||
* @param uint32 entry : the Creature ID to transform into
|
||||
* @param uint32 dataGUIDLow = 0 : use this Creature's model and equipment instead of the defaults
|
||||
*/
|
||||
int UpdateEntry(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
int UpdateEntry(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 entry = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
uint32 dataGuidLow = Eluna::CHECKVAL<uint32>(L, 3, 0);
|
||||
@@ -1250,7 +1250,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Resets [Creature]'s loot mode to default
|
||||
*/
|
||||
int ResetLootMode(Eluna* /*E*/, lua_State* /*L*/, Creature* creature) // TODO: Implement LootMode features
|
||||
int ResetLootMode(lua_State* /*L*/, Creature* creature) // TODO: Implement LootMode features
|
||||
{
|
||||
creature->ResetLootMode();
|
||||
return 0;
|
||||
@@ -1261,7 +1261,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param uint16 lootMode
|
||||
*/
|
||||
int RemoveLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
int RemoveLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
{
|
||||
uint16 lootMode = Eluna::CHECKVAL<uint16>(L, 2);
|
||||
|
||||
@@ -1274,7 +1274,7 @@ namespace LuaCreature
|
||||
*
|
||||
* @param uint16 lootMode
|
||||
*/
|
||||
int AddLootMode(Eluna* /*E*/, lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
int AddLootMode(lua_State* L, Creature* creature) // TODO: Implement LootMode features
|
||||
{
|
||||
uint16 lootMode = Eluna::CHECKVAL<uint16>(L, 2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user