mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-05 03:53:48 +00:00
Big re-organization of repository [W.I.P]
This commit is contained in:
@@ -1,249 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum ExarchMaladaar
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_SUMMON = 1,
|
||||
SAY_AGGRO = 2,
|
||||
SAY_ROAR = 3,
|
||||
SAY_SLAY = 4,
|
||||
SAY_DEATH = 5,
|
||||
|
||||
SPELL_RIBBON_OF_SOULS = 32422,
|
||||
SPELL_SOUL_SCREAM = 32421,
|
||||
SPELL_STOLEN_SOUL = 32346,
|
||||
SPELL_STOLEN_SOUL_VISUAL = 32395,
|
||||
SPELL_SUMMON_AVATAR = 32424,
|
||||
|
||||
ENTRY_STOLEN_SOUL = 18441,
|
||||
|
||||
EVENT_SPELL_FEAR = 1,
|
||||
EVENT_SPELL_RIBBON = 2,
|
||||
EVENT_SPELL_SOUL = 3,
|
||||
EVENT_CHECK_HEALTH = 4
|
||||
};
|
||||
|
||||
class boss_exarch_maladaar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_exarch_maladaar() : CreatureScript("boss_exarch_maladaar") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_exarch_maladaarAI (creature);
|
||||
}
|
||||
|
||||
struct boss_exarch_maladaarAI : public ScriptedAI
|
||||
{
|
||||
boss_exarch_maladaarAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
_talked = false;
|
||||
}
|
||||
|
||||
bool _talked;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!_talked && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 150.0f))
|
||||
{
|
||||
Talk(SAY_INTRO);
|
||||
_talked = true;
|
||||
}
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_FEAR, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_RIBBON, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SOUL, 25000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 5000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (urand(0,1))
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
//When Exarch Maladar is defeated D'ore appear.
|
||||
me->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (HealthBelowPct(25))
|
||||
{
|
||||
Talk(SAY_SUMMON);
|
||||
me->CastSpell(me, SPELL_SUMMON_AVATAR, false);
|
||||
events.PopEvent();
|
||||
return;
|
||||
}
|
||||
events.RepeatEvent(2000);
|
||||
break;
|
||||
case EVENT_SPELL_SOUL:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
{
|
||||
Talk(SAY_ROAR);
|
||||
me->CastSpell(target, SPELL_STOLEN_SOUL, false);
|
||||
if (Creature* summon = me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000))
|
||||
{
|
||||
summon->CastSpell(summon, SPELL_STOLEN_SOUL_VISUAL, false);
|
||||
summon->SetDisplayId(target->GetDisplayId());
|
||||
summon->AI()->DoAction(target->getClass());
|
||||
summon->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
events.RepeatEvent(urand(25000, 30000));
|
||||
break;
|
||||
case EVENT_SPELL_RIBBON:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
|
||||
events.RepeatEvent(urand(10000, 20000));
|
||||
break;
|
||||
case EVENT_SPELL_FEAR:
|
||||
me->CastSpell(me, SPELL_SOUL_SCREAM, false);
|
||||
events.RepeatEvent(urand(15000, 25000));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
enum stolenSoul
|
||||
{
|
||||
SPELL_MOONFIRE = 37328,
|
||||
SPELL_FIREBALL = 37329,
|
||||
SPELL_MIND_FLAY = 37330,
|
||||
SPELL_HEMORRHAGE = 37331,
|
||||
SPELL_FROSTSHOCK = 37332,
|
||||
SPELL_CURSE_OF_AGONY = 37334,
|
||||
SPELL_MORTAL_STRIKE = 37335,
|
||||
SPELL_FREEZING_TRAP = 37368,
|
||||
SPELL_HAMMER_OF_JUSTICE = 37369,
|
||||
SPELL_PLAGUE_STRIKE = 58839,
|
||||
|
||||
EVENT_STOLEN_SOUL_SPELL = 1,
|
||||
};
|
||||
|
||||
class npc_stolen_soul : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_stolen_soul() : CreatureScript("npc_stolen_soul") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_stolen_soulAI (creature);
|
||||
}
|
||||
|
||||
struct npc_stolen_soulAI : public ScriptedAI
|
||||
{
|
||||
npc_stolen_soulAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
uint8 myClass;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
myClass = CLASS_WARRIOR;
|
||||
events.ScheduleEvent(EVENT_STOLEN_SOUL_SPELL, 1000);
|
||||
}
|
||||
|
||||
void DoAction(int32 pClass)
|
||||
{
|
||||
myClass = pClass;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (events.GetEvent() == EVENT_STOLEN_SOUL_SPELL)
|
||||
{
|
||||
switch (myClass)
|
||||
{
|
||||
case CLASS_WARRIOR:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MORTAL_STRIKE, false);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
case CLASS_PALADIN:
|
||||
me->CastSpell(me->GetVictim(), SPELL_HAMMER_OF_JUSTICE, false);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
case CLASS_HUNTER:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FREEZING_TRAP, false);
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
case CLASS_ROGUE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_HEMORRHAGE, false);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case CLASS_PRIEST:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MIND_FLAY, false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
case CLASS_SHAMAN:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FROSTSHOCK, false);
|
||||
events.RepeatEvent(8000);
|
||||
break;
|
||||
case CLASS_MAGE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FIREBALL, false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
case CLASS_WARLOCK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CURSE_OF_AGONY, false);
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
case CLASS_DRUID:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MOONFIRE, false);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
me->CastSpell(me->GetVictim(), SPELL_PLAGUE_STRIKE, false);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_exarch_maladaar()
|
||||
{
|
||||
new boss_exarch_maladaar();
|
||||
new npc_stolen_soul();
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum eShirrak
|
||||
{
|
||||
|
||||
SPELL_INHIBIT_MAGIC = 32264,
|
||||
SPELL_ATTRACT_MAGIC = 32265,
|
||||
SPELL_CARNIVOROUS_BITE_N = 36383,
|
||||
SPELL_CARNIVOROUS_BITE_H = 39382,
|
||||
|
||||
SPELL_FIERY_BLAST_N = 32302,
|
||||
SPELL_FIERY_BLAST_H = 38382,
|
||||
SPELL_FOCUS_FIRE_VISUAL = 32286,
|
||||
SPELL_FOCUS_CAST = 32300,
|
||||
|
||||
EVENT_SPELL_INHIBIT_MAGIC = 1,
|
||||
EVENT_SPELL_ATTRACT_MAGIC = 2,
|
||||
EVENT_SPELL_CARNIVOROUS = 3,
|
||||
EVENT_SPELL_FOCUS_FIRE = 4,
|
||||
EVENT_SPELL_FOCUS_FIRE_2 = 5,
|
||||
EVENT_SPELL_FOCUS_FIRE_3 = 6,
|
||||
|
||||
ENTRY_FOCUS_FIRE = 18374,
|
||||
|
||||
EMOTE_FOCUSED = 0
|
||||
};
|
||||
|
||||
class boss_shirrak_the_dead_watcher : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_shirrak_the_dead_watcher() : CreatureScript("boss_shirrak_the_dead_watcher") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_shirrak_the_dead_watcherAI (creature);
|
||||
}
|
||||
|
||||
struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
|
||||
{
|
||||
boss_shirrak_the_dead_watcherAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
uint64 focusGUID;
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
focusGUID = 0;
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_INHIBIT_MAGIC, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_ATTRACT_MAGIC, 28000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CARNIVOROUS, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE, 17000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summon->CastSpell(summon, SPELL_FOCUS_FIRE_VISUAL, true);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Id == SPELL_FOCUS_CAST)
|
||||
target->CastSpell(target, DUNGEON_MODE(SPELL_FIERY_BLAST_N, SPELL_FIERY_BLAST_H), false);
|
||||
}
|
||||
|
||||
uint8 getStackCount(float dist)
|
||||
{
|
||||
if (dist < 15)
|
||||
return 4;
|
||||
if (dist < 25)
|
||||
return 3;
|
||||
if (dist < 35)
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events.Update(diff);
|
||||
uint32 eventId = events.GetEvent();
|
||||
|
||||
if (eventId == EVENT_SPELL_INHIBIT_MAGIC)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
{
|
||||
float dist = me->GetDistance(player);
|
||||
if (player->IsAlive() && dist < 45.0f)
|
||||
{
|
||||
Aura* aura = player->GetAura(SPELL_INHIBIT_MAGIC);
|
||||
if (!aura)
|
||||
aura = me->AddAura(SPELL_INHIBIT_MAGIC, player);
|
||||
else
|
||||
aura->RefreshDuration();
|
||||
|
||||
if (aura)
|
||||
aura->SetStackAmount(getStackCount(dist));
|
||||
}
|
||||
else
|
||||
player->RemoveAurasDueToSpell(SPELL_INHIBIT_MAGIC);
|
||||
}
|
||||
events.RepeatEvent(3000);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SPELL_ATTRACT_MAGIC:
|
||||
me->CastSpell(me, SPELL_ATTRACT_MAGIC, false);
|
||||
events.RepeatEvent(30000);
|
||||
events.RescheduleEvent(EVENT_SPELL_CARNIVOROUS, 1500);
|
||||
break;
|
||||
case EVENT_SPELL_CARNIVOROUS:
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_CARNIVOROUS_BITE_N, SPELL_CARNIVOROUS_BITE_H), false);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case EVENT_SPELL_FOCUS_FIRE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
|
||||
{
|
||||
if (Creature* cr = me->SummonCreature(ENTRY_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 7000))
|
||||
focusGUID = cr->GetGUID();
|
||||
Talk(EMOTE_FOCUSED, target);
|
||||
}
|
||||
events.RepeatEvent(urand(15000, 20000));
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_2, 3000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_2, 3500);
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_2, 4000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_3, 5000);
|
||||
me->SetControlled(true, UNIT_STATE_ROOT);
|
||||
break;
|
||||
case EVENT_SPELL_FOCUS_FIRE_2:
|
||||
if (Unit* flare = ObjectAccessor::GetCreature(*me, focusGUID))
|
||||
me->CastSpell(flare, SPELL_FOCUS_CAST, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_SPELL_FOCUS_FIRE_3:
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_auchenai_possess : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_auchenai_possess() : SpellScriptLoader("spell_auchenai_possess") { }
|
||||
|
||||
class spell_auchenai_possess_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_auchenai_possess_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetTarget())
|
||||
caster->CastSpell(target, 32830 /*POSSESS*/, true);
|
||||
}
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
isPeriodic = true;
|
||||
amplitude = 2000;
|
||||
}
|
||||
|
||||
void Update(AuraEffect* effect)
|
||||
{
|
||||
// Xinef: Charm is removed when target is at or below 50%hp
|
||||
if (Unit* owner = GetUnitOwner())
|
||||
if (owner->GetHealthPct() <= 50)
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// Base channel
|
||||
if (m_scriptSpellId == 33401)
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_auchenai_possess_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
else
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_auchenai_possess_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_MOD_CHARM);
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_auchenai_possess_AuraScript::Update, EFFECT_0, SPELL_AURA_MOD_CHARM);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_auchenai_possess_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_shirrak_the_dead_watcher()
|
||||
{
|
||||
new boss_shirrak_the_dead_watcher();
|
||||
new spell_auchenai_possess();
|
||||
}
|
||||
Reference in New Issue
Block a user