diff --git a/src/CommandScript.cpp b/src/CommandScript.cpp index 43f2771..5541831 100644 --- a/src/CommandScript.cpp +++ b/src/CommandScript.cpp @@ -47,7 +47,7 @@ public: { std::string helpText = "Mythic+ Commands:\n" " .mp status - show current global settings of Mythic+ mod\n" - " .mp set [mythic,legendary,ascendant] - Set Mythic+ difficulty in current beta only supports mythic.\n" + " .mp set [normal, heroic, mythic,legendary,ascendant] - Set Mythic+ difficulty in current beta only supports mythic.\n" " .mp [enable,disable] - enable or disable this mod\n" " .mp - Show this help message\n"; handler->PSendSysMessage(helpText); @@ -62,7 +62,7 @@ public: return true; } - static bool HandleDebug(ChatHandler* handler, const std::vector& args) + static bool HandleDebug(ChatHandler* handler, const std::vector& /* args */) { Creature* target = handler->getSelectedCreature(); @@ -71,6 +71,8 @@ public: return true; } + CreatureTemplate const* creatureTemplate = target->GetCreatureTemplate(); + handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->GetLevel()); handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); handler->PSendSysMessage("WeaponDmg Main {} - {}", @@ -87,10 +89,8 @@ public: ); handler->PSendSysMessage("Attack Power Main {}", target->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE)); handler->PSendSysMessage("Attack Power Ranged {}", target->GetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE)); - handler->PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor()); - handler->PSendSysMessage("Damage Modifier {}", target->GetModifierValue(UNIT_MOD_DAMAGE_MAINHAND, BASE_VALUE)); - - + handler->PSendSysMessage("Armor {}", target->GetArmor()); + handler->PSendSysMessage("Damage Modifier on template {}",creatureTemplate->DamageModifier); return true; @@ -99,7 +99,6 @@ public: // sets the difficluty for the group static bool HandleSetDifficulty(ChatHandler* handler, const std::vector& args) { - Player* player = handler->GetSession()->GetPlayer(); Group* group = player->GetGroup(); @@ -140,6 +139,14 @@ public: else if (difficulty == "ascendant") { sMpDataStore->AddGroupData(group, MpGroupData(group, MP_DIFFICULTY_ASCENDANT, 0)); } + else if (difficulty == "heroic") { + sMpDataStore->RemoveGroupData(group); + group->SetDungeonDifficulty(DUNGEON_DIFFICULTY_HEROIC); + } + else if (difficulty == "normal") { + sMpDataStore->RemoveGroupData(group); + group->SetDungeonDifficulty(DUNGEON_DIFFICULTY_NORMAL); + } else { handler->PSendSysMessage("|cFFFF0000 Invalid difficulty level. Expected values are 'mythic', 'legendary', or 'ascendant'."); return true; diff --git a/src/CreatureHooks.cpp b/src/CreatureHooks.cpp index 96256f2..8fc5fb2 100644 --- a/src/CreatureHooks.cpp +++ b/src/CreatureHooks.cpp @@ -44,10 +44,10 @@ void CreatureHooks::JustDied(Creature* creature, Unit* killer) { uint32 entry = creature->GetEntry(); if (_JustDiedHandlers->contains(entry)) { for (auto& callback : _JustDiedHandlers->at(entry)) { + MpLogger::debug("JustDied() called for creature: {}", entry); callback(creature, killer); } } - MpLogger::debug("JustDied() called for creature: {}", entry); } void CreatureHooks::JustSpawned(Creature* creature) { @@ -56,6 +56,9 @@ void CreatureHooks::JustSpawned(Creature* creature) { if (_OnSpawnHandlers->contains(entry)) { for (auto& callback : _OnSpawnHandlers->at(entry)) { callback(creature); + MpLogger::debug("JustSpawned() called in CreatureHook: {}", entry); } } + + } diff --git a/src/Instances/Ragefire/boss_bazzalan.cpp b/src/Instances/Ragefire/boss_bazzalan.cpp index d2f1971..e48764b 100644 --- a/src/Instances/Ragefire/boss_bazzalan.cpp +++ b/src/Instances/Ragefire/boss_bazzalan.cpp @@ -1,19 +1,23 @@ -// #include "BaseCreatureHandler.h" +#include "BaseCreatureHandler.h" -// class Ragefire_Bazzalan_Mythic : public BaseCreatureHandler -// { -// public: -// Ragefire_Bazzalan_Mythic(uint32 creature) : BaseCreatureHandler(creature.GetEntry()); +class Ragefire_Bazzalan_Mythic : public BaseCreatureHandler +{ +public: + Ragefire_Bazzalan_Mythic() : BaseCreatureHandler(11519) {} -// // Implement the required methods from BaseCreatureHandler -// void OnJustDied(Creature* creature, Unit* killer) override { -// // Bazzalan-specific behavior on death -// creature->Yell("The flame... it burns out...", LANG_UNIVERSAL, nullptr); -// } + // Implement the required methods from BaseCreatureHandler + void OnJustDied(Creature* creature, Unit* killer) override { + creature->Yell("The flame... it burns out...", LANG_UNIVERSAL, nullptr); + } -// void OnJustSpawned(Creature* creature) override { -// // Bazzalan-specific behavior on spawn -// creature->Yell("The fire rises again!", LANG_UNIVERSAL, nullptr); -// creature->SetHealth(creature->GetMaxHealth()); // Restore health on spawn -// } -// }; + void OnJustSpawned(Creature* creature) override { + creature->Yell("The fire rises again!", LANG_UNIVERSAL, nullptr); + MpLogger::debug("Ragefire Bazzalan spawned Setting high health"); + uint32 health = 10000000; + creature->SetCreateHealth(health); + creature->SetMaxHealth(health); + creature->SetHealth(health); + creature->ResetPlayerDamageReq(); + creature->SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, (float)health); + } +}; diff --git a/src/MpDataStore.h b/src/MpDataStore.h index 4bd95c3..19ef916 100644 --- a/src/MpDataStore.h +++ b/src/MpDataStore.h @@ -126,6 +126,7 @@ struct MpCreatureData // Original information about the creature that was altered. uint8 originalLevel; CreatureBaseStats const* originalStats; + MpDifficulty difficulty; // Custom difficulty modifiers to creatures at higher difficulties. std::vector auras; @@ -150,6 +151,10 @@ struct MpCreatureData this->scaled = scaled; } + void SetDifficulty(MpDifficulty difficulty) { + this->difficulty = difficulty; + } + bool IsScaled() { return scaled; } diff --git a/src/MpScriptAI.h b/src/MpScriptAI.h index b7e212e..9bd2c04 100644 --- a/src/MpScriptAI.h +++ b/src/MpScriptAI.h @@ -27,15 +27,12 @@ public: } void JustDied(Unit* killer) override { - MpLogger::debug("***** MythicPlus Script AI JustDied() for creature: ", me->GetEntry()); - sCreatureHooks->JustDied(me->ToCreature(), killer); - BaseAI::JustDied(killer); } void Reset() override { - MpLogger::debug("***** MythicPlus Script AI Reset() for creature: ", me->GetEntry()); + sCreatureHooks->JustSpawned(me->ToCreature()); BaseAI::Reset(); } diff --git a/src/MythicPlus.cpp b/src/MythicPlus.cpp index 277ce61..c0f24dc 100644 --- a/src/MythicPlus.cpp +++ b/src/MythicPlus.cpp @@ -199,6 +199,7 @@ void MythicPlus::AddScaledCreature(Creature* creature, MpInstanceData* instanceD } creatureData.SetScaled(true); + creatureData.SetDifficulty(instanceData->difficulty); sMpDataStore->AddCreatureData(creature->GetGUID(), creatureData); // MpLogger::debug("Scaled Creature {} Entry {} Id {} level from {} to {}", @@ -303,57 +304,6 @@ void MythicPlus::ScaleCreature(uint8 level, Creature* creature, MpMultipliers* m creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, stats->BaseDamage[EXPANSION_WRATH_OF_THE_LICH_KING], 0); creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, stats->BaseDamage[EXPANSION_WRATH_OF_THE_LICH_KING], 0); - // float oldAp = stats->AttackPower; - // float oldRangeAp = stats->RangedAttackPower; - - // float ap; // = ((85 - origLevel) * APratio); // * 100; - - // int32 damageBonus = sMpDataStore->GetDamageScaleFactor(mapId, difficulty); - // float dmgMod = cInfo->DamageModifier + damageBonus; - - - // ap = dmgMod * 80 + oldAp; - // if (creature->GetLevel() >= 60) { - // ap = ap * 1.25f; - // rangeAp = rangeAp * 1.25f; - // } - - // creature->SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, ap); - // creature->SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, rangeAp); - - // // MpLogger::debug("Creature {} base attack power {} new ap {}", - // // creature->GetName(), - // // oldAp, - // // ap - // // ); - // // This works out a bonus damage to apply to the mob using the database and original mod settings. - // // the thought behind this is some mobs in dungeons are intended to hit harder than others - // // so applying a flat bonus keeps the ratios the same but increases the overall difficulty. - // // Of course within reason. - - // int32 maxBonus = sMpDataStore->GetMaxDamageScaleFactor(mapId, difficulty); - - - // // Allow bosses to scale as high as they want but limit non-bosses to a max bonus - // if(!creature->IsDungeonBoss() && damageBonus > maxBonus) { - // dmgMod = maxBonus; - // } - // float oldDmgModifier = creature->GetModifierValue(UNIT_MOD_DAMAGE_MAINHAND, BASE_VALUE); - // creature->SetModifierValue(UNIT_MOD_DAMAGE_MAINHAND,BASE_VALUE, oldDmgModifier * dmgMod); - // creature->SetModifierValue(UNIT_MOD_DAMAGE_OFFHAND,BASE_VALUE, oldDmgModifier * dmgMod * 0.85f); - // creature->SetModifierValue(UNIT_MOD_DAMAGE_RANGED,BASE_VALUE, oldDmgModifier * dmgMod); - // creature->UpdateAllStats(); - - -// Retrieve instance data and damage scaling factors -// MpInstanceData* instanceData = sMpDataStore->GetInstanceData(creature->GetMapId(), creature->GetInstanceId()); -// int32 damageBonus = sMpDataStore->GetDamageScaleFactor(creature->GetMapId(), instanceData->difficulty); - -// // Apply a boss multiplier for scaling -// if (creature->IsDungeonBoss()) { -// damageBonus *= 1.15; -// } - // Update all stats to apply the new damage values creature->UpdateAllStats(); diff --git a/src/MythicPlus_loader.cpp b/src/MythicPlus_loader.cpp index 1ceaef3..7e5a7e8 100755 --- a/src/MythicPlus_loader.cpp +++ b/src/MythicPlus_loader.cpp @@ -29,6 +29,8 @@ void Addmod_mythic_plusScripts() Add_MP_UnitScripts(); Add_MP_WorldScripts(); + new Ragefire_Bazzalan_Mythic(); + // list of boss / creature event handlers // new Ragefire_Bazzalan_Mythic(RAGEFIRE_BAZZALAN);