Merge [SD2]

r1314 Correct some spellId's and apply SD2 code style
r1315 Correct more spells and apply SD2 code style
r1316 Replace magic number with enum type name UNIT_DYNFLAG_DEAD
r1317 Add support for quest 1249. Patch by jotapdiez
r1318 Move AI's implementation from headers. Original patch/idea by DasBlub
r1319 Convert script related to quest 938 to use followerAI
r1320 Add new virtual function WaypointStart() to escortAI.

--HG--
branch : trunk
This commit is contained in:
Kudlaty
2009-08-16 21:46:31 +02:00
parent 81ee07fa2a
commit 91f3d69edf
20 changed files with 332 additions and 153 deletions

View File

@@ -13,6 +13,16 @@ CREATE TABLE script_waypoint (
PRIMARY KEY (entry, pointid)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints';
DELETE FROM script_waypoint WHERE entry=4962;
INSERT INTO script_waypoint VALUES
(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''),
(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''),
(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''),
(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''),
(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''),
(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''),
(4962, 6, -3690.224121, -862.261597, 9.960449, 0, '');
DELETE FROM script_waypoint WHERE entry=10638;
INSERT INTO script_waypoint VALUES
(10638, 0, -4903.521973, -1368.339844, -52.611, 5000, 'SAY_KAN_START'),

View File

@@ -1086,6 +1086,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_defias_traitor' WHERE `entry`=4
UPDATE `creature_template` SET `ScriptName`='npc_daphne_stilwell' WHERE `entry`=6182;
/* WETLANDS */
UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962;
UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963;
/* WINTERSPRING */
UPDATE `creature_template` SET `ScriptName`='npc_lorax' WHERE `entry`=10918;

View File

@@ -0,0 +1,12 @@
UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962;
UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963;
DELETE FROM script_waypoint WHERE entry=4962;
INSERT INTO script_waypoint VALUES
(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''),
(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''),
(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''),
(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''),
(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''),
(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''),
(4962, 6, -3690.224121, -862.261597, 9.960449, 0, '');

View File

@@ -192,6 +192,7 @@ SET(trinityscript_LIB_SRCS
scripts/eastern_kingdoms/undercity.cpp
scripts/eastern_kingdoms/western_plaguelands.cpp
scripts/eastern_kingdoms/westfall.cpp
scripts/eastern_kingdoms/wetlands.cpp
scripts/examples/example_creature.cpp
scripts/examples/example_escort.cpp
scripts/examples/example_gossip_codebox.cpp

View File

@@ -1162,6 +1162,10 @@
RelativePath="..\scripts\eastern_kingdoms\westfall.cpp"
>
</File>
<File
RelativePath="..\scripts\eastern_kingdoms\wetlands.cpp"
>
</File>
</Filter>
<Filter
Name="examples"

View File

@@ -1159,6 +1159,10 @@
RelativePath="..\scripts\eastern_kingdoms\westfall.cpp"
>
</File>
<File
RelativePath="..\scripts\eastern_kingdoms\wetlands.cpp"
>
</File>
</Filter>
<Filter
Name="examples"

View File

@@ -19,6 +19,25 @@ enum
POINT_HOME = 0xFFFFFE
};
npc_escortAI::npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature),
IsBeingEscorted(false),
IsOnHold(false),
PlayerGUID(0),
MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
CanMelee(true),
m_uiPlayerCheckTimer(1000),
m_uiWPWaitTimer(2500),
m_bIsReturning(false),
m_bIsActiveAttacker(true),
m_bIsRunning(false),
DespawnAtEnd(true),
DespawnAtFar(true),
m_pQuestForEscort(NULL),
m_bCanInstantRespawn(false),
m_bCanReturnToStart(false),
ScriptWP(false)
{}
void npc_escortAI::AttackStart(Unit* pWho)
{
if (!pWho)
@@ -159,7 +178,10 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
if (!IsOnHold)
{
m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
debug_log("TSCR: EscortAI Next WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
debug_log("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
WaypointStart(CurrentWP->id);
m_uiWPWaitTimer = 0;
}
}

View File

@@ -28,12 +28,12 @@ struct Escort_Waypoint
struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
{
public:
explicit npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature),
IsBeingEscorted(false), IsOnHold(false), PlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), m_uiWPWaitTimer(2500), m_bIsReturning(false), m_bIsActiveAttacker(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true), m_pQuestForEscort(NULL), m_bCanInstantRespawn(false), m_bCanReturnToStart(false), ScriptWP(false) {}
explicit npc_escortAI(Creature* pCreature);
~npc_escortAI() {}
// Pure Virtual Functions
virtual void WaypointReached(uint32) = 0;
virtual void WaypointReached(uint32 uiPointId) = 0;
virtual void WaypointStart(uint32 uiPointId) {}
// CreatureAI functions
void AttackStart(Unit* who);

View File

@@ -32,6 +32,11 @@ EndScriptData */
#define SAY_GUARD_SIL_AGGRO2 -1070002
#define SAY_GUARD_SIL_AGGRO3 -1070003
guardAI::guardAI(Creature* pCreature) : ScriptedAI(pCreature),
GlobalCooldown(0),
BuffTimer(0)
{}
void guardAI::Reset()
{
GlobalCooldown = 0;

View File

@@ -9,7 +9,9 @@
struct TRINITY_DLL_DECL guardAI : public ScriptedAI
{
guardAI(Creature *c) : ScriptedAI(c) {}
public:
explicit guardAI(Creature* pCreature);
~guardAI() {}
uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
uint32 BuffTimer; //This variable keeps track of buffs

View File

@@ -80,7 +80,11 @@ void SummonList::DespawnAll()
}
}
ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), IsFleeing(false), m_bCombatMovement(true), m_uiEvadeCheckCooldown(2500)
ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature),
m_creature(pCreature),
IsFleeing(false),
m_bCombatMovement(true),
m_uiEvadeCheckCooldown(2500)
{
HeroicMode = m_creature->GetMap()->IsHeroic();
}

