94 if (!
me->GetCurrentEquipmentId())
95 me->SetCurrentEquipmentId(
me->GetOriginalEquipmentId());
114 me->LoadEquipment(0,
true);
165 if (
Creature* anchor =
me->FindNearestCreature(29521, 30))
167 anchor->AI()->SetGUID(
me->GetGUID());
172 SF_LOG_ERROR(
"scripts",
"npc_unworthy_initiateAI: unable to find anchor!");
177 for (
uint8 i = 0; i < 12; ++i)
181 if (
me->IsWithinDist(temp_prison, dist,
false))
183 dist =
me->GetDistance2d(temp_prison);
184 prison = temp_prison;
192 SF_LOG_ERROR(
"scripts",
"npc_unworthy_initiateAI: unable to find prison!");
305 if (
uint64 prisonerGUID = anchor->AI()->GetGUID())
317#define GOSSIP_ACCEPT_DUEL "I challenge you, death knight!"
345 player->PlayerTalkClass->ClearMenus();
348 player->CLOSE_GOSSIP_MENU();
350 if (player->IsInCombat() || creature->IsInCombat())
355 if (pInitiateAI->m_bIsDuelInProgress)
364 player->CastSpell(creature,
SPELL_DUEL,
false);
374 if (player->HealthBelowPct(10))
377 if (player->IsInCombat() || creature->IsInCombat())
381 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
406 me->RestoreFaction();
431 else if (uiDamage >=
me->GetHealth())
438 pDoneBy->AttackStop();
441 me->CastSpell(
me, 7267,
true);
442 me->RestoreFaction();
471 if (!
me->HasAura(7267))
477 me->GetVictim()->CastSpell(
me->GetVictim(), 7267,
true);
539 me->SetVisible(
false);
544 me->DespawnOrUnsummon();
562 me->GetMotionMaster()->MoveChase(who);
619 caster->setFaction(35);
621 if (
Creature* Dark_Rider =
me->FindNearestCreature(28654, 15))
642 player->GroupEventHappens(12687,
me);
646 creature->DespawnOrUnsummon();
685 Creature* deathcharger =
me->FindNearestCreature(28782, 30);
693 me->EnterVehicle(deathcharger);
698 Creature* deathcharger =
me->FindNearestCreature(28782, 30);
737 if (who->GetEntry() ==
NPC_GHOULS &&
me->IsWithinDistInMap(who, 10.0f))
784 std::list<Creature*> MinionList;
787 if (!MinionList.empty())
789 for (std::list<Creature*>::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr)
791 if ((*itr)->GetOwner()->GetGUID() ==
me->GetOwner()->GetGUID())
793 if ((*itr)->IsInCombat() && (*itr)->getAttackerForHelper())
804 if (!
me->IsInCombat())
806 if (
Unit* owner =
me->GetOwner())
826 if (
me->isAttackReady())
829 if (
me->IsWithinMeleeRange(
me->GetVictim()))
831 me->AttackerStateUpdate(
me->GetVictim());
832 me->resetAttackTimer();
864 me->SetDisplayId(
me->GetCreatureTemplate()->Modelid1);
892 me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0);
907 miner->DespawnOrUnsummon();
962 AddWaypoint(1, 2389.03f, -5902.74f, 109.014f, 5000);
963 AddWaypoint(2, 2341.812012f, -5900.484863f, 102.619743f);
964 AddWaypoint(3, 2306.561279f, -5901.738281f, 91.792419f);
965 AddWaypoint(4, 2300.098389f, -5912.618652f, 86.014885f);
966 AddWaypoint(5, 2294.142090f, -5927.274414f, 75.316849f);
967 AddWaypoint(6, 2286.984375f, -5944.955566f, 63.714966f);
968 AddWaypoint(7, 2280.001709f, -5961.186035f, 54.228283f);
969 AddWaypoint(8, 2259.389648f, -5974.197754f, 42.359348f);
970 AddWaypoint(9, 2242.882812f, -5984.642578f, 32.827850f);
971 AddWaypoint(10, 2217.265625f, -6028.959473f, 7.675705f);
972 AddWaypoint(11, 2202.595947f, -6061.325684f, 5.882018f);
973 AddWaypoint(12, 2188.974609f, -6080.866699f, 3.370027f);
977 AddWaypoint(13, 2176.483887f, -6110.407227f, 1.855181f);
978 AddWaypoint(14, 2172.516602f, -6146.752441f, 1.074235f);
979 AddWaypoint(15, 2138.918457f, -6158.920898f, 1.342926f);
980 AddWaypoint(16, 2129.866699f, -6174.107910f, 4.380779f);
981 AddWaypoint(17, 2117.709473f, -6193.830078f, 13.3542f, 10000);
985 AddWaypoint(13, 2184.190186f, -6166.447266f, 0.968877f);
986 AddWaypoint(14, 2234.265625f, -6163.741211f, 0.916021f);
987 AddWaypoint(15, 2268.071777f, -6158.750977f, 1.822252f);
988 AddWaypoint(16, 2270.028320f, -6176.505859f, 6.340538f);
989 AddWaypoint(17, 2271.739014f, -6195.401855f, 13.3542f, 10000);
996 Start(
false,
false, guid);
1006 me->SetFacingToObject(car);
1015 me->SetFacingToObject(car);
1016 car->Relocate(car->GetPositionX(), car->GetPositionY(),
me->GetPositionZ() + 1);
1043 car->AI()->DoAction(0);
1095 if (
Player* owner =
me->GetCharmerOrOwner()->ToPlayer())
1096 me->GetCharmInfo()->InitPossessCreateSpells();
1132 creature->AI()->AttackStart(target);
1138 switch (
events.ExecuteEvent())
1142 if (
Player* player =
me->GetCharmerOrOwnerPlayerOrPlayerItself())
1145 player->SetClientControl(
me, 0);
1155 const Position EYE_DESTINATION_1 = {
me->GetPositionX() - 40.0f,
me->GetPositionY(),
me->GetPositionZ() + 10.0f, 0.0f };
1156 const Position EYE_DESTINATION_2 = { 1768.0f, -5876.0f, 153.0f, 0.0f };
1163 if (
Player* player =
me->GetCharmerOrOwnerPlayerOrPlayerItself())
1169 player->SetClientControl(
me, 1);
1193 GetCaster()->
CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 54522,
true);
#define SF_LOG_ERROR(filterType__,...)
@ QUEST_STATUS_INCOMPLETE
@ SPELL_EFFECT_SCRIPT_EFFECT
#define SpellEffectFn(F, I, N)
@ UNIT_NPC_FLAG_SPELLCLICK
@ UNIT_NPC_FLAG_PLAYER_VEHICLE
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_IMMUNE_TO_NPC
@ UNIT_FLAG_NOT_SELECTABLE
@ SPELL_EFFECT_STOLEN_HORSE
@ SPELL_DELIVER_STOLEN_HORSE
void AddSC_the_scarlet_enclave_c1()
@ EYE_POINT_DESTINATION_2
@ SPELL_THE_EYE_OF_ACHERUS
@ EYE_POINT_DESTINATION_1
#define GOSSIP_ACCEPT_DUEL
uint32 acherus_soul_prison[12]
uint32 acherus_unworthy_initiate[5]
@ SPELL_DK_INITIATE_VISUAL
@ SPELL_SOUL_PRISON_CHAIN
@ SPELL_SOUL_PRISON_CHAIN_SELF
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
virtual void MoveInLineOfSight(Unit *)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
virtual void EnterEvadeMode()
void SetDisplayId(uint32 modelId) OVERRIDE
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
void SetReactState(ReactStates st)
CreatureTemplate const * GetCreatureTemplate() const
CreatureScript(const char *name)
GameObjectScript(const char *name)
NullCreatureAI(Creature *c)
static Creature * GetCreature(WorldObject const &u, uint64 guid)
static Player * GetPlayer(WorldObject const &, uint64 guid)
static Unit * GetUnit(WorldObject const &, uint64 guid)
void SetFlag(uint16 index, uint32 newFlag)
void RemoveFlag(uint16 index, uint32 oldFlag)
HookList< EffectHandler > OnEffectHitTarget
void PreventHitEffect(SpellEffIndex effIndex)
SpellScriptLoader(const char *name)
void DoMeleeAttackIfReady()
void DoCast(uint32 spellId)
void DoCastVictim(uint32 spellId, bool triggered=false)
virtual void AttackStart(Unit *)
void setFaction(uint32 faction)
Unit * SelectNearbyTarget(Unit *exclude=NULL, float dist=NOMINAL_MELEE_RANGE) const
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
Unit * GetCharmer() const
Unit * getAttackerForHelper() const
static Creature * GetCreature(WorldObject &object, uint64 guid)
static Unit * GetUnit(WorldObject &object, uint64 guid)
Vehicle * GetVehicleKit() const
void GetAllMinionsByEntry(std::list< Creature * > &Minions, uint32 entry)
bool HasEmptySeat(int8 seatId) const
Checks if vehicle's seat specified by 'seatId' is empty.
void GetContactPoint(WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
bool OnGossipHello(Player *player, GameObject *go) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
npc_dark_rider_of_acherus()
npc_death_knight_initiate()
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
npc_salanar_the_horseman()
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
npc_unworthy_initiate_anchor()
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
void HandleScriptEffect(SpellEffIndex effIndex)
PrepareSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
spell_q12641_death_comes_from_on_high_summon_ghouls()
ScriptedAI(Creature *creature)
void AttackStart(Unit *) OVERRIDE
npc_dark_rider_of_acherusAI(Creature *creature)
void InitDespawnHorse(Unit *who)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================
void SpellHit(Unit *pCaster, const SpellInfo *pSpell) OVERRIDE
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage) OVERRIDE
npc_death_knight_initiateAI(Creature *creature)
npc_dkc1_gothikAI(Creature *creature)
void MoveInLineOfSight(Unit *who) OVERRIDE
void SetDespawnAtFar(bool despawn)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SetRun(bool on=true)
npc_escortAI(Creature *creature)
void Start(bool isActiveAttacker=true, bool run=false, uint64 playerGUID=0, Quest const *quest=NULL, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
void AddWaypoint(uint32 id, float x, float y, float z, uint32 waitTime=0)
void InitializeAI() OVERRIDE
npc_eye_of_acherusAI(Creature *creature)
void JustSummoned(Creature *creature) OVERRIDE
void OnCharmed(bool apply) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void MovementInform(uint32 type, uint32 point) OVERRIDE
npc_ros_dark_riderAI(Creature *creature)
void EnterCombat(Unit *) OVERRIDE
void JustDied(Unit *killer) OVERRIDE
void MoveInLineOfSight(Unit *who) OVERRIDE
void SpellHit(Unit *caster, const SpellInfo *spell) OVERRIDE
npc_salanar_the_horsemanAI(Creature *creature)
void FindMinions(Unit *owner)
npc_scarlet_ghoulAI(Creature *creature)
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void SetGUID(uint64 guid, int32) OVERRIDE
npc_scarlet_minerAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void WaypointReached(uint32 waypointId) OVERRIDE
void IsSummonedBy(Unit *summoner) OVERRIDE
void SummonedCreatureDespawn(Creature *summon) OVERRIDE
npc_scarlet_miner_cartAI(Creature *creature)
void DoAction(int32) OVERRIDE
void PassengerBoarded(Unit *who, int8, bool apply) OVERRIDE
== Fields =======================================
void JustSummoned(Creature *summon) OVERRIDE
void EventStart(Creature *anchor, Player *target)
void EnterCombat(Unit *) OVERRIDE
UnworthyInitiatePhase phase
void MovementInform(uint32 type, uint32 id) OVERRIDE
npc_unworthy_initiateAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
npc_unworthy_initiate_anchorAI(Creature *creature)
void SetGUID(uint64 guid, int32) OVERRIDE
uint64 GetGUID(int32) const OVERRIDE