From b82a3a557a7bf13d48342ea189325550059b622d Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 1 Dec 2020 21:08:06 +0100 Subject: Core/DataStores: Updated db2 structures to 9.0.2 * Includes support for new character customization --- src/server/scripts/Commands/cs_lookup.cpp | 26 ++++++++++++++++++++-- src/server/scripts/Commands/cs_misc.cpp | 6 ++--- .../IcecrownCitadel/icecrown_citadel_teleport.cpp | 4 ++-- src/server/scripts/Spells/spell_dk.cpp | 2 +- src/server/scripts/World/item_scripts.cpp | 4 ++-- 5 files changed, 32 insertions(+), 10 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 3c46311d182..8b45a06e9cc 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -659,11 +659,22 @@ public: } if (handler->GetSession()) + { + int32 maxLevel = 0; + if (Optional questLevels = sDB2Manager.GetContentTuningData(qInfo->GetContentTuningId(), + handler->GetSession()->GetPlayer()->m_playerData->CtrOptions->ContentTuningConditionMask)) + maxLevel = questLevels->MaxLevel; + + int32 scalingFactionGroup = 0; + if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(qInfo->GetContentTuningId())) + scalingFactionGroup = contentTuning->GetScalingFactionGroup(); + handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), handler->GetSession()->GetPlayer()->GetQuestLevel(qInfo), handler->GetSession()->GetPlayer()->GetQuestMinLevel(qInfo), - qInfo->GetQuestMaxScalingLevel(), qInfo->GetQuestScalingFactionGroup(), + maxLevel, scalingFactionGroup, title.c_str(), statusStr); + } else handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr); @@ -711,11 +722,22 @@ public: } if (handler->GetSession()) + { + int32 maxLevel = 0; + if (Optional questLevels = sDB2Manager.GetContentTuningData(qInfo->GetContentTuningId(), + handler->GetSession()->GetPlayer()->m_playerData->CtrOptions->ContentTuningConditionMask)) + maxLevel = questLevels->MaxLevel; + + int32 scalingFactionGroup = 0; + if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(qInfo->GetContentTuningId())) + scalingFactionGroup = contentTuning->GetScalingFactionGroup(); + handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), handler->GetSession()->GetPlayer()->GetQuestLevel(qInfo), handler->GetSession()->GetPlayer()->GetQuestMinLevel(qInfo), - qInfo->GetQuestMaxScalingLevel(), qInfo->GetQuestScalingFactionGroup(), + maxLevel, scalingFactionGroup, 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 3db136674be..086b72be892 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1029,7 +1029,7 @@ public: if (Player* caster = handler->GetSession()->GetPlayer()) { ObjectGuid castId = ObjectGuid::Create(SPELL_CAST_SOURCE_NORMAL, player->GetMapId(), SPELL_UNSTUCK_ID, player->GetMap()->GenerateLowGuid()); - Spell::SendCastResult(caster, spellInfo, SPELL_UNSTUCK_VISUAL, castId, SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW); + Spell::SendCastResult(caster, spellInfo, { SPELL_UNSTUCK_VISUAL, 0 }, castId, SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW); } return false; @@ -1700,7 +1700,7 @@ public: mapId = target->GetMapId(); areaId = target->GetAreaId(); alive = target->IsAlive() ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO); - gender = target->m_playerData->NativeSex; + gender = target->GetNativeSex(); } // get additional information from DB else @@ -2431,7 +2431,7 @@ public: if (!spellInfo) return false; - SpellNonMeleeDamage damageInfo(attacker, target, spellInfo, spellInfo->GetSpellXSpellVisualId(handler->GetSession()->GetPlayer()), spellInfo->SchoolMask); + SpellNonMeleeDamage damageInfo(attacker, target, spellInfo, { spellInfo->GetSpellXSpellVisualId(handler->GetSession()->GetPlayer()),0 }, spellInfo->SchoolMask); damageInfo.damage = damage; attacker->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); target->DealSpellDamage(&damageInfo, true); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp index 67e665862ff..a8b928996a1 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel_teleport.cpp @@ -64,7 +64,7 @@ class icecrown_citadel_teleport : public GameObjectScript if (player->IsInCombat()) { ObjectGuid castId = ObjectGuid::Create(SPELL_CAST_SOURCE_NORMAL, player->GetMapId(), spell->Id, player->GetMap()->GenerateLowGuid()); - Spell::SendCastResult(player, spell, 0, castId, SPELL_FAILED_AFFECTING_COMBAT); + Spell::SendCastResult(player, spell, {}, castId, SPELL_FAILED_AFFECTING_COMBAT); return true; } @@ -91,7 +91,7 @@ class at_frozen_throne_teleport : public AreaTriggerScript if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(FROZEN_THRONE_TELEPORT, DIFFICULTY_NONE)) { ObjectGuid castId = ObjectGuid::Create(SPELL_CAST_SOURCE_NORMAL, player->GetMapId(), spell->Id, player->GetMap()->GenerateLowGuid()); - Spell::SendCastResult(player, spell, 0, castId, SPELL_FAILED_AFFECTING_COMBAT); + Spell::SendCastResult(player, spell, {}, castId, SPELL_FAILED_AFFECTING_COMBAT); } return true; } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index dd7cd8504c4..fa4afb32583 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -330,7 +330,7 @@ class spell_dk_dancing_rune_weapon : public SpellScriptLoader return; int32 amount = static_cast(damageInfo->GetDamage()) / 2; - SpellNonMeleeDamage log(drw, drw->GetVictim(), spellInfo, spellInfo->GetSpellXSpellVisualId(drw), spellInfo->GetSchoolMask()); + SpellNonMeleeDamage log(drw, drw->GetVictim(), spellInfo, { spellInfo->GetSpellXSpellVisualId(drw), 0 }, spellInfo->GetSchoolMask()); log.damage = amount; drw->DealDamage(drw->GetVictim(), amount, nullptr, SPELL_DIRECT_DAMAGE, spellInfo->GetSchoolMask(), spellInfo, true); drw->SendSpellNonMeleeDamageLog(&log); diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 21e852b1f8f..b06f1aae0f7 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -71,7 +71,7 @@ public: break; case 34475: if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES, player->GetMap()->GetDifficultyID())) - Spell::SendCastResult(player, spellInfo, 0, castId, SPELL_FAILED_NOT_ON_GROUND); + Spell::SendCastResult(player, spellInfo, {}, castId, SPELL_FAILED_NOT_ON_GROUND); break; } @@ -280,7 +280,7 @@ public: if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS) { if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB, DIFFICULTY_NONE)) - Spell::SendCastResult(player, spellInfo, 0, castId, SPELL_FAILED_NOT_HERE); + Spell::SendCastResult(player, spellInfo, {}, castId, SPELL_FAILED_NOT_HERE); return true; } -- cgit v1.2.3