View File

@@ -43,7 +43,7 @@ class SummonList : private std::list<uint64>
struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
{
explicit ScriptedAI(Creature* creature);
explicit ScriptedAI(Creature* pCreature);
~ScriptedAI() {}
//*************

View File

@@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
void Reset()
{
lifeTimer = 120000;
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
spellHit = false;
}

View File

@@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
void Reset()
{
lifeTimer = 120000;
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down
spellHit = false;
}

View File

@@ -24,30 +24,33 @@ EndScriptData */
#include "precompiled.h"
#include "def_scholomance.h"
#define EMOTE_GENERIC_FRENZY_KILL -1000001
enum
{
EMOTE_GENERIC_FRENZY_KILL = -1000001,
#define SPELL_REND 18106
#define SPELL_CLEAVE 15584
#define SPELL_FRENZY 28371
SPELL_REND = 16509,
SPELL_BACKHAND = 18103,
SPELL_FRENZY = 8269
};
struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI
{
boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {}
uint32 Rend_Timer;
uint32 Cleave_Timer;
uint32 Frenzy_Timer;
uint32 m_uiRend_Timer;
uint32 m_uiBackhand_Timer;
uint32 m_uiFrenzy_Timer;
void Reset()
{
Rend_Timer = 8000;
Cleave_Timer = 9000;
Frenzy_Timer =0;
m_uiRend_Timer = 8000;
m_uiBackhand_Timer = 9000;
m_uiFrenzy_Timer = 1000;
}
void JustDied(Unit *killer)
void JustDied(Unit* pKiller)
{
ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL;
ScriptedInstance* pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL;
if (pInstance)
{
pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0);
@@ -57,44 +60,47 @@ struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI
}
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
//Rend_Timer
if (Rend_Timer < diff)
if (m_uiRend_Timer < uiDiff)
{
DoCast(m_creature->getVictim(),SPELL_REND);
Rend_Timer = 10000;
}else Rend_Timer -= diff;
DoCast(m_creature->getVictim(), SPELL_REND);
m_uiRend_Timer = 10000;
}
else
m_uiRend_Timer -= uiDiff;
//Cleave_Timer
if (Cleave_Timer < diff)
//Backhand_Timer
if (m_uiBackhand_Timer < uiDiff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 10000;
}else Cleave_Timer -= diff;
DoCast(m_creature->getVictim(), SPELL_BACKHAND);
m_uiBackhand_Timer = 10000;
}
else
m_uiBackhand_Timer -= uiDiff;
//Frenzy_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26)
{
if (Frenzy_Timer < diff)
if (m_uiFrenzy_Timer < uiDiff)
{
DoCast(m_creature,SPELL_FRENZY);
DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
Frenzy_Timer = 8000;
}else Frenzy_Timer -= diff;
m_uiFrenzy_Timer = 120000;
}
else
m_uiFrenzy_Timer -= uiDiff;
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_theolenkrastinov(Creature* pCreature)
{
return new boss_theolenkrastinovAI (pCreature);

View File

@@ -23,65 +23,72 @@ EndScriptData */
#include "precompiled.h"
#define EMOTE_GENERIC_FRENZY_KILL -1000001
enum
{
EMOTE_GENERIC_FRENZY_KILL = -1000001,
#define SPELL_FIRESHIELD 19626
#define SPELL_BLASTWAVE 13021
#define SPELL_FRENZY 28371
SPELL_FLAMESTRIKE = 18399,
SPELL_BLAST_WAVE = 16046,
SPELL_FIRESHIELD = 19626,
SPELL_FRENZY = 8269 //28371,
};
struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI
{
boss_vectusAI(Creature *c) : ScriptedAI(c) {}
uint32 FireShield_Timer;
uint32 BlastWave_Timer;
uint32 Frenzy_Timer;
uint32 m_uiFireShield_Timer;
uint32 m_uiBlastWave_Timer;
uint32 m_uiFrenzy_Timer;
void Reset()
{
FireShield_Timer = 2000;
BlastWave_Timer = 14000;
Frenzy_Timer = 0;
m_uiFireShield_Timer = 2000;
m_uiBlastWave_Timer = 14000;
m_uiFrenzy_Timer = 0;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
//FireShield_Timer
if (FireShield_Timer < diff)
if (m_uiFireShield_Timer < uiDiff)
{
DoCast(m_creature, SPELL_FIRESHIELD);
FireShield_Timer = 90000;
}else FireShield_Timer -= diff;
m_uiFireShield_Timer = 90000;
}
else
m_uiFireShield_Timer -= uiDiff;
//BlastWave_Timer
if (BlastWave_Timer < diff)
if (m_uiBlastWave_Timer < uiDiff)
{
DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
BlastWave_Timer = 12000;
}else BlastWave_Timer -= diff;
DoCast(m_creature->getVictim(), SPELL_BLAST_WAVE);
m_uiBlastWave_Timer = 12000;
}
else
m_uiBlastWave_Timer -= uiDiff;
//Frenzy_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25)
{
if (Frenzy_Timer < diff)
if (m_uiFrenzy_Timer < uiDiff)
{
DoCast(m_creature,SPELL_FRENZY);
DoCast(m_creature, SPELL_FRENZY);
DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
Frenzy_Timer = 24000;
}else Frenzy_Timer -= diff;
m_uiFrenzy_Timer = 24000;
}
else
m_uiFrenzy_Timer -= uiDiff;
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_vectus(Creature* pCreature)
{
return new boss_vectusAI (pCreature);

View File

@@ -0,0 +1,167 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Wetlands
SD%Complete: 80
SDComment: Quest support: 1249
SDCategory: Wetlands
EndScriptData */
/* ContentData
npc_mikhail
npc_tapoke_slim_jahn
EndContentData */
#include "precompiled.h"
#include "escort_ai.h"
/*######
## npc_tapoke_slim_jahn
######*/
enum
{
QUEST_MISSING_DIPLO_PT11 = 1249,
FACTION_ENEMY = 168,
SPELL_STEALTH = 1785,
NPC_SLIMS_FRIEND = 4971,
NPC_TAPOKE_SLIM_JAHN = 4962
};
struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI
{
npc_tapoke_slim_jahnAI(Creature* pCreature) : npc_escortAI(pCreature) { }
bool m_bFriendSummoned;
void Reset()
{
if (!IsBeingEscorted)
m_bFriendSummoned = false;
}
void WaypointReached(uint32 uiPointId)
{
switch(uiPointId)
{
case 2:
if (m_creature->HasStealthAura())
m_creature->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH);
SetRun();
m_creature->setFaction(FACTION_ENEMY);
break;
}
}
void Aggro(Unit* pWho)
{
Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID);
if (IsBeingEscorted && !m_bFriendSummoned && pPlayer)
{
m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 3.10f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 2.35f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 2.02f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
m_bFriendSummoned = true;
}
}
void JustSummoned(Creature* pSummoned)
{
if (Unit* pPlayer = Unit::GetPlayer(PlayerGUID))
pSummoned->AI()->AttackStart(pPlayer);
}
void AttackedBy(Unit* pAttacker)
{
if (m_creature->getVictim())
return;
if (m_creature->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
}
void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
{
if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20)
{
if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID))
{
if (pPlayer->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature);
uiDamage = 0;
me->RestoreFaction();
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop(true);
SetRun(false);
}
}
}
};
CreatureAI* GetAI_npc_tapoke_slim_jahn(Creature* pCreature)
{
return new npc_tapoke_slim_jahnAI(pCreature);
}
/*######
## npc_mikhail
######*/
bool QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT11)
{
Creature* pSlim = pCreature->FindNearestCreature(NPC_TAPOKE_SLIM_JAHN, 25.0f);
if (!pSlim)
return false;
if (!pSlim->HasStealthAura())
pSlim->CastSpell(pSlim, SPELL_STEALTH, true);
if (npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahnAI, pSlim->AI()))
pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest);
}
return false;
}
/*######
## AddSC
######*/
void AddSC_wetlands()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_tapoke_slim_jahn";
newscript->GetAI = &GetAI_npc_tapoke_slim_jahn;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_mikhail";
newscript->pQuestAccept = &QuestAccept_npc_mikhail;
newscript->RegisterSelf();
}

