aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_go.cpp11
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp1
-rw-r--r--src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp8
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp29
6 files changed, 4 insertions, 47 deletions
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index fc78d8dc93d..5ab5395612f 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -520,16 +520,13 @@ public:
if (needles.empty())
return false;
- std::multimap<uint32, CreatureTemplate const*> matches;
+ std::multimap<uint32, CreatureTemplate const*, std::greater<uint32>> matches;
std::unordered_map<uint32, std::vector<CreatureData const*>> spawnLookup;
// find all boss flagged mobs that match our needles
for (auto const& pair : sObjectMgr->GetCreatureTemplates())
{
CreatureTemplate const& data = pair.second;
- if (!(data.flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS))
- continue;
-
uint32 count = 0;
std::string const& scriptName = sObjectMgr->GetScriptName(data.ScriptID);
for (std::string_view label : needles)
@@ -539,7 +536,7 @@ public:
if (count)
{
matches.emplace(count, &data);
- (void)spawnLookup[data.Entry]; // inserts default-constructed vector
+ spawnLookup.try_emplace(data.Entry); // inserts default-constructed vector
}
}
@@ -567,7 +564,7 @@ public:
}
// see if we have multiple equal matches left
- auto it = matches.crbegin(), end = matches.crend();
+ auto it = matches.cbegin(), end = matches.cend();
uint32 const maxCount = it->first;
if ((++it) != end && it->first == maxCount)
{
@@ -580,7 +577,7 @@ public:
return false;
}
- CreatureTemplate const* const boss = matches.crbegin()->second;
+ CreatureTemplate const* const boss = matches.cbegin()->second;
std::vector<CreatureData const*> const& spawns = spawnLookup[boss->Entry];
ASSERT(!spawns.empty());
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
index ecf63179523..23ae53ad34f 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp
@@ -228,7 +228,6 @@ public:
Event_Timer = 5000;
break;
case 5:
- instance->UpdateEncounterStateForKilledCreature(NPC_GRIMSTONE, me);
instance->SetData(TYPE_RING_OF_LAW, DONE);
TC_LOG_DEBUG("scripts", "npc_grimstone: event reached end and set complete.");
break;
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
index 5315cb727e1..fe41d2608ca 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp
@@ -103,7 +103,6 @@ struct boss_majordomo : public BossAI
if (!me->FindNearestCreature(NPC_FLAMEWAKER_HEALER, 100.0f) && !me->FindNearestCreature(NPC_FLAMEWAKER_ELITE, 100.0f))
{
- instance->UpdateEncounterStateForKilledCreature(me->GetEntry(), me);
me->SetFaction(FACTION_FRIENDLY);
EnterEvadeMode();
Talk(SAY_DEFEAT);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
index 7690575d1da..4995eb48c02 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp
@@ -184,7 +184,6 @@ public:
HandleGameObject(StageDoorRightGUID, true);
if (GameObject* sideEntrance = instance->GetGameObject(SideEntranceDoor))
sideEntrance->RemoveFlag(GO_FLAG_LOCKED);
- UpdateEncounterStateForKilledCreature(16812, nullptr);
}
break;
case DATA_CHESS:
diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
index 7568ef2d8e3..933114916cf 100644
--- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
+++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
@@ -333,14 +333,6 @@ class instance_violet_hold : public InstanceMapScript
switch (type)
{
- case DATA_1ST_BOSS:
- if (state == DONE)
- UpdateEncounterStateForKilledCreature(NPC_EREKEM, nullptr);
- break;
- case DATA_2ND_BOSS:
- if (state == DONE)
- UpdateEncounterStateForKilledCreature(NPC_MORAGG, nullptr);
- break;
case DATA_CYANIGOSA:
if (state == DONE)
SetData(DATA_MAIN_EVENT_STATE, DONE);
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 273be7a68bb..fb16c4a9581 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -31,7 +31,6 @@
#include "DB2Stores.h"
#include "GameTime.h"
#include "GridNotifiersImpl.h"
-#include "InstanceScript.h"
#include "Item.h"
#include "Log.h"
#include "MotionMaster.h"
@@ -1416,33 +1415,6 @@ class spell_gen_ds_flush_knockback : public SpellScript
}
};
-class spell_gen_dungeon_credit : public SpellScript
-{
- bool Load() override
- {
- return GetCaster()->GetTypeId() == TYPEID_UNIT;
- }
-
- void CreditEncounter()
- {
- // This hook is executed for every target, make sure we only credit instance once
- if (_handled)
- return;
-
- _handled = true;
- Unit* caster = GetCaster();
- if (InstanceScript* instance = caster->GetInstanceScript())
- instance->UpdateEncounterStateForSpellCast(GetSpellInfo()->Id, caster);
- }
-
- void Register() override
- {
- AfterHit += SpellHitFn(spell_gen_dungeon_credit::CreditEncounter);
- }
-
- bool _handled = false;
-};
-
// 50051 - Ethereal Pet Aura
enum EtherealPet
{
@@ -5396,7 +5368,6 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_despawn_target);
RegisterSpellScript(spell_gen_divine_storm_cd_reset);
RegisterSpellScript(spell_gen_ds_flush_knockback);
- RegisterSpellScript(spell_gen_dungeon_credit);
RegisterSpellScript(spell_ethereal_pet_aura);
RegisterSpellScript(spell_ethereal_pet_onsummon);
RegisterSpellScript(spell_ethereal_pet_aura_remove);