aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2011_12_16_00_world_creature_template.sql4
-rw-r--r--sql/updates/world/2011_12_16_00_world_spell_bonus_data.sql5
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.cpp1
-rw-r--r--src/server/scripts/World/npcs_special.cpp117
4 files changed, 127 insertions, 0 deletions
diff --git a/sql/updates/world/2011_12_16_00_world_creature_template.sql b/sql/updates/world/2011_12_16_00_world_creature_template.sql
new file mode 100644
index 00000000000..156fd431359
--- /dev/null
+++ b/sql/updates/world/2011_12_16_00_world_creature_template.sql
@@ -0,0 +1,4 @@
+-- Greater Fire Elemental script
+UPDATE `creature_template` SET `ScriptName`='npc_fire_elemental' WHERE `entry`=15438;
+-- Greater Earth Elemental script
+UPDATE `creature_template` SET `ScriptName`='npc_earth_elemental' WHERE `entry`=15352; \ No newline at end of file
diff --git a/sql/updates/world/2011_12_16_00_world_spell_bonus_data.sql b/sql/updates/world/2011_12_16_00_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..3250bda4fdb
--- /dev/null
+++ b/sql/updates/world/2011_12_16_00_world_spell_bonus_data.sql
@@ -0,0 +1,5 @@
+-- Bounus coef for Greater Fire Elemental spells
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (13376,57984);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`,`ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(13376,0.032,-1,-1,-1,'Greater Fire Elemental - Fire Shield'),
+(57984,0.4289,-1,-1,-1,'Greater Fire Elemental - Fire Blast'); \ No newline at end of file
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 404fe24d467..f730363d0c6 100755
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -908,6 +908,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
SetCreateHealth(40*petlevel);
SetCreateMana(28 + 10*petlevel);
}
+ SetBonusDamage(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) * 0.5f);
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4 - petlevel));
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4 + petlevel));
break;
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index a5e5b467fc7..6ea25149734 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -2164,6 +2164,121 @@ public:
};
/*######
+# npc_fire_elemental
+######*/
+#define SPELL_FIRENOVA 12470
+#define SPELL_FIRESHIELD 13376
+#define SPELL_FIREBLAST 57984
+
+class npc_fire_elemental : public CreatureScript
+{
+public:
+ npc_fire_elemental() : CreatureScript("npc_fire_elemental") { }
+
+ struct npc_fire_elementalAI : public ScriptedAI
+ {
+ npc_fire_elementalAI(Creature* creature) : ScriptedAI(creature) {}
+
+ uint32 FireNova_Timer;
+ uint32 FireShield_Timer;
+ uint32 FireBlast_Timer;
+
+ void Reset()
+ {
+ FireNova_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ FireBlast_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ FireShield_Timer = 0;
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->HasUnitState(UNIT_STAT_CASTING))
+ return;
+
+ if (FireShield_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIRESHIELD);
+ FireShield_Timer = 2 * IN_MILLISECONDS;
+ }
+ else
+ FireShield_Timer -= diff;
+
+ if (FireBlast_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIREBLAST);
+ FireBlast_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ }
+ else
+ FireBlast_Timer -= diff;
+
+ if (FireNova_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIRENOVA);
+ FireNova_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ }
+ else
+ FireNova_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI *GetAI(Creature* creature) const
+ {
+ return new npc_fire_elementalAI(creature);
+ }
+};
+
+/*######
+# npc_earth_elemental
+######*/
+#define SPELL_ANGEREDEARTH 36213
+
+class npc_earth_elemental : public CreatureScript
+{
+public:
+ npc_earth_elemental() : CreatureScript("npc_earth_elemental") { }
+
+ struct npc_earth_elementalAI : public ScriptedAI
+ {
+ npc_earth_elementalAI(Creature* creature) : ScriptedAI(creature) {}
+
+ uint32 AngeredEarth_Timer;
+
+ void Reset()
+ {
+ AngeredEarth_Timer = 0;
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (AngeredEarth_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ANGEREDEARTH);
+ AngeredEarth_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ }
+ else
+ AngeredEarth_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI *GetAI(Creature* creature) const
+ {
+ return new npc_earth_elementalAI(creature);
+ }
+};
+
+/*######
# npc_wormhole
######*/
@@ -2673,5 +2788,7 @@ void AddSC_npcs_special()
new npc_locksmith;
new npc_tabard_vendor;
new npc_experience;
+ new npc_fire_elemental;
+ new npc_earth_elemental;
}