aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2012-09-09 03:59:34 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2012-09-09 04:02:47 +0200
commit2317af8dd3faac12b583978e14e47fd90ade4520 (patch)
tree2a9b8111470b78331bb0e4dc1bc24ec913a9e3bb
parentd04f155b6529e3d86fca931075775fd34b544e29 (diff)
Core/Spells: Convert Gift of the Naaru in spell script
Closes #6545
-rw-r--r--sql/updates/world/2012_09_09_02_world_spell_script_names.sql10
-rw-r--r--sql/updates/world/2012_09_09_03_world_spell_bonus_data.sql9
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp10
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp53
4 files changed, 72 insertions, 10 deletions
diff --git a/sql/updates/world/2012_09_09_02_world_spell_script_names.sql b/sql/updates/world/2012_09_09_02_world_spell_script_names.sql
new file mode 100644
index 00000000000..9c2beee82af
--- /dev/null
+++ b/sql/updates/world/2012_09_09_02_world_spell_script_names.sql
@@ -0,0 +1,10 @@
+-- Gabe der Naaru
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_gift_of_naaru';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(28880,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_WARRIOR
+(59542,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_PALADIN
+(59543,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_HUNTER
+(59544,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_PRIEST
+(59545,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_DEATHKNIGHT
+(59547,'spell_gen_gift_of_naaru'), -- SPELLFAMILY_SHAMAN
+(59548,'spell_gen_gift_of_naaru'); -- SPELLFAMILY_MAGE
diff --git a/sql/updates/world/2012_09_09_03_world_spell_bonus_data.sql b/sql/updates/world/2012_09_09_03_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..340bb8e28bc
--- /dev/null
+++ b/sql/updates/world/2012_09_09_03_world_spell_bonus_data.sql
@@ -0,0 +1,9 @@
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (28880,59542,59543,59544,59545,59547,59548)
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(28880,0,0,0,0,'Warrior - Gabe der Naaru'),
+(59542,0,0,0,0,'Paladin - Gabe der Naaru'),
+(59543,0,0,0,0,'Hunter - Gabe der Naaru'),
+(59544,0,0,0,0,'Priest - Gabe der Naaru'),
+(59545,0,0,0,0,'Deathknight - Gabe der Naaru'),
+(59547,0,0,0,0,'Shaman - Gabe der Naaru'),
+(59548,0,0,0,0,'Mage - Gabe der Naaru');
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 737d75cdf1c..52e282157b8 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -11263,16 +11263,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
}
- // Gift of the Naaru
- if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329)
- {
- int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK)));
- if (apBonus > DoneAdvertisedBenefit)
- DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick
- else
- DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick
- }
-
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
switch (spellProto->Effects[i].ApplyAuraName)
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index ed4148cd033..0a947afaa25 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3250,6 +3250,58 @@ class spell_gen_bonked : public SpellScriptLoader
}
};
+class spell_gen_gift_of_naaru : public SpellScriptLoader
+{
+ public:
+ spell_gen_gift_of_naaru() : SpellScriptLoader("spell_gen_gift_of_naaru") { }
+
+ class spell_gen_gift_of_naaru_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_gift_of_naaru_AuraScript);
+
+ void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster())
+ return;
+
+ float heal = 0.0f;
+ switch (GetSpellInfo()->SpellFamilyName)
+ {
+ case SPELLFAMILY_MAGE:
+ case SPELLFAMILY_WARLOCK:
+ case SPELLFAMILY_PRIEST:
+ heal = 1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()));
+ break;
+ case SPELLFAMILY_PALADIN:
+ case SPELLFAMILY_SHAMAN:
+ heal = std::max(1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())), 1.1f * float(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)));
+ break;
+ case SPELLFAMILY_WARRIOR:
+ case SPELLFAMILY_HUNTER:
+ case SPELLFAMILY_DEATHKNIGHT:
+ heal = 1.1f * float(std::max(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetCaster()->GetTotalAttackPowerValue(RANGED_ATTACK)));
+ break;
+ case SPELLFAMILY_GENERIC:
+ default:
+ break;
+ }
+
+ int32 healTick = floor(heal / aurEff->GetTotalTicks());
+ amount += int32(std::max(heal, 0.0f));
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_gift_of_naaru_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_gift_of_naaru_AuraScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -3325,4 +3377,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310);
new spell_gen_upper_deck_create_foam_sword();
new spell_gen_bonked();
+ new spell_gen_gift_of_naaru();
}