diff options
Diffstat (limited to 'src/server/scripts')
29 files changed, 74 insertions, 64 deletions
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index f62ae5f45ca..e2a29b62bea 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -235,7 +235,7 @@ public: { player->GiveLevel(newLevel); player->InitTalentForLevel(); - player->SetUInt32Value(PLAYER_XP, 0); + player->SetUInt32Value(ACTIVE_PLAYER_FIELD_XP, 0); if (handler->needReportToTarget(player)) { diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp index b9c2e78b98a..c4100d84438 100644 --- a/src/server/scripts/Commands/cs_cheat.cpp +++ b/src/server/scripts/Commands/cs_cheat.cpp @@ -276,9 +276,9 @@ public: for (uint16 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) { if (flag != 0) - handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF); + handler->GetSession()->GetPlayer()->SetFlag(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + i, 0xFFFFFFFF); else - handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0); + handler->GetSession()->GetPlayer()->SetFlag(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + i, 0); } return true; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index f29a12eb029..ef9007bac85 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -985,7 +985,7 @@ public: if (m) if (uint32 um = (uint32)atoi(m)) - phaseShift.AddUiWorldMapAreaIdSwap(um); + phaseShift.AddUiMapPhaseId(um); PhasingHandler::SendToPlayer(handler->GetSession()->GetPlayer(), phaseShift); return true; diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 1c235bb8483..d1eaa9198f5 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -658,7 +658,11 @@ public: } if (handler->GetSession()) - handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr); + handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), + handler->GetSession()->GetPlayer()->GetQuestLevel(qInfo), + handler->GetSession()->GetPlayer()->GetQuestMinLevel(qInfo), + qInfo->GetQuestMaxScalingLevel(), qInfo->GetQuestScalingFactionGroup(), + title.c_str(), statusStr); else handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr); @@ -706,7 +710,11 @@ public: } if (handler->GetSession()) - handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr); + handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), + handler->GetSession()->GetPlayer()->GetQuestLevel(qInfo), + handler->GetSession()->GetPlayer()->GetQuestMinLevel(qInfo), + qInfo->GetQuestMaxScalingLevel(), qInfo->GetQuestScalingFactionGroup(), + title.c_str(), statusStr); else handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 9be3ff64559..a5a3fe831b2 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1203,8 +1203,8 @@ public: } uint32 val = uint32((1 << (area->AreaBit % 32))); - uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset); - playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields | val))); + uint32 currFields = playerTarget->GetUInt32Value(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + offset); + playerTarget->SetUInt32Value(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + offset, uint32((currFields | val))); handler->SendSysMessage(LANG_EXPLORE_AREA); return true; @@ -1247,8 +1247,8 @@ public: } uint32 val = uint32((1 << (area->AreaBit % 32))); - uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset); - playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields ^ val))); + uint32 currFields = playerTarget->GetUInt32Value(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + offset); + playerTarget->SetUInt32Value(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + offset, uint32((currFields ^ val))); handler->SendSysMessage(LANG_UNEXPLORE_AREA); return true; diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index a17824a0127..6dc2d9b84f2 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -493,7 +493,10 @@ public: if (CheckModifySpeed(handler, args, target, Scale, 0.1f, 10.0f, false)) { NotifyModification(handler, target, LANG_YOU_CHANGE_SIZE, LANG_YOURS_SIZE_CHANGED, Scale); - target->SetObjectScale(Scale); + if (Creature* creatureTarget = target->ToCreature()) + creatureTarget->SetFloatValue(UNIT_FIELD_DISPLAY_SCALE, Scale); + else + target->SetObjectScale(Scale); return true; } return false; diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 6691158360c..cb9cacdcc7b 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -64,7 +64,7 @@ public: } // .addquest #entry' - // number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r + // number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r char* cId = handler->extractKeyFromLink((char*)args, "Hquest"); if (!cId) return false; @@ -112,7 +112,7 @@ public: } // .removequest #entry' - // number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r + // number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r char* cId = handler->extractKeyFromLink((char*)args, "Hquest"); if (!cId) return false; @@ -170,7 +170,7 @@ public: } // .quest complete #entry - // number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r + // number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r char* cId = handler->extractKeyFromLink((char*)args, "Hquest"); if (!cId) return false; @@ -268,7 +268,7 @@ public: } // .quest reward #entry - // number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r + // number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r char* cId = handler->extractKeyFromLink((char*)args, "Hquest"); if (!cId) return false; diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index 10c924b89ed..1c62712f5bd 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -83,8 +83,8 @@ public: if (!handler->extractPlayerTarget((char*)args, &target)) return false; - target->SetUInt32Value(PLAYER_FIELD_KILLS, 0); - target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0); + target->SetUInt32Value(ACTIVE_PLAYER_FIELD_KILLS, 0); + target->SetUInt32Value(ACTIVE_PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0); target->UpdateCriteria(CRITERIA_TYPE_EARN_HONORABLE_KILL); return true; @@ -117,7 +117,7 @@ public: player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); //-1 is default value - player->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); + player->SetUInt32Value(ACTIVE_PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); return true; } @@ -143,7 +143,7 @@ public: target->InitStatsForLevel(true); target->InitTaxiNodesForLevel(); target->InitTalentForLevel(); - target->SetUInt32Value(PLAYER_XP, 0); + target->SetUInt32Value(ACTIVE_PLAYER_FIELD_XP, 0); target->_ApplyAllLevelScaleItemMods(true); diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index b493f810e13..c910d9ca8ce 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -234,7 +234,7 @@ public: titles &= ~titles2; // remove non-existing titles - target->SetUInt64Value(PLAYER__FIELD_KNOWN_TITLES, titles); + target->SetUInt64Value(ACTIVE_PLAYER_FIELD_KNOWN_TITLES, titles); handler->SendSysMessage(LANG_DONE); if (!target->HasTitle(target->GetInt32Value(PLAYER_CHOSEN_TITLE))) diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 8bd6650b1ad..e0963b46057 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -203,7 +203,7 @@ class npc_pure_energy : public CreatureScript { npc_pure_energyAI(Creature* creature) : ScriptedAI(creature) { - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); } void JustDied(Unit* killer) override diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 9c1ff991279..c69a3287134 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -370,7 +370,7 @@ class npc_eye_of_acherus : public CreatureScript { npc_eye_of_acherusAI(Creature* creature) : ScriptedAI(creature) { - me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); + me->SetDisplayFromModel(0); if (Player* owner = me->GetCharmerOrOwner()->ToPlayer()) { me->GetCharmInfo()->InitPossessCreateSpells(); @@ -1023,7 +1023,7 @@ class npc_scarlet_miner_cart : public CreatureScript { npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature) { - me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse. + me->SetDisplayFromModel(0); // Modelid2 } void JustSummoned(Creature* summon) override diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 33c745c63c2..e36fb0ac437 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -402,7 +402,7 @@ public: void Initialize() { - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); me->SetReactState(REACT_PASSIVE); DoCast(me, SPELL_DARKFIEND_SKIN, true); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index fca2d98002a..4822c5138e5 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -91,7 +91,7 @@ class npc_voljin_zulaman : public CreatureScript { npc_voljin_zulamanAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { - me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); + me->SetDisplayFromModel(0); if (_instance->GetData(DATA_ZULAMAN_STATE) == NOT_STARTED) me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } diff --git a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp index d437ec8dba9..82282ed3613 100644 --- a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp @@ -324,7 +324,6 @@ public: { _events.Reset(); _events.ScheduleEvent(EVENT_DETERMINE_EVENT, Seconds(2)); - me->SetDisplayId(me->GetCreatureTemplate()->GetRandomValidModelId()); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp index 705c82b799b..8e5dc67299e 100644 --- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp @@ -248,7 +248,7 @@ public: void Reset() override { _events.Reset(); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp index 934143da40e..69f6d3ce2c1 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp @@ -173,7 +173,7 @@ public: events.Reset(); events.ScheduleEvent(EVENT_AURA, 1 * IN_MILLISECONDS); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); DoCast(SPELL_PUTRID_MUSHROOM); if (me->GetEntry() == NPC_POISONOUS_MUSHROOM) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index ce900cef73c..2be65088628 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -254,10 +254,10 @@ class boss_anubarak_trial : public CreatureScript _burrowGUID.push_back(summoned->GetGUID()); summoned->SetReactState(REACT_PASSIVE); summoned->CastSpell(summoned, SPELL_CHURNING_GROUND, false); - summoned->SetDisplayId(summoned->GetCreatureTemplate()->Modelid2); + summoned->SetDisplayFromModel(1); break; case NPC_SPIKE: - summoned->SetDisplayId(summoned->GetCreatureTemplate()->Modelid1); + summoned->SetDisplayFromModel(0); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) { summoned->CombatStart(target); @@ -620,7 +620,7 @@ class npc_frost_sphere : public CreatureScript { me->SetReactState(REACT_PASSIVE); DoCast(SPELL_FROST_SPHERE); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); me->GetMotionMaster()->MoveRandom(20.0f); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 8cb3f23d346..165e15c61c4 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -489,7 +489,7 @@ class npc_firebomb : public CreatureScript DoCast(me, SPELL_FIRE_BOMB_DOT, true); SetCombatMovement(false); me->SetReactState(REACT_PASSIVE); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); } void UpdateAI(uint32 /*diff*/) override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index b147ce86fcc..9dde78ac1e2 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -306,7 +306,7 @@ class boss_lich_king_toc : public CreatureScript if (Creature* summoned = me->SummonCreature(NPC_TRIGGER, ToCCommonLoc[2].GetPositionX(), ToCCommonLoc[2].GetPositionY(), ToCCommonLoc[2].GetPositionZ(), 5, TEMPSUMMON_TIMED_DESPAWN, 1*MINUTE*IN_MILLISECONDS)) { summoned->CastSpell(summoned, 51807, false); - summoned->SetDisplayId(summoned->GetCreatureTemplate()->Modelid2); + summoned->SetDisplayFromModel(1); } _instance->SetBossState(BOSS_LICH_KING, IN_PROGRESS); @@ -497,11 +497,11 @@ class npc_fizzlebang_toc : public CreatureScript me->GetMotionMaster()->MovementExpired(); Talk(SAY_STAGE_1_03); me->HandleEmoteCommand(EMOTE_ONESHOT_SPELL_CAST_OMNI); - if (Unit* pTrigger = me->SummonCreature(NPC_TRIGGER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 4.69494f, TEMPSUMMON_MANUAL_DESPAWN)) + if (Creature* pTrigger = me->SummonCreature(NPC_TRIGGER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 4.69494f, TEMPSUMMON_MANUAL_DESPAWN)) { _triggerGUID = pTrigger->GetGUID(); pTrigger->SetObjectScale(2.0f); - pTrigger->SetDisplayId(pTrigger->ToCreature()->GetCreatureTemplate()->Modelid1); + pTrigger->SetDisplayFromModel(0); pTrigger->CastSpell(pTrigger, SPELL_WILFRED_PORTAL, false); } _instance->SetData(TYPE_EVENT, 1132); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index ab78e9a3cea..612d4b9316f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -2587,7 +2587,7 @@ class npc_quel_delar_sword : public CreatureScript npc_quel_delar_swordAI(Creature* creature) : ScriptedAI(creature) { _instance = me->GetInstanceScript(); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); _intro = true; } diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index 1290d417189..a73a3a2fa0d 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -272,7 +272,7 @@ class npc_pit_of_saron_icicle : public CreatureScript { npc_pit_of_saron_icicleAI(Creature* creature) : PassiveAI(creature) { - me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); + me->SetDisplayFromModel(0); } void IsSummonedBy(Unit* summoner) override diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index 4acf2099f51..e869ee3e6c1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -173,7 +173,7 @@ class boss_sapphiron : public CreatureScript switch(spell->Id) { case SPELL_CHECK_RESISTS: - if (target && target->GetResistance(SPELL_SCHOOL_FROST) > MAX_FROST_RESISTANCE) + if (target && target->GetResistance(SPELL_SCHOOL_MASK_FROST) > MAX_FROST_RESISTANCE) _canTheHundredClub = false; break; } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp index c4982c126f0..99513317306 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp @@ -224,7 +224,7 @@ class npc_chaotic_rift : public CreatureScript void Reset() override { Initialize(); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); DoCast(me, SPELL_ARCANEFORM, false); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 93f1f515409..7ca0d014c8a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -586,7 +586,7 @@ class boss_flame_leviathan_seat : public CreatureScript boss_flame_leviathan_seatAI(Creature* creature) : ScriptedAI(creature) { me->SetReactState(REACT_PASSIVE); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); instance = creature->GetInstanceScript(); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 5a85d720eea..fbcca717df6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -188,7 +188,7 @@ class npc_flash_freeze : public CreatureScript { Initialize(); instance = me->GetInstanceScript(); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); me->SetControlled(true, UNIT_STATE_ROOT); } @@ -264,7 +264,7 @@ class npc_ice_block : public CreatureScript npc_ice_blockAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); me->SetControlled(true, UNIT_STATE_ROOT); } @@ -557,7 +557,7 @@ class npc_icicle : public CreatureScript npc_icicleAI(Creature* creature) : ScriptedAI(creature) { Initialize(); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); + me->SetDisplayFromModel(0); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE); me->SetControlled(true, UNIT_STATE_ROOT); me->SetReactState(REACT_PASSIVE); @@ -612,7 +612,7 @@ class npc_snowpacked_icicle : public CreatureScript npc_snowpacked_icicleAI(Creature* creature) : ScriptedAI(creature) { Initialize(); - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED); me->SetControlled(true, UNIT_STATE_ROOT); me->SetReactState(REACT_PASSIVE); @@ -954,7 +954,7 @@ class npc_toasty_fire : public CreatureScript { npc_toasty_fireAI(Creature* creature) : ScriptedAI(creature) { - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); } void Reset() override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index cc1c3219bca..4a1a41bcbf6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -193,7 +193,7 @@ class boss_razorscale_controller : public CreatureScript { boss_razorscale_controllerAI(Creature* creature) : BossAI(creature, DATA_RAZORSCALE_CONTROL) { - me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + me->SetDisplayFromModel(1); } void Reset() override diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index a1376de652f..8649c4c1601 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -150,7 +150,7 @@ class boss_high_astromancer_solarian : public CreatureScript { Initialize(); _Reset(); - me->SetArmor(defaultarmor); + me->SetArmor(defaultarmor, 0); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetVisible(true); me->SetObjectScale(defaultsize); @@ -403,7 +403,7 @@ class boss_high_astromancer_solarian : public CreatureScript me->SetVisible(true); Talk(SAY_VOIDA); Talk(SAY_VOIDB); - me->SetArmor(WV_ARMOR); + me->SetArmor(WV_ARMOR, 0); me->SetDisplayId(MODEL_VOIDWALKER); me->SetObjectScale(defaultsize*2.5f); } diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 81bfe4fcd0c..5e46c2dfda4 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -300,8 +300,8 @@ public: if (Unit* owner = pet->ToPet()->GetOwner()) { - int32 fire = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); - int32 shadow = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); + int32 fire = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 shadow = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); int32 maximum = (fire > shadow) ? fire : shadow; if (maximum < 0) maximum = 0; @@ -328,8 +328,8 @@ public: if (Unit* owner = pet->ToPet()->GetOwner()) { //the damage bonus used for pets is either fire or shadow damage, whatever is higher - int32 fire = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); - int32 shadow = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); + int32 fire = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 shadow = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); int32 maximum = (fire > shadow) ? fire : shadow; float bonusDamage = 0.0f; @@ -450,7 +450,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_FIRE), 40); amount += ownerBonus; } } @@ -496,7 +496,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FROST), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_FROST), 40); amount += ownerBonus; } } @@ -507,7 +507,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_ARCANE), 40); amount += ownerBonus; } } @@ -518,7 +518,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_NATURE), 40); amount += ownerBonus; } } @@ -559,7 +559,7 @@ public: if (pet->IsPet()) if (Unit* owner = pet->ToPet()->GetOwner()) { - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_SHADOW), 40); amount += ownerBonus; } } @@ -1025,7 +1025,7 @@ public: if (!owner) return; - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FROST), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_FROST), 40); amount += ownerBonus; } } @@ -1041,7 +1041,7 @@ public: if (!owner) return; - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FIRE), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_FIRE), 40); amount += ownerBonus; } } @@ -1057,7 +1057,7 @@ public: if (!owner) return; - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_NATURE), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_NATURE), 40); amount += ownerBonus; } } @@ -1103,7 +1103,7 @@ public: if (!owner) return; - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_SHADOW), 40); amount += ownerBonus; } } @@ -1119,7 +1119,7 @@ public: if (!owner) return; - int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40); + int32 const ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_MASK_ARCANE), 40); amount += ownerBonus; } } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 8b8e47245e0..e0c648bcfc4 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2606,8 +2606,8 @@ public: init.SetFacing(o); init.Launch(); who->m_Events.AddEvent(new CastFoodSpell(who, _chairSpells.at(who->GetEntry())), who->m_Events.CalculateTime(1000)); - if (who->GetTypeId() == TYPEID_UNIT) - who->SetDisplayId(who->ToCreature()->GetCreatureTemplate()->Modelid1); + if (Creature* creature = who->ToCreature()) + creature->SetDisplayFromModel(0); } }; |