Skip to content

Commit

Permalink
Part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Jul 30, 2023
1 parent 6457813 commit 022c169
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 394 deletions.
40 changes: 0 additions & 40 deletions CMangos/GameObjectMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ namespace LuaGameObject
{
uint32 questId = Eluna::CHECKVAL<uint32>(L, 2);

#if defined TRINITY || AZEROTHCORE
Eluna::Push(L, go->hasQuest(questId));
#else
Eluna::Push(L, go->HasQuest(questId));
#endif
return 1;
}

Expand All @@ -37,11 +33,7 @@ namespace LuaGameObject
*/
int IsSpawned(lua_State* L, GameObject* go)
{
#ifdef CMANGOS
Eluna::Push(L, go->IsSpawned());
#else
Eluna::Push(L, go->isSpawned());
#endif
return 1;
}

Expand All @@ -67,12 +59,6 @@ namespace LuaGameObject
return 1;
}

/*int IsDestructible(lua_State* L, GameObject* go) // TODO: Implementation core side
{
Eluna::Push(L, go->IsDestructibleBuilding());
return 1;
}*/

/**
* Returns display ID of the [GameObject]
*
Expand Down Expand Up @@ -123,11 +109,7 @@ namespace LuaGameObject
*/
int GetLootState(lua_State* L, GameObject* go)
{
#ifdef CMANGOS
Eluna::Push(L, go->GetLootState());
#else
Eluna::Push(L, go->getLootState());
#endif
return 1;
}

Expand All @@ -153,11 +135,7 @@ namespace LuaGameObject
*/
int GetLootRecipientGroup(lua_State* L, GameObject* go)
{
#if defined TRINITY || AZEROTHCORE
Eluna::Push(L, go->GetLootRecipientGroup());
#else
Eluna::Push(L, go->GetGroupLootRecipient());
#endif
return 1;
}

Expand All @@ -168,12 +146,8 @@ namespace LuaGameObject
*/
int GetDBTableGUIDLow(lua_State* L, GameObject* go)
{
#if defined(TRINITY) || defined(AZEROTHCORE)
Eluna::Push(L, go->GetSpawnId());
#else
// on mangos based this is same as lowguid
Eluna::Push(L, go->GetGUIDLow());
#endif
return 1;
}

Expand All @@ -200,13 +174,7 @@ namespace LuaGameObject
else if (state == 1)
go->SetGoState(GO_STATE_READY);
else if (state == 2)
{
#ifdef TRINITY
go->SetGoState(GO_STATE_DESTROYED);
#else
go->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
#endif
}

return 0;
}
Expand Down Expand Up @@ -265,11 +233,7 @@ namespace LuaGameObject
bool deldb = Eluna::CHECKVAL<bool>(L, 2, false);

// cs_gobject.cpp copy paste
#if defined TRINITY || AZEROTHCORE
ObjectGuid ownerGuid = go->GetOwnerGUID();
#else
ObjectGuid ownerGuid = go->GetOwnerGuid();
#endif
if (ownerGuid)
{
Unit* owner = eObjectAccessor()GetUnit(*go, ownerGuid);
Expand All @@ -281,11 +245,7 @@ namespace LuaGameObject

if (deldb)
{
#ifdef TRINITY
GameObject::DeleteFromDB(go->GetSpawnId());
#else
go->DeleteFromDB();
#endif
}

go->SetRespawnTime(0);
Expand Down
Loading

0 comments on commit 022c169

Please sign in to comment.