diff options
Diffstat (limited to 'src/server/scripts')
12 files changed, 51 insertions, 42 deletions
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 8f1f2b98120..cf1d0fe3543 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -156,7 +156,7 @@ public: } // fill the gameobject data and save to the db - object->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); + object->SaveToDB(map->GetId(), { map->GetDifficultyID() }); ObjectGuid::LowType spawnId = object->GetSpawnId(); // delete the old object and do a clean load from DB with a fresh new GameObject instance. diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index a68d74a4ec6..10abea19971 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -81,13 +81,16 @@ public: uint32 counter = 0; for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) { - Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); - for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) + auto binds = player->GetBoundInstances(Difficulty(i)); + if (binds != player->m_boundInstances.end()) { - InstanceSave* save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", itr->second.extendState == EXTEND_STATE_EXPIRED ? "expired" : itr->second.extendState == EXTEND_STATE_EXTENDED ? "yes" : "no", save->GetDifficultyID(), save->CanReset() ? "yes" : "no", timeleft.c_str()); - counter++; + for (auto itr = binds->second.begin(); itr != binds->second.end(); ++itr) + { + InstanceSave* save = itr->second.save; + std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", itr->second.extendState == EXTEND_STATE_EXPIRED ? "expired" : itr->second.extendState == EXTEND_STATE_EXTENDED ? "yes" : "no", save->GetDifficultyID(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + counter++; + } } } handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_PLAYER_BINDS, counter); @@ -97,13 +100,16 @@ public: { for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) { - Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i)); - for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) + auto binds = group->GetBoundInstances(Difficulty(i)); + if (binds != group->GetBoundInstanceEnd()) { - InstanceSave* save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", "-", save->GetDifficultyID(), save->CanReset() ? "yes" : "no", timeleft.c_str()); - counter++; + for (auto itr = binds->second.begin(); itr != binds->second.end(); ++itr) + { + InstanceSave* save = itr->second.save; + std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", "-", save->GetDifficultyID(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + counter++; + } } } } @@ -138,19 +144,22 @@ public: for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) { - Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i)); - for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();) + auto binds = player->GetBoundInstances(Difficulty(i)); + if (binds != player->m_boundInstances.end()) { - InstanceSave* save = itr->second.save; - if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficultyID())) + for (auto itr = binds->second.begin(); itr != binds->second.end();) { - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); - handler->PSendSysMessage(LANG_COMMAND_INST_UNBIND_UNBINDING, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficultyID(), save->CanReset() ? "yes" : "no", timeleft.c_str()); - player->UnbindInstance(itr, Difficulty(i)); - counter++; + InstanceSave* save = itr->second.save; + if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficultyID())) + { + std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + handler->PSendSysMessage(LANG_COMMAND_INST_UNBIND_UNBINDING, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficultyID(), save->CanReset() ? "yes" : "no", timeleft.c_str()); + player->UnbindInstance(itr, binds); + counter++; + } + else + ++itr; } - else - ++itr; } } handler->PSendSysMessage(LANG_COMMAND_INST_UNBIND_UNBOUND, counter); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 7b9d16502bb..c72893c77a9 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -301,7 +301,7 @@ public: Creature* creature = trans->CreateNPCPassenger(guid, &data); - creature->SaveToDB(trans->GetGOInfo()->moTransport.SpawnMap, UI64LIT(1) << map->GetSpawnMode()); + creature->SaveToDB(trans->GetGOInfo()->moTransport.SpawnMap, { map->GetDifficultyID() }); sObjectMgr->AddCreatureToGrid(guid, &data); return true; @@ -312,7 +312,7 @@ public: return false; PhasingHandler::InheritPhaseShift(creature, chr); - creature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); + creature->SaveToDB(map->GetId(), { map->GetDifficultyID() }); ObjectGuid::LowType db_guid = creature->GetSpawnId(); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 47f466c7c61..8e6f486448a 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -674,7 +674,7 @@ public: } PhasingHandler::InheritPhaseShift(wpCreature, chr); - wpCreature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); + wpCreature->SaveToDB(map->GetId(), { map->GetDifficultyID() }); ObjectGuid::LowType dbGuid = wpCreature->GetSpawnId(); @@ -892,7 +892,7 @@ public: } PhasingHandler::InheritPhaseShift(wpCreature, chr); - wpCreature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); + wpCreature->SaveToDB(map->GetId(), { map->GetDifficultyID() }); ObjectGuid::LowType dbGuid = wpCreature->GetSpawnId(); @@ -961,7 +961,7 @@ public: } PhasingHandler::InheritPhaseShift(creature, chr); - creature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); + creature->SaveToDB(map->GetId(), { map->GetDifficultyID() }); ObjectGuid::LowType dbGuid = creature->GetSpawnId(); @@ -1018,7 +1018,7 @@ public: } PhasingHandler::InheritPhaseShift(creature, chr); - creature->SaveToDB(map->GetId(), UI64LIT(1) << map->GetSpawnMode()); + creature->SaveToDB(map->GetId(), { map->GetDifficultyID() }); ObjectGuid::LowType dbGuid = creature->GetSpawnId(); diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index f6d8ef2b6fc..617ed7cd697 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -112,7 +112,7 @@ public: //THIS GOB IS A TRAP - What shall i do? =( //Cast it spell? Copyed Heigan method floorEruption->SendCustomAnim(floorEruption->GetGoAnimProgress()); - floorEruption->CastSpell(nullptr, Difficulty(instance->GetSpawnMode()) == DIFFICULTY_10_N ? 17731 : 69294); //pFloorEruption->GetGOInfo()->trap.spellId + floorEruption->CastSpell(nullptr, instance->GetDifficultyID() == DIFFICULTY_10_N ? 17731 : 69294); //pFloorEruption->GetGOInfo()->trap.spellId //Get all immediatly nearby floors std::list<GameObject*> nearFloorList; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 7d8813d0b7e..f43052ebb0a 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -232,7 +232,7 @@ class spell_saviana_conflagration_init : public SpellScriptLoader void FilterTargets(std::list<WorldObject*>& targets) { targets.remove_if(ConflagrationTargetSelector()); - uint8 maxSize = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 3); + uint8 maxSize = uint8(GetCaster()->GetMap()->Is25ManRaid() ? 6 : 3); if (targets.size() > maxSize) Trinity::Containers::RandomResize(targets, maxSize); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index cc95ecc3dbf..49d0737f00c 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -282,7 +282,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript { EventStage = 6000; uint32 tributeChest = 0; - if (instance->GetSpawnMode() == DIFFICULTY_10_HC) + if (instance->GetDifficultyID() == DIFFICULTY_10_HC) { if (TrialCounter >= 50) tributeChest = GO_TRIBUTE_CHEST_10H_99; @@ -299,7 +299,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript } } } - else if (instance->GetSpawnMode() == DIFFICULTY_25_HC) + else if (instance->GetDifficultyID() == DIFFICULTY_25_HC) { if (TrialCounter >= 50) tributeChest = GO_TRIBUTE_CHEST_25H_99; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 8ac469533c7..8ccc4c621d8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -135,7 +135,7 @@ Position const mincharPos = {4629.3711f, 2782.6089f, 424.6390f, 0.000000f}; bool IsVampire(Unit const* unit) { for (uint8 i = 0; i < 3; ++i) - if (unit->HasAura(vampireAuras[i][unit->GetMap()->GetSpawnMode() - DIFFICULTY_10_N])) + if (unit->HasAura(vampireAuras[i][unit->GetMap()->GetDifficultyID() - DIFFICULTY_10_N])) return true; return false; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 96c6c810789..fd4cb1abd6e 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -642,7 +642,7 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader if (Creature* marrowgar = GetCaster()->ToCreature()) { CreatureAI* marrowgarAI = marrowgar->AI(); - uint8 boneSpikeCount = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 3 : 1); + uint8 boneSpikeCount = uint8(GetCaster()->GetMap()->Is25ManRaid() ? 3 : 1); std::list<Unit*> targets; marrowgarAI->SelectTargetList(targets, BoneSpikeTargetSelector(marrowgarAI), boneSpikeCount, SELECT_TARGET_RANDOM); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index d9ca5815904..b680ecb8075 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -1006,7 +1006,7 @@ class spell_putricide_slime_puddle_aura : public SpellScriptLoader void ReplaceAura() { if (Unit* target = GetHitUnit()) - GetCaster()->AddAura((GetCaster()->GetMap()->GetSpawnMode() & 1) ? 72456 : 70346, target); + GetCaster()->AddAura(GetCaster()->GetMap()->Is25ManRaid() ? 72456 : 70346, target); } void Register() override @@ -1316,7 +1316,7 @@ class spell_putricide_mutated_plague : public SpellScriptLoader int32 damage = spell->GetEffect(EFFECT_0)->CalcValue(caster); float multiplier = 2.0f; - if (GetTarget()->GetMap()->GetSpawnMode() & 1) + if (GetTarget()->GetMap()->Is25ManRaid()) multiplier = 3.0f; damage *= int32(pow(multiplier, GetStackAmount())); @@ -1416,7 +1416,7 @@ class spell_putricide_mutation_init : public SpellScriptLoader void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { uint32 spellId = 70311; - if (GetTarget()->GetMap()->GetSpawnMode() & 1) + if (GetTarget()->GetMap()->Is25ManRaid()) spellId = 71503; GetTarget()->CastSpell(GetTarget(), spellId, true); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 4c2cc426a40..7748759cb98 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -1162,7 +1162,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader void FilterTargets(std::list<WorldObject*>& unitList) { unitList.remove_if(UnchainedMagicTargetSelector()); - uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 2); + uint32 maxSize = uint32(GetCaster()->GetMap()->Is25ManRaid() ? 6 : 2); if (unitList.size() > maxSize) Trinity::Containers::RandomResize(unitList, maxSize); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index eb61348e114..193e5d8427d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -372,7 +372,7 @@ class instance_icecrown_citadel : public InstanceMapScript { if (WeeklyQuestData[questIndex].creatureEntry == entry) { - uint8 diffIndex = uint8(instance->GetSpawnMode() & 1); + uint8 diffIndex = instance->Is25ManRaid() ? 1 : 0; if (!sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[questIndex].questId[diffIndex])) return 0; break; @@ -961,7 +961,7 @@ class instance_icecrown_citadel : public InstanceMapScript case DATA_VALITHRIA_DREAMWALKER: if (state == DONE) { - if (sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[8].questId[instance->GetSpawnMode() & 1])) + if (sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[8].questId[instance->Is25ManRaid() ? 1 : 0])) instance->SummonCreature(NPC_VALITHRIA_DREAMWALKER_QUEST, ValithriaSpawnPos); if (GameObject* teleporter = instance->GetGameObject(TeleporterSindragosaGUID)) SetTeleporterState(teleporter, true); @@ -1066,7 +1066,7 @@ class instance_icecrown_citadel : public InstanceMapScript break; // 5 is the index of Blood Quickening - if (!sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[5].questId[instance->GetSpawnMode() & 1])) + if (!sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[5].questId[instance->Is25ManRaid() ? 1 : 0])) break; switch (data) |
