diff --git a/CorpseMethods.h b/CorpseMethods.h index 8bae71a..885fc18 100644 --- a/CorpseMethods.h +++ b/CorpseMethods.h @@ -77,19 +77,5 @@ namespace LuaCorpse corpse->SaveToDB(); return 0; } - - /** - * Deletes the [Corpse] from the world. - * - * If the [Corpse]'s type is not BONES then this does nothing. - */ - int DeleteBonesFromWorld(Eluna* /*E*/, lua_State* /*L*/, Corpse* corpse) - { - // Prevent a failed assertion. - if (corpse->GetType() != CORPSE_BONES) - return 0; - corpse->DeleteBonesFromWorld(); - return 0; - } }; #endif diff --git a/CreatureMethods.h b/CreatureMethods.h index 2989784..0f99a21 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -592,7 +592,10 @@ namespace LuaCreature uint32 spell = Eluna::CHECKVAL(L, 2); #ifdef TRINITY - Eluna::Push(L, creature->GetSpellHistory()->GetRemainingCooldown(spell)); + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell)) + Eluna::Push(L, creature->GetSpellHistory()->GetRemainingCooldown(spellInfo)); + else + Eluna::Push(L, 0); #else Eluna::Push(L, creature->GetCreatureSpellCooldownDelay(spell)); #endif diff --git a/ElunaUtility.h b/ElunaUtility.h index 54002ea..2c33a0c 100644 --- a/ElunaUtility.h +++ b/ElunaUtility.h @@ -41,6 +41,20 @@ typedef QueryResult ElunaQuery; #define ELUNA_LOG_ERROR(...) TC_LOG_ERROR("eluna", __VA_ARGS__); #define ELUNA_LOG_DEBUG(...) TC_LOG_DEBUG("eluna", __VA_ARGS__); #define GET_GUID GetGUID + +#define HIGHGUID_PLAYER HighGuid::Player +#define HIGHGUID_UNIT HighGuid::Unit +#define HIGHGUID_ITEM HighGuid::Item +#define HIGHGUID_GAMEOBJECT HighGuid::GameObject +#define HIGHGUID_PET HighGuid::Pet +#define HIGHGUID_TRANSPORT HighGuid::Transport +#define HIGHGUID_VEHICLE HighGuid::Vehicle +#define HIGHGUID_CONTAINER HighGuid::Container +#define HIGHGUID_DYNAMICOBJECT HighGuid::DynamicObject +#define HIGHGUID_CORPSE HighGuid::Corpse +#define HIGHGUID_MO_TRANSPORT HighGuid::Mo_Transport +#define HIGHGUID_INSTANCE HighGuid::Instance +#define HIGHGUID_GROUP HighGuid::Group #else typedef QueryNamedResult ElunaQuery; #define ASSERT MANGOS_ASSERT diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index e0f1374..f2ee5ca 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -1226,7 +1226,6 @@ ElunaRegister CorpseMethods[] = // Other { "ResetGhostTime", &LuaCorpse::ResetGhostTime }, { "SaveToDB", &LuaCorpse::SaveToDB }, - { "DeleteBonesFromWorld", &LuaCorpse::DeleteBonesFromWorld }, { NULL, NULL } }; diff --git a/PlayerMethods.h b/PlayerMethods.h index 5638acb..013bed3 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -817,7 +817,10 @@ namespace LuaPlayer uint32 spellId = Eluna::CHECKVAL(L, 2); #ifdef TRINITY - Eluna::Push(L, player->GetSpellHistory()->GetRemainingCooldown(spellId)); + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId)) + Eluna::Push(L, player->GetSpellHistory()->GetRemainingCooldown(spellInfo)); + else + Eluna::Push(L, 0); #else Eluna::Push(L, uint32(player->GetSpellCooldownDelay(spellId))); #endif