Core/Maps: Updated map difficulties

This commit is contained in:
Shauren
2015-01-10 01:35:47 +01:00
parent f6b30fdf61
commit faa583c784
69 changed files with 808 additions and 469 deletions

View File

@@ -84,7 +84,7 @@ public:
{
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->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
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++;
}
}
@@ -100,7 +100,7 @@ public:
{
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->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
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++;
}
}
@@ -140,10 +140,10 @@ public:
for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
{
InstanceSave* save = itr->second.save;
if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
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->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
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++;
}

View File

@@ -369,7 +369,7 @@ public:
// if the player or the player's group is bound to another instance
// the player will not be bound to another one
InstancePlayerBind* bind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(map->IsRaid()));
InstancePlayerBind* bind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficultyID(map->GetEntry()));
if (!bind)
{
Group* group = _player->GetGroup();
@@ -381,9 +381,12 @@ public:
}
if (map->IsRaid())
_player->SetRaidDifficulty(target->GetRaidDifficulty());
{
_player->SetRaidDifficultyID(target->GetRaidDifficultyID());
_player->SetLegacyRaidDifficultyID(target->GetLegacyRaidDifficultyID());
}
else
_player->SetDungeonDifficulty(target->GetDungeonDifficulty());
_player->SetDungeonDifficultyID(target->GetDungeonDifficultyID());
}
handler->PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());
@@ -496,7 +499,7 @@ public:
Map* destMap = target->GetMap();
if (destMap->Instanceable() && destMap->GetInstanceId() != map->GetInstanceId())
target->UnbindInstance(map->GetInstanceId(), target->GetDungeonDifficulty(), true);
target->UnbindInstance(map->GetInstanceId(), target->GetDungeonDifficultyID(), true);
// we are in an instance, and can only summon players in our group with us as leader
if (!handler->GetSession()->GetPlayer()->GetGroup() || !target->GetGroup() ||

View File

@@ -485,7 +485,7 @@ public:
void SpellHit(Unit* /*pAttacker*/, const SpellInfo* Spell) override
{
//We only care about interrupt effects and only if they are durring a spell currently being cast
for (SpellEffectInfo const* effect : Spell->GetEffectsForDifficulty(me->GetMap()->GetDifficulty()))
for (SpellEffectInfo const* effect : Spell->GetEffectsForDifficulty(me->GetMap()->GetDifficultyID()))
if (effect && effect->Effect == SPELL_EFFECT_INTERRUPT_CAST && me->IsNonMeleeSpellCast(false))
{
//Interrupt effect

View File

@@ -78,7 +78,7 @@ enum Shadowmourne
SPELL_THIRST_QUENCHED = 72154,
};
uint32 const vampireAuras[3][MAX_DIFFICULTY] =
uint32 const vampireAuras[3][4] =
{
{70867, 71473, 71532, 71533},
{70879, 71525, 71530, 71531},
@@ -129,7 +129,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()]))
if (unit->HasAura(vampireAuras[i][unit->GetMap()->GetSpawnMode() - DIFFICULTY_10_N]))
return true;
return false;
}

View File

@@ -1088,7 +1088,7 @@ class spell_putricide_choking_gas_bomb : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
uint32 skipIndex = urand(0, 2);
for (SpellEffectInfo const* effect : GetSpellInfo()->GetEffectsForDifficulty(GetCaster()->GetMap()->GetDifficulty()))
for (SpellEffectInfo const* effect : GetSpellInfo()->GetEffectsForDifficulty(GetCaster()->GetMap()->GetDifficultyID()))
{
if (!effect || effect->EffectIndex == skipIndex)
continue;

View File

@@ -1171,7 +1171,7 @@ class spell_sindragosa_frost_breath : public SpellScriptLoader
return;
// Check difficulty and quest status
if (!(target->GetRaidDifficulty() & RAID_DIFFICULTY_MASK_25MAN) || target->GetQuestStatus(QUEST_FROST_INFUSION) != QUEST_STATUS_INCOMPLETE)
if (!target->GetMap()->Is25ManRaid() || target->GetQuestStatus(QUEST_FROST_INFUSION) != QUEST_STATUS_INCOMPLETE)
return;
// Check if player has Shadow's Edge equipped and not ready for infusion

View File

@@ -1786,10 +1786,10 @@ class spell_malygos_arcane_storm : public SpellScriptLoader
{
// Resize list only to objects that are vehicles.
IsCreatureVehicleCheck check(true);
Trinity::Containers::RandomResizeList(targets, check, (malygos->GetMap()->GetDifficulty() == DIFFICULTY_10_N ? 4 : 10));
Trinity::Containers::RandomResizeList(targets, check, (malygos->GetMap()->GetDifficultyID() == DIFFICULTY_10_N ? 4 : 10));
}
else
Trinity::Containers::RandomResizeList(targets, (malygos->GetMap()->GetDifficulty() == DIFFICULTY_10_N ? 4 : 10));
Trinity::Containers::RandomResizeList(targets, (malygos->GetMap()->GetDifficultyID() == DIFFICULTY_10_N ? 4 : 10));
}
void HandleVisual(SpellEffIndex /*effIndex*/)
@@ -2475,9 +2475,9 @@ class spell_alexstrasza_gift_beam_visual : public SpellScriptLoader
{
if (Creature* target = GetTarget()->ToCreature())
{
if (target->GetMap()->GetDifficulty() == DIFFICULTY_10_N)
if (target->GetMap()->GetDifficultyID() == DIFFICULTY_10_N)
_alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_10, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0);
else if (target->GetMap()->GetDifficulty() == DIFFICULTY_25_N)
else if (target->GetMap()->GetDifficultyID() == DIFFICULTY_25_N)
_alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_25, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0);
}
}

