Merge pull request #4354 from elecyb/eletotem2
Core/Spells: Added spells for Fire Elemental Totem and Earth Elemental T...
This commit is contained in:
@@ -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;
|
||||
@@ -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');
|
||||
@@ -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;
|
||||
|
||||
@@ -2163,6 +2163,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user