mirror of
https://github.com/araxiaonline/mod-mythic-plus.git
synced 2026-06-13 03:02:24 -04:00
Added debug command to CommandScript
This commit is contained in:
@@ -23,6 +23,7 @@ public:
|
||||
{
|
||||
{"", HandleHelp, SEC_PLAYER, Console::No},
|
||||
{"status", HandleStatus, SEC_PLAYER, Console::No},
|
||||
{"debug", HandleDebug, SEC_PLAYER, Console::No},
|
||||
// {"mythic",HandleMythic, SEC_PLAYER, Console::No},
|
||||
// {"legendary",HandleLegendary, SEC_PLAYER, Console::No},
|
||||
// {"ascendant",HandleAscendant, SEC_PLAYER, Console::No},
|
||||
@@ -51,6 +52,43 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebug(ChatHandler* handler, const std::vector<std::string>& /*args*/)
|
||||
{
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
if(!target) {
|
||||
handler->PSendSysMessage("You must select a creature to debug.");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Output creature info with proper formatting
|
||||
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->GetLevel());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth());
|
||||
|
||||
// Output main-hand weapon damage
|
||||
handler->PSendSysMessage("WeaponDmg Main %f - %f",
|
||||
target->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE),
|
||||
target->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE)
|
||||
);
|
||||
|
||||
// Output ranged weapon damage
|
||||
handler->PSendSysMessage("WeaponDmg Range %f - %f",
|
||||
target->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE),
|
||||
target->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE)
|
||||
);
|
||||
|
||||
// Output off-hand weapon damage
|
||||
handler->PSendSysMessage("WeaponDmg Offhand %f - %f",
|
||||
target->GetWeaponDamageRange(OFF_ATTACK, MINDAMAGE),
|
||||
target->GetWeaponDamageRange(OFF_ATTACK, MAXDAMAGE)
|
||||
);
|
||||
|
||||
// Output creature armor
|
||||
handler->PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// sets the difficluty for the group
|
||||
static bool HandleSetDifficulty(ChatHandler* handler, const std::vector<std::string>& args)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "MapMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Group.h"
|
||||
#include "Unit.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
@@ -231,16 +232,24 @@ void MythicPlus::ScaleCreature(uint8 level, Creature* creature, MpMultipliers* m
|
||||
creature->SetModifierValue(UNIT_MOD_MANA, BASE_VALUE, (float)mana);
|
||||
|
||||
|
||||
float basedamage = stats->BaseDamage[EXPANSION_WRATH_OF_THE_LICH_KING];
|
||||
float weaponBaseMinDamage = CalculateNewBaseDamage(cInfo, mapId, difficulty, basedamage);
|
||||
float weaponBaseMaxDamage = weaponBaseMinDamage * 1.5f;
|
||||
// float basedamage = stats->BaseDamage[EXPANSION_WRATH_OF_THE_LICH_KING];
|
||||
// float weaponBaseMinDamage = CalculateNewBaseDamage(cInfo, mapId, difficulty, basedamage);
|
||||
// float weaponBaseMaxDamage = weaponBaseMinDamage * 1.15f;
|
||||
|
||||
creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, weaponBaseMinDamage);
|
||||
creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
|
||||
creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, weaponBaseMinDamage);
|
||||
creature->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
|
||||
creature->SetBaseWeaponDamage(RANGED_ATTACK, MINDAMAGE, weaponBaseMinDamage);
|
||||
creature->SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
|
||||
// creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, weaponBaseMinDamage);
|
||||
// creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
|
||||
// creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, weaponBaseMinDamage);
|
||||
// creature->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
|
||||
// creature->SetBaseWeaponDamage(RANGED_ATTACK, MINDAMAGE, weaponBaseMinDamage);
|
||||
// creature->SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
|
||||
int32 damageBonus = sMpDataStore->GetDamageScaleFactor(mapId, difficulty);
|
||||
float dmgMod = cInfo->DamageModifier + damageBonus;
|
||||
creature->SetModifierValue(UNIT_MOD_DAMAGE_MAINHAND,BASE_VALUE, dmgMod);
|
||||
|
||||
// MpLogger::debug("Creature base attack damage scaled from {} to {}",
|
||||
// basedamage,
|
||||
// weaponBaseMinDamage
|
||||
// );
|
||||
|
||||
creature->UpdateAllStats();
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if(haspositiveeffect) {
|
||||
damage = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_HOT, target, attacker, damage);
|
||||
} else {
|
||||
damage = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_DOT, target, attacker, damage);
|
||||
}
|
||||
// if(haspositiveeffect) {
|
||||
// damage = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_HOT, target, attacker, damage);
|
||||
// } else {
|
||||
// damage = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_DOT, target, attacker, damage);
|
||||
// }
|
||||
}
|
||||
|
||||
void ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage, SpellInfo const* /*spellInfo*/) override {
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
damage = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_SPELL, target, attacker, damage);
|
||||
// damage = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_SPELL, target, attacker, damage);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
damage = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_MELEE, target, attacker, damage);
|
||||
// damage = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_MELEE, target, attacker, damage);
|
||||
}
|
||||
|
||||
// When a healing spell hits a mythic+ enemy modify based on the modifiers for the difficulty
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
healing = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_HEAL, target, healer, healing);
|
||||
// healing = modifyIncomingDmgHeal(MythicPlus::UNIT_EVENT_HEAL, target, healer, healing);
|
||||
}
|
||||
|
||||
uint32 modifyIncomingDmgHeal(MythicPlus::MP_UNIT_EVENT_TYPE eventType,Unit* target, Unit* attacker, uint32 damageOrHeal, SpellInfo const* spellInfo = nullptr) {
|
||||
@@ -89,6 +89,16 @@ public:
|
||||
return damageOrHeal;
|
||||
}
|
||||
|
||||
if(attacker && attacker->IsPlayer()) {
|
||||
return damageOrHeal;
|
||||
}
|
||||
|
||||
#if defined(MOD_PRESENT_NPCBOTS)
|
||||
if (attacker && attacker->IsNPCBot()) {
|
||||
return damageOrHeal;
|
||||
}
|
||||
#endif
|
||||
|
||||
Creature* creature = attacker ? attacker->ToCreature() : nullptr;
|
||||
if (!creature) {
|
||||
MpLogger::debug("Attacker was considered not a creature");
|
||||
|
||||
Reference in New Issue
Block a user