View File

@@ -92,14 +92,14 @@ public:
platformGUID = go->GetGUID();
break;
case GO_FOCUSING_IRIS_10:
if (instance->GetDifficulty() == DIFFICULTY_10_N)
if (instance->GetDifficultyID() == DIFFICULTY_10_N)
{
irisGUID = go->GetGUID();
focusingIrisPosition = go->GetPosition();
}
break;
case GO_FOCUSING_IRIS_25:
if (instance->GetDifficulty() == DIFFICULTY_25_N)
if (instance->GetDifficultyID() == DIFFICULTY_25_N)
{
irisGUID = go->GetGUID();
focusingIrisPosition = go->GetPosition();
@@ -110,11 +110,11 @@ public:
exitPortalPosition = go->GetPosition();
break;
case GO_HEART_OF_MAGIC_10:
if (instance->GetDifficulty() == DIFFICULTY_10_N)
if (instance->GetDifficultyID() == DIFFICULTY_10_N)
heartOfMagicGUID = go->GetGUID();
break;
case GO_HEART_OF_MAGIC_25:
if (instance->GetDifficulty() == DIFFICULTY_25_N)
if (instance->GetDifficultyID() == DIFFICULTY_25_N)
heartOfMagicGUID = go->GetGUID();
break;
}
@@ -240,7 +240,7 @@ public:
PowerSparksHandling();
break;
case DATA_RESPAWN_IRIS:
SpawnGameObject(instance->GetDifficulty() == DIFFICULTY_10_N ? GO_FOCUSING_IRIS_10 : GO_FOCUSING_IRIS_25, focusingIrisPosition);
SpawnGameObject(instance->GetDifficultyID() == DIFFICULTY_10_N ? GO_FOCUSING_IRIS_10 : GO_FOCUSING_IRIS_25, focusingIrisPosition);
break;
}
}

View File

@@ -598,7 +598,7 @@ class boss_freya : public CreatureScript
/* 25N */ {62952, 62954, 62956, 62958}
};
me->CastSpell((Unit*)NULL, summonSpell[me->GetMap()->GetDifficulty()][elderCount], true);
me->CastSpell((Unit*)NULL, summonSpell[me->GetMap()->GetDifficultyID() - DIFFICULTY_10_N][elderCount], true);
Talk(SAY_DEATH);
me->SetReactState(REACT_PASSIVE);

View File

@@ -452,7 +452,7 @@ class spell_ulduar_cancel_stone_grip : public SpellScriptLoader
if (!target || !target->GetVehicle())
return;
switch (target->GetMap()->GetDifficulty())
switch (target->GetMap()->GetDifficultyID())
{
case DIFFICULTY_10_N:
target->RemoveAura(GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue());
@@ -534,7 +534,7 @@ class spell_ulduar_stone_grip_absorb : public SpellScriptLoader
if (!GetOwner()->ToCreature())
return;
uint32 rubbleStalkerEntry = (GetOwner()->GetMap()->GetDifficulty() == DIFFICULTY_NORMAL ? 33809 : 33942);
uint32 rubbleStalkerEntry = (GetOwner()->GetMap()->GetDifficultyID() == DIFFICULTY_NORMAL ? 33809 : 33942);
Creature* rubbleStalker = GetOwner()->FindNearestCreature(rubbleStalkerEntry, 200.0f, true);
if (rubbleStalker)
rubbleStalker->CastSpell(rubbleStalker, SPELL_STONE_GRIP_CANCEL, true);

View File

@@ -572,7 +572,7 @@ public:
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
{
if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL))
for (SpellEffectInfo const* effect : spell->GetEffectsForDifficulty(me->GetMap()->GetDifficulty()))
for (SpellEffectInfo const* effect : spell->GetEffectsForDifficulty(me->GetMap()->GetDifficultyID()))
if (effect->Effect == SPELL_EFFECT_INTERRUPT_CAST)
if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_SOUL_SHOCK
|| me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_DEADEN)