View File

@@ -26,6 +26,7 @@ npc_mist
EndContentData */
#include "precompiled.h"
#include "follower_ai.h"
/*####
# npc_mist
@@ -37,31 +38,20 @@ enum
EMOTE_AT_HOME = -1000412,
QUEST_MIST = 938,
NPC_ARYNIA = 3519,
FACTION_DARNASSUS = 79
};
struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI
struct TRINITY_DLL_DECL npc_mistAI : public FollowerAI
{
npc_mistAI(Creature *c) : ScriptedAI(c)
{
uiNpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS);
uiPlayerGUID = 0;
}
npc_mistAI(Creature* pCreature) : FollowerAI(pCreature) { }
uint64 uiPlayerGUID;
uint32 uiNpcFlags;
uint32 uiCheckPlayerTimer;
void Reset()
{
uiCheckPlayerTimer = 2500;
if (!uiPlayerGUID)
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, uiNpcFlags);
}
void Reset() { }
void MoveInLineOfSight(Unit *pWho)
{
if (pWho->GetEntry() == NPC_ARYNIA)
FollowerAI::MoveInLineOfSight(pWho);
if (!m_creature->getVictim() && !IsFollowComplete() && pWho->GetEntry() == NPC_ARYNIA)
{
if (m_creature->IsWithinDistInMap(pWho, 10.0f))
{
@@ -71,43 +61,11 @@ struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI
}
}
void EnterEvadeMode()
{
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop(true);
m_creature->LoadCreaturesAddon();
if (m_creature->isAlive())
{
if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID))
m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle());
else
{
m_creature->GetMotionMaster()->MovementExpired();
m_creature->GetMotionMaster()->MoveTargetedHome();
}
}
m_creature->SetLootRecipient(NULL);
Reset();
}
void DoStart(uint64 uiPlayer)
{
uiPlayerGUID = uiPlayer;
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
if (Player* pPlayer = Unit::GetPlayer(uiPlayer))
m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle());
}
void DoComplete()
{
DoScriptText(EMOTE_AT_HOME, m_creature);
if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID))
if (Player* pPlayer = GetLeaderForFollower())
{
if (pPlayer->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE)
{
@@ -115,55 +73,25 @@ struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI
if (uiQuestLogSlot < MAX_QUEST_LOG_SIZE)
{
//This will be wrong, need to check all group members (if any) for state before event
if (pPlayer->GetQuestSlotState(uiQuestLogSlot) != QUEST_STATE_FAIL)
pPlayer->AreaExploredOrEventHappens(QUEST_MIST);
}
}
}
uiPlayerGUID = 0;
EnterEvadeMode();
//The follow is over (and for later development to indicate a post event can now run)
SetFollowComplete();
}
void EnterCombat(Unit* who) { }
void JustDied(Unit* pKiller)
//call not needed here, no known abilities
/*void UpdateFollowerAI(const uint32 uiDiff)
{
if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID))
pPlayer->FailQuest(QUEST_MIST);
uiPlayerGUID = 0;
m_creature->GetMotionMaster()->MovementExpired();
}
void UpdateAI(const uint32 diff)
{
if (uiPlayerGUID)
{
if (!m_creature->isInCombat())
{
if (uiCheckPlayerTimer < diff)
{
uiCheckPlayerTimer = 5000;
Player* pPlayer = Unit::GetPlayer(uiPlayerGUID);
if (pPlayer && !pPlayer->isAlive())
{
uiPlayerGUID = 0;
EnterEvadeMode();
}
}
else
uiCheckPlayerTimer -= diff;
}
}
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
}*/
};
CreatureAI* GetAI_npc_mist(Creature* pCreature)
@@ -174,7 +102,10 @@ CreatureAI* GetAI_npc_mist(Creature* pCreature)
bool QuestAccept_npc_mist(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
if (pQuest->GetQuestId() == QUEST_MIST)
CAST_AI(npc_mistAI, (pCreature->AI()))->DoStart(pPlayer->GetGUID());
{
if (npc_mistAI* pMistAI = CAST_AI(npc_mistAI, pCreature->AI()))
pMistAI->StartFollow(pPlayer, FACTION_DARNASSUS, pQuest);
}
return true;
}

View File

@@ -237,7 +237,7 @@ struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI
void Reset()
{
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
}

View File

@@ -188,6 +188,7 @@ extern void AddSC_tirisfal_glades();
extern void AddSC_undercity();
extern void AddSC_western_plaguelands();
extern void AddSC_westfall();
extern void AddSC_wetlands();
//kalimdor
extern void AddSC_instance_blackfathom_deeps(); //Blackfathom Depths
@@ -573,6 +574,7 @@ void AddScripts()
AddSC_undercity();
AddSC_western_plaguelands();
AddSC_westfall();
AddSC_wetlands();
//kalimdor
AddSC_instance_blackfathom_deeps(); //Blackfathom Depths