*modified spelldifficulty handler to work with all spell casts for creatures that are in instances thanks to Shauren for help

*modified most of the scripts to use normal_mode spell for casting (code was autogenerated, post errors if any)
*added sql for all modded spells (autogenerated..)

--HG--
branch : trunk
This commit is contained in:
Rat
2010-04-10 10:20:01 +02:00
parent 8bb3b39495
commit 4a8bf5900d
79 changed files with 419 additions and 242 deletions
@@ -198,7 +198,7 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
if (!m_creature->hasUnitState(UNIT_STAT_CASTING))
{
if (bIsUndead)
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_WOE_STRIKE, H_SPELL_WOE_STRIKE));
DoCast(m_creature->getVictim(), SPELL_WOE_STRIKE);
else
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
uiCleaveTimer = rand()%5000 + 2000;
@@ -212,7 +212,7 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
if (bIsUndead)
DoCast(m_creature->getVictim(), SPELL_DARK_SMASH);
else
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SMASH, H_SPELL_SMASH));
DoCast(m_creature->getVictim(), SPELL_SMASH);
uiSmashTimer = 10000;
}
} else uiSmashTimer -= diff;
@@ -221,7 +221,7 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
{
if (uiEnrageTimer <= diff)
{
DoCast(m_creature, DUNGEON_MODE(SPELL_ENRAGE, H_SPELL_ENRAGE));
DoCast(m_creature, SPELL_ENRAGE);
uiEnrageTimer = 10000;
} else uiEnrageTimer -= diff;
} else // In Undead form used to summon weapon
@@ -248,9 +248,9 @@ struct boss_ingvar_the_plundererAI : public ScriptedAI
if (!m_creature->hasUnitState(UNIT_STAT_CASTING))
{
if (bIsUndead)
DoCast(m_creature, DUNGEON_MODE(SPELL_DREADFUL_ROAR, H_SPELL_DREADFUL_ROAR));
DoCast(m_creature, SPELL_DREADFUL_ROAR);
else
DoCast(m_creature, DUNGEON_MODE(SPELL_STAGGERING_ROAR, H_SPELL_STAGGERING_ROAR));
DoCast(m_creature, SPELL_STAGGERING_ROAR);
uiRoarTimer = 10000;
}
} else uiRoarTimer -= diff;
@@ -395,7 +395,7 @@ struct mob_ingvar_throw_dummyAI : public ScriptedAI
Unit *pTarget = m_creature->FindNearestCreature(ENTRY_THROW_TARGET,50);
if (pTarget)
{
DoCast(m_creature, DUNGEON_MODE(SPELL_SHADOW_AXE_DAMAGE, H_SPELL_SHADOW_AXE_DAMAGE));
DoCast(m_creature, SPELL_SHADOW_AXE_DAMAGE);
float x,y,z;
pTarget->GetPosition(x,y,z);
m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
@@ -340,7 +340,7 @@ struct boss_dalronn_the_controllerAI : public ScriptedAI
{
if (!m_creature->IsNonMeleeSpellCasted(false))
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), DUNGEON_MODE(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT));
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOW_BOLT);
ShadowBolt_Timer = 2100;//give a 100ms pause to try cast other spells
}
} else ShadowBolt_Timer -= diff;
@@ -164,13 +164,13 @@ struct boss_palehoofAI : public ScriptedAI
if (uiImpaleTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, DUNGEON_MODE(SPELL_IMPALE, H_SPELL_IMPALE));
DoCast(pTarget, SPELL_IMPALE);
uiImpaleTimer = urand(8000,12000);
} else uiImpaleTimer -= diff;
if (uiWhiteringRoarTimer <= diff)
{
DoCast(m_creature, DUNGEON_MODE(SPELL_WITHERING_ROAR, H_SPELL_WITHERING_ROAR));
DoCast(m_creature, SPELL_WITHERING_ROAR);
uiWhiteringRoarTimer = urand(8000,12000);
} else uiWhiteringRoarTimer -= diff;
@@ -290,7 +290,7 @@ struct mob_ravenous_furbolgAI : public ScriptedAI
if (uiChainLightingTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_CHAIN_LIGHTING, H_SPELL_CHAIN_LIGHTING));
DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTING);
uiChainLightingTimer = 5000 + rand()%5000;
} else uiChainLightingTimer -= diff;
@@ -396,7 +396,7 @@ struct mob_frenzied_worgenAI : public ScriptedAI
if (uiMortalWoundTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_MORTAL_WOUND, H_SPELL_MORTAL_WOUND));
DoCast(m_creature->getVictim(), SPELL_MORTAL_WOUND);
uiMortalWoundTimer = 3000 + rand()%4000;
} else uiMortalWoundTimer -= diff;
@@ -511,14 +511,14 @@ struct mob_ferocious_rhinoAI : public ScriptedAI
if (uiGoreTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_GORE, H_SPELL_GORE));
DoCast(m_creature->getVictim(), SPELL_GORE);
uiGoreTimer = 13000 + rand()%4000;
} else uiGoreTimer -= diff;
if (uiGrievousWoundTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, DUNGEON_MODE(SPELL_GRIEVOUS_WOUND, H_SPELL_GRIEVOUS_WOUND));
DoCast(pTarget, SPELL_GRIEVOUS_WOUND);
uiGrievousWoundTimer = 18000 + rand()%4000;
} else uiGrievousWoundTimer -= diff;
@@ -625,14 +625,14 @@ struct mob_massive_jormungarAI : public ScriptedAI
if (uiAcidSplatterTimer <= diff)
{
DoCast(m_creature, DUNGEON_MODE(SPELL_POISON_BREATH, H_SPELL_POISON_BREATH));
DoCast(m_creature, SPELL_POISON_BREATH);
uiAcidSplatterTimer = 10000 + rand()%4000;
} else uiAcidSplatterTimer -= diff;
if (uiPoisonBreathTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, DUNGEON_MODE(SPELL_POISON_BREATH, H_SPELL_POISON_BREATH));
DoCast(pTarget, SPELL_POISON_BREATH);
uiPoisonBreathTimer = 8000 + rand()%4000;
} else uiPoisonBreathTimer -= diff;
@@ -149,14 +149,14 @@ struct boss_skadiAI : public ScriptedAI
if (uiCrushTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_CRUSH, H_SPELL_CRUSH));
DoCast(m_creature->getVictim(), SPELL_CRUSH);
uiCrushTimer = 8000;
} else uiCrushTimer -= diff;
if (uiPoisonedSpearTimer <= diff)
{
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, DUNGEON_MODE(SPELL_POISONED_SPEAR, H_SPELL_POISONED_SPEAR));
DoCast(pTarget, SPELL_POISONED_SPEAR);
uiPoisonedSpearTimer = 10000;
} else uiPoisonedSpearTimer -= diff;
@@ -292,7 +292,7 @@ struct boss_svala_sorrowgraveAI : public ScriptedAI
if (uiSinsterStrikeTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SINSTER_STRIKE, H_SPELL_SINSTER_STRIKE));
DoCast(m_creature->getVictim(), SPELL_SINSTER_STRIKE);
uiSinsterStrikeTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS);
} else uiSinsterStrikeTimer -= diff;
@@ -218,13 +218,13 @@ struct boss_ymironAI : public ScriptedAI
// Normal spells ------------------------------------------------------------------------
if (m_uiBane_Timer <= diff)
{
DoCast(m_creature, DUNGEON_MODE(SPELL_BANE, H_SPELL_BANE));
DoCast(m_creature, SPELL_BANE);
m_uiBane_Timer = urand(20000,25000);
} else m_uiBane_Timer -= diff;
if (m_uiFetidRot_Timer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_FETID_ROT, H_SPELL_FETID_ROT));
DoCast(m_creature->getVictim(), SPELL_FETID_ROT);
m_uiFetidRot_Timer = urand(10000,15000);
} else m_uiFetidRot_Timer -= diff;
@@ -259,13 +259,13 @@ struct boss_ymironAI : public ScriptedAI
if (m_bIsActiveWithHALDOR && m_uiAbility_HALDOR_Timer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SPIRIT_STRIKE, H_SPELL_SPIRIT_STRIKE));
DoCast(m_creature->getVictim(), SPELL_SPIRIT_STRIKE);
m_uiAbility_HALDOR_Timer = 5000; // overtime
} else m_uiAbility_HALDOR_Timer -= diff;
if (m_bIsActiveWithRANULF && m_uiAbility_RANULF_Timer <= diff)
{
DoCast(m_creature, DUNGEON_MODE(SPELL_SPIRIT_BURST, H_SPELL_SPIRIT_BURST));
DoCast(m_creature, SPELL_SPIRIT_BURST);
m_uiAbility_RANULF_Timer = 10000; // overtime
} else m_uiAbility_RANULF_Timer -= diff;