|
1 | | -#include "ABConfig.h" |
2 | 1 | #include "ABGameObjectScript.h" |
| 2 | + |
| 3 | +#include "ABConfig.h" |
3 | 4 | #include "ABMapInfo.h" |
4 | 5 |
|
5 | 6 | void AutoBalance_GameObjectScript::OnGameObjectModifyHealth(GameObject* target, Unit* source, int32& amount, SpellInfo const* spellInfo) |
6 | 7 | { |
7 | 8 | // uncomment to debug this hook |
8 | 9 | bool _debug_damage_and_healing = (source && target && (source->GetTypeId() == TYPEID_PLAYER || source->IsControlledByPlayer())); |
9 | 10 |
|
10 | | - if (_debug_damage_and_healing) _Debug_Output("OnGameObjectModifyHealth", target, source, amount, "BEFORE:", spellInfo->SpellName[0], spellInfo->Id); |
| 11 | + if (_debug_damage_and_healing) |
| 12 | + _Debug_Output("OnGameObjectModifyHealth", target, source, amount, "BEFORE:", spellInfo->SpellName[0], spellInfo->Id); |
11 | 13 |
|
12 | 14 | // modify the amount |
13 | 15 | amount = _Modify_GameObject_Damage_Healing(target, source, amount, spellInfo); |
14 | 16 |
|
15 | | - if (_debug_damage_and_healing) _Debug_Output("OnGameObjectModifyHealth", target, source, amount, "AFTER:", spellInfo->SpellName[0], spellInfo->Id); |
| 17 | + if (_debug_damage_and_healing) |
| 18 | + _Debug_Output("OnGameObjectModifyHealth", target, source, amount, "AFTER:", spellInfo->SpellName[0], spellInfo->Id); |
16 | 19 | } |
17 | 20 |
|
18 | 21 | void AutoBalance_GameObjectScript::_Debug_Output(std::string function_name, GameObject* target, Unit* source, int32 amount, std::string prefix, std::string spell_name, uint32 spell_id) |
@@ -84,23 +87,26 @@ int32 AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing(GameObject |
84 | 87 | // check that we're enabled globally, else return the original value |
85 | 88 | if (!EnableGlobal) |
86 | 89 | { |
87 | | - if (_debug_damage_and_healing) LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: EnableGlobal is false, returning original value of ({}).", amount); |
| 90 | + if (_debug_damage_and_healing) |
| 91 | + LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: EnableGlobal is false, returning original value of ({}).", amount); |
88 | 92 |
|
89 | 93 | return amount; |
90 | 94 | } |
91 | 95 |
|
92 | 96 | // make sure the target is in an instance, else return the original damage |
93 | 97 | if (!(target->GetMap()->IsDungeon())) |
94 | 98 | { |
95 | | - if (_debug_damage_and_healing) LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Target is not in an instance, returning original value of ({}).", amount); |
| 99 | + if (_debug_damage_and_healing) |
| 100 | + LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Target is not in an instance, returning original value of ({}).", amount); |
96 | 101 |
|
97 | 102 | return amount; |
98 | 103 | } |
99 | 104 |
|
100 | 105 | // make sure the target is in the world, else return the original value |
101 | 106 | if (!target->IsInWorld()) |
102 | 107 | { |
103 | | - if (_debug_damage_and_healing) LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Target does not exist in the world, returning original value of ({}).", amount); |
| 108 | + if (_debug_damage_and_healing) |
| 109 | + LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Target does not exist in the world, returning original value of ({}).", amount); |
104 | 110 |
|
105 | 111 | return amount; |
106 | 112 | } |
@@ -134,7 +140,8 @@ int32 AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing(GameObject |
134 | 140 | // if the target's map is not enabled, return the original damage |
135 | 141 | if (!targetMapABInfo->enabled) |
136 | 142 | { |
137 | | - if (_debug_damage_and_healing) LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Target's map is not enabled, returning original value of ({}).", amount); |
| 143 | + if (_debug_damage_and_healing) |
| 144 | + LOG_DEBUG("module.AutoBalance_DamageHealingCC", "AutoBalance_GameObjectScript::_Modify_GameObject_Damage_Healing: Target's map is not enabled, returning original value of ({}).", amount); |
138 | 145 |
|
139 | 146 | return amount; |
140 | 147 | } |
|
0 commit comments