diff options
Diffstat (limited to 'src/server/scripts')
-rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 31 | ||||
-rw-r--r-- | src/server/scripts/Outland/zone_nagrand.cpp | 1 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index e48c800b294..9fcf544b0ec 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -32,6 +32,7 @@ EndScriptData */ #include "FollowMovementGenerator.h" #include "GameTime.h" #include "Language.h" +#include "Loot.h" #include "Map.h" #include "MotionMaster.h" #include "MovementDefines.h" @@ -1198,8 +1199,8 @@ public: return false; } - Loot const& loot = creatureTarget->loot; - if (!creatureTarget->isDead() || loot.empty()) + Loot const* loot = creatureTarget->m_loot.get(); + if (!creatureTarget->isDead() || !loot || loot->empty()) { handler->PSendSysMessage(LANG_COMMAND_NOT_DEAD_OR_NO_LOOT, creatureTarget->GetName().c_str()); handler->SetSentErrorMessage(true); @@ -1207,43 +1208,43 @@ public: } handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_HEADER, creatureTarget->GetName().c_str(), creatureTarget->GetEntry()); - handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_MONEY, loot.gold / GOLD, (loot.gold%GOLD) / SILVER, loot.gold%SILVER); + handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_MONEY, loot->gold / GOLD, (loot->gold % GOLD) / SILVER, loot->gold % SILVER); if (!all) { - handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_LABEL, "Standard items", loot.items.size()); - for (LootItem const& item : loot.items) + handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_LABEL, "Standard items", loot->items.size()); + for (LootItem const& item : loot->items) if (!item.is_looted) _ShowLootEntry(handler, item.itemid, item.count); - handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_LABEL, "Quest items", loot.quest_items.size()); - for (LootItem const& item : loot.quest_items) + handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_LABEL, "Quest items", loot->quest_items.size()); + for (LootItem const& item : loot->quest_items) if (!item.is_looted) _ShowLootEntry(handler, item.itemid, item.count); } else { - handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_LABEL, "Standard items", loot.items.size()); - for (LootItem const& item : loot.items) + handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_LABEL, "Standard items", loot->items.size()); + for (LootItem const& item : loot->items) if (!item.is_looted && !item.freeforall && item.conditions.empty()) _ShowLootEntry(handler, item.itemid, item.count); - if (!loot.GetPlayerQuestItems().empty()) + if (!loot->GetPlayerQuestItems().empty()) { handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_LABEL_2, "Per-player quest items"); - _IterateNotNormalLootMap(handler, loot.GetPlayerQuestItems(), loot.quest_items); + _IterateNotNormalLootMap(handler, loot->GetPlayerQuestItems(), loot->quest_items); } - if (!loot.GetPlayerFFAItems().empty()) + if (!loot->GetPlayerFFAItems().empty()) { handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_LABEL_2, "FFA items per allowed player"); - _IterateNotNormalLootMap(handler, loot.GetPlayerFFAItems(), loot.items); + _IterateNotNormalLootMap(handler, loot->GetPlayerFFAItems(), loot->items); } - if (!loot.GetPlayerNonQuestNonFFAConditionalItems().empty()) + if (!loot->GetPlayerNonQuestNonFFAConditionalItems().empty()) { handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_LABEL_2, "Per-player conditional items"); - _IterateNotNormalLootMap(handler, loot.GetPlayerNonQuestNonFFAConditionalItems(), loot.items); + _IterateNotNormalLootMap(handler, loot->GetPlayerNonQuestNonFFAConditionalItems(), loot->items); } } diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 37f5ec0a41a..4d29f5e639b 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -27,6 +27,7 @@ npc_maghar_captive EndContentData */ #include "ScriptMgr.h" +#include "ConditionMgr.h" #include "GameObjectAI.h" #include "MotionMaster.h" #include "Player.h" |