aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortartalo <none@none>2009-10-24 17:46:44 +0200
committertartalo <none@none>2009-10-24 17:46:44 +0200
commitfc06abc3064644574b28ce4ff0e81dda7148a3cc (patch)
treef09045176f7ae33d23703014674b818269a3f469
parent80084749c9bfb7901526a6575919962cd9354d24 (diff)
Ahn'Kahet, Amanitar: clean up + optimization
--HG-- branch : trunk
-rw-r--r--src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp37
1 files changed, 15 insertions, 22 deletions
diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp
index 50316858ca5..a8d8f57f41c 100644
--- a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp
+++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp
@@ -70,13 +70,15 @@ struct MANGOS_DLL_DECL boss_amanitarAI : public ScriptedAI
m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
- if (pInstance && !FirstTime)
- pInstance->SetData(DATA_AMANITAR_EVENT, FAIL);
-
- FirstTime = false;
-
if (pInstance)
+ {
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
+ if (pInstance && !FirstTime)
+ {
+ pInstance->SetData(DATA_AMANITAR_EVENT, FAIL);
+ FirstTime = false;
+ }
+ }
}
void JustDied(Unit *Killer)
@@ -90,8 +92,6 @@ struct MANGOS_DLL_DECL boss_amanitarAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- m_creature->SetInCombatWithZone();
-
if (pInstance)
pInstance->SetData(DATA_AMANITAR_EVENT, IN_PROGRESS);
@@ -100,10 +100,6 @@ struct MANGOS_DLL_DECL boss_amanitarAI : public ScriptedAI
void SpawnAdds()
{
- uint32 DSpwTime = 30000;
- float x = 0.0f, y = 0.0f, z = 0.0f;
- TempSummonType DSpwType = TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN;
-
for (uint8 i = 0; i < 30; ++i)
{
Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -113,9 +109,9 @@ struct MANGOS_DLL_DECL boss_amanitarAI : public ScriptedAI
Position pos;
victim->GetPosition(&pos);
m_creature->GetRandomNearPosition(pos, float(urand(5,80)));
- m_creature->SummonCreature(PoisonousMushroom, pos, DSpwType, DSpwTime);
+ m_creature->SummonCreature(PoisonousMushroom, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
m_creature->GetRandomNearPosition(pos, float(urand(5,80)));
- m_creature->SummonCreature(HealthyMushroom, pos, DSpwType, DSpwTime);
+ m_creature->SummonCreature(HealthyMushroom, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
}
}
}
@@ -175,17 +171,15 @@ struct MANGOS_DLL_DECL mob_amanitar_mushroomsAI : public Scripted_NoMovementAI
deathtimer = 30000;
}
- void DamageTaken(Unit *killer, uint32 &damage)
+ void JustDied(Unit *killer)
{
- if (!killer || !damage) return;
+ if (!killer)
+ return;
- if (m_creature->GetEntry() == HealthyMushroom && damage >= m_creature->GetHealth())
+ if (m_creature->GetEntry() == HealthyMushroom && killer->GetTypeId() == TYPEID_PLAYER)
{
- if (killer->GetTypeId() == TYPEID_PLAYER && m_creature->GetDistance(killer) <= 3.0f)
- {
- m_creature->InterruptNonMeleeSpells(false);
- m_creature->CastSpell(killer, HEALTHY_MUSHROOM_SPELL_POTENT_FUNGUS, false);
- }
+ m_creature->InterruptNonMeleeSpells(false);
+ m_creature->CastSpell(killer, HEALTHY_MUSHROOM_SPELL_POTENT_FUNGUS, false);
}
}
@@ -206,7 +200,6 @@ struct MANGOS_DLL_DECL mob_amanitar_mushroomsAI : public Scripted_NoMovementAI
if (deathtimer < diff)
{
m_creature->DisappearAndDie();
- deathtimer = 30000;
} else deathtimer -= diff;
}
};