Restore pre-3.3 nerf mana costs for pre-WotLK spells, spell restorations

This commit is contained in:
郑佩茹
2022-09-12 15:14:53 -06:00
parent 2c410fa618
commit ccff78d717
7 changed files with 1023 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
#include "IndividualProgression.h"
static float vanillaPowerAdjustment, vanillaHealthAdjustment, tbcPowerAdjustment, tbcHealthAdjustment, vanillaHealingAdjustment, tbcHealingAdjustment, previousGearTuning;
static bool enabled, questXpFix, hunterPetLevelFix, requirePreAQQuests, enforceGroupRules, fishingFix;
static bool enabled, questXpFix, hunterPetLevelFix, requirePreAQQuests, enforceGroupRules, fishingFix, simpleConfigOverride;
static questXpMapType questXpMap;
class gobject_ipp_wotlk : public GameObjectScript
@@ -182,6 +182,7 @@ private:
requirePreAQQuests = sConfigMgr->GetOption<bool>("IndividualProgression.RequirePreAQQuests", true);
enforceGroupRules = sConfigMgr->GetOption<bool>("IndividualProgression.EnforceGroupRules", true);
fishingFix = sConfigMgr->GetOption<bool>("IndividualProgression.FishingFix", true);
simpleConfigOverride = sConfigMgr->GetOption<bool>("IndividualProgression.SimpleConfigOverride", true);
previousGearTuning = sConfigMgr->GetOption<float>("IndividualProgression.PreviousGearTuning", 0.03);
}
@@ -214,6 +215,16 @@ public:
LoadConfig();
LoadXpValues();
}
void OnAfterConfigLoad(bool /*reload*/) override
{
if (simpleConfigOverride)
{
sWorld->setIntConfig(CONFIG_WATER_BREATH_TIMER, 60000);
// sWorld->setBoolConfig(CONFIG_OBJECT_QUEST_MARKERS, false); Waiting for PR merge: https://github.com/azerothcore/azerothcore-wotlk/pull/13013
// sWorld->setBoolConfig(CONFIG_OBJECT_SPARKLES, false); Waiting for PR merge: https://github.com/azerothcore/azerothcore-wotlk/pull/13005
}
}
};
class IndividualPlayerProgression_PetScript : public PetScript

View File

@@ -14,6 +14,7 @@
#include "DBCEnums.h"
#include "QuestDef.h"
#include "GameObject.h"
#include "IWorld.h"
typedef std::unordered_map<uint32, uint32> questXpMapType;

View File

@@ -33,6 +33,7 @@ void AddSC_npc_omarion();
void AddSC_Ipp_Wotlk_Modded_Scripts();
void AddSC_aq_scripts();
void AddSC_cot_scripts();
void AddSC_ipp_spell_scripts();
void Addmod_individual_progressionScripts()
@@ -67,5 +68,6 @@ void Addmod_individual_progressionScripts()
AddSC_Ipp_Wotlk_Modded_Scripts();
AddSC_aq_scripts();
AddSC_cot_scripts();
AddSC_ipp_spell_scripts();
}

View File

@@ -0,0 +1,64 @@
#include "SpellMgr.h"
#include "SpellScript.h"
#include "Player.h"
#include "Chat.h"
#include "ScriptMgr.h"
class spell_detect_magic : public SpellScript
{
PrepareSpellScript(spell_detect_magic);
void HandleDummy(SpellEffIndex effIndex)
{
if (GetCaster()->GetTypeId() != TYPEID_PLAYER)
return;
Player* caster = GetCaster()->ToPlayer();
if (Unit* target = GetHitUnit())
{
// Don't affect players
if (target->GetTypeId() == TYPEID_PLAYER)
return;
float holyResist = target->GetModifierValue(UNIT_MOD_RESISTANCE_HOLY, BASE_VALUE);
float fireResist = target->GetModifierValue(UNIT_MOD_RESISTANCE_FIRE, BASE_VALUE);
float natureResist = target->GetModifierValue(UNIT_MOD_RESISTANCE_NATURE, BASE_VALUE);
float frostResist = target->GetModifierValue(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE);
float shadowResist = target->GetModifierValue(UNIT_MOD_RESISTANCE_SHADOW, BASE_VALUE);
float arcaneResist = target->GetModifierValue(UNIT_MOD_RESISTANCE_ARCANE, BASE_VALUE);
if (holyResist < 0.1 && fireResist < 0.01 && natureResist < 0.01 && frostResist < 0.01 && shadowResist < 0.01 && arcaneResist < 0.01)
{
// Send message - you detect no magical resistances
ChatHandler(caster->GetSession()).PSendSysMessage("You detect no magical resistances.");
}
else
{
if (holyResist > 0.01)
ChatHandler(caster->GetSession()).PSendSysMessage("You detect a holy resistance of: %.0f", holyResist);
if (fireResist > 0.01)
ChatHandler(caster->GetSession()).PSendSysMessage("You detect a fire resistance of: %.0f", fireResist);
if (natureResist > 0.01)
ChatHandler(caster->GetSession()).PSendSysMessage("You detect a nature resistance of: %.0f", natureResist);
if (frostResist > 0.01)
ChatHandler(caster->GetSession()).PSendSysMessage("You detect a frost resistance of: %.0f", frostResist);
if (shadowResist > 0.01)
ChatHandler(caster->GetSession()).PSendSysMessage("You detect a shadow resistance of: %.0f", shadowResist);
if (arcaneResist > 0.01)
ChatHandler(caster->GetSession()).PSendSysMessage("You detect a arcane resistance of: %.0f", arcaneResist);
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_detect_magic::HandleDummy, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
};
void AddSC_ipp_spell_scripts()
{
RegisterSpellScript(spell_detect_magic);
}