fix(Scripts/ToC): remove completely invalid code about removing loot (#7814)

- Closes #7804
This commit is contained in:
UltraNix
2021-09-16 14:33:05 +02:00
committed by GitHub
parent 4dc642d530
commit cb790b0d48
4 changed files with 3 additions and 63 deletions

View File

@@ -368,23 +368,6 @@ public:
Talk(SAY_DEATH);
if( pInstance )
pInstance->SetData(TYPE_ANUBARAK, DONE);
Player* plr = nullptr;
if( !pInstance->instance->GetPlayers().isEmpty() )
plr = pInstance->instance->GetPlayers().begin()->GetSource();
if( !plr )
return;
// remove loot for the other faction (items are invisible for players, done in conditions), so corpse can be skinned
for( std::vector<LootItem>::iterator itr = me->loot.items.begin(); itr != me->loot.items.end(); ++itr )
if( ItemTemplate const* iProto = sObjectMgr->GetItemTemplate((*itr).itemid) )
if( ((iProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && plr->GetTeamId() != TEAM_HORDE) || ((iProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && plr->GetTeamId() != TEAM_ALLIANCE) )
{
(*itr).count = 0;
(*itr).is_looted = true;
--me->loot.unlootedCount;
}
}
void KilledUnit(Unit* who) override

View File

@@ -2429,34 +2429,6 @@ public:
};
};
class go_toc_champions_cache : public GameObjectScript
{
public:
go_toc_champions_cache() : GameObjectScript("go_toc_champions_cache") { }
bool OnGossipHello(Player* player, GameObject* go) override
{
if (player->IsGameMaster())
return false;
if (!go->loot.items.size())
return false;
for(std::vector<LootItem>::iterator itr = go->loot.items.begin(); itr != go->loot.items.end(); ++itr)
if( ItemTemplate const* iProto = sObjectMgr->GetItemTemplate((*itr).itemid) )
if( ((iProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && player->GetTeamId() != TEAM_HORDE) || ((iProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && player->GetTeamId() != TEAM_ALLIANCE) )
if (!((*itr).is_looted))
{
(*itr).count = 0;
(*itr).is_looted = true;
if (go->loot.unlootedCount)
--go->loot.unlootedCount;
}
return false;
}
};
class spell_faction_champion_warl_unstable_affliction : public SpellScriptLoader
{
public:
@@ -2507,6 +2479,5 @@ void AddSC_boss_faction_champions()
new npc_toc_retro_paladin();
new npc_toc_pet_warlock();
new npc_toc_pet_hunter();
new go_toc_champions_cache();
new spell_faction_champion_warl_unstable_affliction();
}

View File

@@ -1001,23 +1001,6 @@ public:
return;
pInstance->SetData(TYPE_ICEHOWL, DONE);
Player* plr = nullptr;
if( !pInstance->instance->GetPlayers().isEmpty() )
plr = pInstance->instance->GetPlayers().begin()->GetSource();
if( !plr )
return;
// remove loot for the other faction (items are invisible for players, done in conditions), so corpse can be skinned
for( std::vector<LootItem>::iterator itr = me->loot.items.begin(); itr != me->loot.items.end(); ++itr )
if( ItemTemplate const* iProto = sObjectMgr->GetItemTemplate((*itr).itemid) )
if( ((iProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && plr->GetTeamId() != TEAM_HORDE) || ((iProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && plr->GetTeamId() != TEAM_ALLIANCE) )
{
(*itr).count = 0;
(*itr).is_looted = true;
--me->loot.unlootedCount;
}
}
};
};