mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/ToC): remove completely invalid code about removing loot (#7814)
- Closes #7804
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1631306487914473600');
|
||||||
|
|
||||||
|
UPDATE `gameobject_template` SET `ScriptName`='' WHERE `entry` IN (195631,195632,195633,195635);
|
||||||
@@ -368,23 +368,6 @@ public:
|
|||||||
Talk(SAY_DEATH);
|
Talk(SAY_DEATH);
|
||||||
if( pInstance )
|
if( pInstance )
|
||||||
pInstance->SetData(TYPE_ANUBARAK, DONE);
|
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
|
void KilledUnit(Unit* who) override
|
||||||
|
|||||||
@@ -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
|
class spell_faction_champion_warl_unstable_affliction : public SpellScriptLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -2507,6 +2479,5 @@ void AddSC_boss_faction_champions()
|
|||||||
new npc_toc_retro_paladin();
|
new npc_toc_retro_paladin();
|
||||||
new npc_toc_pet_warlock();
|
new npc_toc_pet_warlock();
|
||||||
new npc_toc_pet_hunter();
|
new npc_toc_pet_hunter();
|
||||||
new go_toc_champions_cache();
|
|
||||||
new spell_faction_champion_warl_unstable_affliction();
|
new spell_faction_champion_warl_unstable_affliction();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1001,23 +1001,6 @@ public:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
pInstance->SetData(TYPE_ICEHOWL, DONE);
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user