fix(Core/Dungeon): Remove Goblin Rocket Pack from inventory in ICC Gunship Battle (#2191)

Part 2
This commit is contained in:
Dmitry Brusenskiy
2019-08-17 18:35:25 +03:00
committed by Barbz
parent 7954a2a07e
commit 524032d8f7
3 changed files with 14 additions and 8 deletions

View File

@@ -168,7 +168,6 @@ enum Spells
enum MiscData
{
ITEM_GOBLIN_ROCKET_PACK = 49278,
MUSIC_ENCOUNTER = 17289
};
@@ -646,13 +645,6 @@ class npc_gunship : public CreatureScript
c->DespawnOrUnsummon(1);
}
}
// Destory Goblin Rocket Pack
Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
if (Player* pPlr = itr->GetSource())
pPlr->DestroyItemCount(49278, 1, true);
}
else
{

View File

@@ -562,6 +562,11 @@ enum AreaIds
AREA_THE_FROZEN_THRONE = 4859,
};
enum ItemIds
{
ITEM_GOBLIN_ROCKET_PACK = 49278
};
class spell_trigger_spell_from_caster : public SpellScriptLoader
{
public:

View File

@@ -1027,6 +1027,13 @@ class instance_icecrown_citadel : public InstanceMapScript
if (theLichKing->IsAlive())
theLichKing->SetVisible(false);
}
void RemoveBackPack()
{
for (auto const& itr : instance->GetPlayers())
if (Player* _player = itr.GetSource())
_player->DestroyItemCount(ITEM_GOBLIN_ROCKET_PACK, _player->GetItemCount(ITEM_GOBLIN_ROCKET_PACK), true);
}
bool SetBossState(uint32 type, EncounterState state)
{
@@ -1742,6 +1749,8 @@ class instance_icecrown_citadel : public InstanceMapScript
{
transport->setActive(false);
transport->EnableMovement(false);
//After movement is stopped remove the backpack
RemoveBackPack();
}
if (Creature* captain = source->FindNearestCreature(TeamIdInInstance == TEAM_HORDE ? NPC_IGB_HIGH_OVERLORD_SAURFANG : NPC_IGB_MURADIN_BRONZEBEARD, 200.0f))
captain->AI()->DoAction(ACTION_EXIT_SHIP);