Merge SD2 up to r967

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2009-04-19 21:16:11 +02:00
parent 2e7d8d35fe
commit b92eac3b27
12 changed files with 163 additions and 106 deletions

View File

@@ -0,0 +1,27 @@
DELETE FROM script_waypoint WHERE entry=12423;
INSERT INTO script_waypoint VALUES
(12423, 0, -9509.72, -147.03, 58.74, 0, ''),
(12423, 1, -9517.07, -172.82, 58.66, 0, '');
DELETE FROM script_waypoint WHERE entry=12427;
INSERT INTO script_waypoint VALUES
(12427, 0, -5689.20, -456.44, 391.08, 0, ''),
(12427, 1, -5700.37, -450.77, 393.19, 0, '');
DELETE FROM script_waypoint WHERE entry=12428;
INSERT INTO script_waypoint VALUES
(12428, 0, 2454.09, 361.26, 31.51, 0, ''),
(12428, 1, 2472.03, 378.08, 30.98, 0, '');
DELETE FROM script_waypoint WHERE entry=12429;
INSERT INTO script_waypoint VALUES
(12429, 0, 9654.19, 909.58, 1272.11, 0, ''),
(12429, 1, 9642.53, 908.11, 1269.10, 0, '');
DELETE FROM script_waypoint WHERE entry=12430;
INSERT INTO script_waypoint VALUES
(12430, 0, 161.65, -4779.34, 14.64, 0, ''),
(12430, 1, 140.71, -4813.56, 17.04, 0, '');
UPDATE script_texts SET emote=20 WHERE entry=-1000231;
UPDATE script_texts SET emote=4 WHERE entry IN (-1000232, -1000256, -1000258, -1000260, -1000262);

View File

@@ -693,7 +693,7 @@ void LoadDatabase()
if (!GetLanguageDescByID(temp.Language))
error_db_log("TSCR: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.",i,temp.Language);
if (temp.Type > CHAT_TYPE_BOSS_WHISPER)
if (temp.Type > CHAT_TYPE_ZONE_YELL)
error_db_log("TSCR: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.",i,temp.Type);
TextMap[i] = temp;
@@ -758,7 +758,7 @@ void LoadDatabase()
if (!GetLanguageDescByID(temp.Language))
error_db_log("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.",i,temp.Language);
if (temp.Type > CHAT_TYPE_BOSS_WHISPER)
if (temp.Type > CHAT_TYPE_ZONE_YELL)
error_db_log("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.",i,temp.Type);
TextMap[i] = temp;
@@ -823,7 +823,7 @@ void LoadDatabase()
if (!GetLanguageDescByID(temp.Language))
error_db_log("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.",i,temp.Language);
if (temp.Type > CHAT_TYPE_BOSS_WHISPER)
if (temp.Type > CHAT_TYPE_ZONE_YELL)
error_db_log("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.",i,temp.Type);
TextMap[i] = temp;

View File

@@ -747,6 +747,31 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 s
return pList;
}
void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 uiOffHand, int32 uiRanged)
{
if (bLoadDefault)
{
if (CreatureInfo const* pInfo = GetCreatureTemplateStore(m_creature->GetEntry()))
m_creature->LoadEquipment(pInfo->equipmentId,true);
return;
}
if (uiMainHand >= 0)
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand));
if (uiOffHand >= 0)
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand));
if (uiRanged >= 0)
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged));
}
void ScriptedAI::SetSheathState(SheathState newState)
{
m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, newState);
}
/*void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who)
{
if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )

View File

@@ -184,6 +184,10 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
//Checks if you can cast the specified spell
bool CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered = false);
void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE);
void SetSheathState(SheathState newState);
};
struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI

View File

@@ -95,7 +95,8 @@ void npc_escortAI::EnterEvadeMode()
m_creature->GetMotionMaster()->MovementExpired();
m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z);
}else
}
else
{
m_creature->GetMotionMaster()->MovementExpired();
m_creature->GetMotionMaster()->MoveTargetedHome();
@@ -114,9 +115,9 @@ void npc_escortAI::UpdateAI(const uint32 diff)
if (ReconnectWP)
{
//Correct movement speed
if (Run)
if (bIsRunning && m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
else
else if (!bIsRunning && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
//Continue with waypoints
@@ -150,13 +151,15 @@ void npc_escortAI::UpdateAI(const uint32 diff)
m_creature->Respawn();
m_creature->GetMotionMaster()->Clear(true);
//Re-Enable gossip
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
//Restore original NpcFlags
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_uiNpcFlags);
IsBeingEscorted = false;
WaitTimer = 0;
return;
}else{
}
else
{
debug_log("SD2: EscortAI reached end of waypoints with Despawn off");
IsBeingEscorted = false;
WaitTimer = 0;
@@ -194,8 +197,9 @@ void npc_escortAI::UpdateAI(const uint32 diff)
m_creature->Respawn();
m_creature->GetMotionMaster()->Clear(true);
//Re-Enable gossip
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
//Restore original NpcFlags
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_uiNpcFlags);
}
PlayerTimer = 1000;
@@ -233,7 +237,8 @@ void npc_escortAI::MovementInform(uint32 type, uint32 id)
Returning = false;
WaitTimer = 1;
}else
}
else
{
//Make sure that we are still on the right waypoint
if (CurrentWP->id != id)
@@ -295,6 +300,30 @@ void npc_escortAI::FillPointMovementListForCreature()
}
}
void npc_escortAI::SetRun(bool bRun)
{
if (bRun)
{
if (!bIsRunning)
{
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
bIsRunning = true;
}
else
debug_log("SD2: EscortAI attempt to set run mode, but is already running.");
}
else
{
if (bIsRunning)
{
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
bIsRunning = false;
}
else
debug_log("SD2: EscortAI attempt to set walk mode, but is already walking.");
}
}
void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
{
if (InCombat)
@@ -303,25 +332,39 @@ void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
return;
}
if (IsBeingEscorted)
{
error_log("SD2: EscortAI attempt to Start while already escorting");
return;
}
if (WaypointList.empty())
{
debug_log("SD2 ERROR: Call to escortAI::Start with 0 waypoints");
error_db_log("SD2: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint)");
return;
}
Attack = bAttack;
Defend = bDefend;
Run = bRun;
bIsRunning = bRun;
PlayerGUID = pGUID;
debug_log("SD2: EscortAI started with %d waypoints. Attack = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), Attack, Defend, Run, PlayerGUID);
//store original NpcFlags
m_uiNpcFlags = m_creature->GetUInt32Value(UNIT_NPC_FLAGS);
//remove them if any
if (m_uiNpcFlags)
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
debug_log("SD2: EscortAI started with %d waypoints. Attack = %d, Defend = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), Attack, Defend, bIsRunning, PlayerGUID);
CurrentWP = WaypointList.begin();
//Set initial speed
if (Run)
if (bIsRunning)
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
else m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
else
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
//Start WP
m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z );
@@ -331,7 +374,5 @@ void npc_escortAI::Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID)
Returning = false;
IsOnHold = false;
//Disable questgiver flag
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
}

View File

@@ -63,6 +63,7 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
void FillPointMovementListForCreature();
void Start(bool bAttack, bool bDefend, bool bRun, uint64 pGUID = 0);
void SetRun(bool bRun = true);
void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; }
float GetMaxPlayerDistance() { return MaxPlayerDistance; }
@@ -81,6 +82,7 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
private:
uint32 WaitTimer;
uint32 PlayerTimer;
uint32 m_uiNpcFlags;
float MaxPlayerDistance;
struct
@@ -97,7 +99,7 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
bool Defend;
bool Returning;
bool ReconnectWP;
bool Run;
bool bIsRunning;
bool CanMelee;
bool DespawnAtEnd;
bool DespawnAtFar;

View File

@@ -37,6 +37,7 @@ npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap
EndContentData */
#include "precompiled.h"
#include "../npc/npc_escortAI.h"
/*########
# npc_chicken_cluck
@@ -620,18 +621,9 @@ enum
SAY_SHAYA_GOODBYE = -1000174,
};
float fRunTo[5][3]=
struct TRINITY_DLL_DECL npc_garments_of_questsAI : public npc_escortAI
{
{9661.724, 869.803, 1270.742}, //shaya
{-9543.747, -117.770, 57.893}, //roberts
{-5650.226, -473.517, 397.027}, //dolf
{189.175, -4747.069, 11.215}, //kor'ja
{2471.303, 371.101, 30.919}, //kel
};
struct TRINITY_DLL_DECL npc_garments_of_questsAI : public ScriptedAI
{
npc_garments_of_questsAI(Creature *c) : ScriptedAI(c) {Reset();}
npc_garments_of_questsAI(Creature *c) : npc_escortAI(c) {Reset();}
uint64 caster;
@@ -652,7 +644,6 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public ScriptedAI
m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
//expect database to have RegenHealth=0
m_creature->SetHealth(int(m_creature->GetMaxHealth()*0.7));
m_creature->SetVisibility(VISIBILITY_ON);
}
void Aggro(Unit *who) {}
@@ -767,21 +758,8 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public ScriptedAI
}
}
void MovementInform(uint32 type, uint32 id)
void WaypointReached(uint32 uiPoint)
{
if (type != POINT_MOTION_TYPE)
return;
//we reached destination, kill ourselves
if (id == 0)
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->setDeathState(JUST_DIED);
m_creature->SetHealth(0);
m_creature->CombatStop();
m_creature->DeleteThreatList();
m_creature->RemoveCorpse();
}
}
void UpdateAI(const uint32 diff)
@@ -794,27 +772,14 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public ScriptedAI
{
switch(m_creature->GetEntry())
{
case ENTRY_SHAYA:
DoScriptText(SAY_SHAYA_GOODBYE,m_creature,pUnit);
m_creature->GetMotionMaster()->MovePoint(0, fRunTo[0][0], fRunTo[0][1], fRunTo[0][2]);
break;
case ENTRY_ROBERTS:
DoScriptText(SAY_ROBERTS_GOODBYE,m_creature,pUnit);
m_creature->GetMotionMaster()->MovePoint(0, fRunTo[1][0], fRunTo[1][1], fRunTo[1][2]);
break;
case ENTRY_DOLF:
DoScriptText(SAY_DOLF_GOODBYE,m_creature,pUnit);
m_creature->GetMotionMaster()->MovePoint(0, fRunTo[2][0], fRunTo[2][1], fRunTo[2][2]);
break;
case ENTRY_KORJA:
DoScriptText(SAY_KORJA_GOODBYE,m_creature,pUnit);
m_creature->GetMotionMaster()->MovePoint(0, fRunTo[3][0], fRunTo[3][1], fRunTo[3][2]);
break;
case ENTRY_DG_KEL:
DoScriptText(SAY_DG_KEL_GOODBYE,m_creature,pUnit);
m_creature->GetMotionMaster()->MovePoint(0, fRunTo[4][0], fRunTo[4][1], fRunTo[4][2]);
break;
case ENTRY_SHAYA: DoScriptText(SAY_SHAYA_GOODBYE,m_creature,pUnit); break;
case ENTRY_ROBERTS: DoScriptText(SAY_ROBERTS_GOODBYE,m_creature,pUnit); break;
case ENTRY_DOLF: DoScriptText(SAY_DOLF_GOODBYE,m_creature,pUnit); break;
case ENTRY_KORJA: DoScriptText(SAY_KORJA_GOODBYE,m_creature,pUnit); break;
case ENTRY_DG_KEL: DoScriptText(SAY_DG_KEL_GOODBYE,m_creature,pUnit); break;
}
Start(false,true,true);
}
else
EnterEvadeMode(); //something went wrong
@@ -823,17 +788,17 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public ScriptedAI
}else RunAwayTimer -= diff;
}
//Return since we have no target
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_garments_of_quests(Creature* pCreature)
{
return new npc_garments_of_questsAI(pCreature);
npc_garments_of_questsAI* tempAI = new npc_garments_of_questsAI(pCreature);
tempAI->FillPointMovementListForCreature();
return (CreatureAI*)tempAI;
}
/*######

View File

@@ -137,8 +137,8 @@ EndScriptData */
#define FLAME_ENRAGE_DISTANCE 30
#define FLAME_CHARGE_DISTANCE 50
#define ITEM_ID_MAIN_HAND 32837
#define ITEM_ID_OFF_HAND 32838
#define EQUIP_ID_MAIN_HAND 32837
#define EQUIP_ID_OFF_HAND 32838
/**** Creature Summon and Recognition IDs ****/
enum CreatureEntry

View File

@@ -229,12 +229,11 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
switch( i )
{
case 8:
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun(false);
m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 9:
DoScriptText(SAY_TH_ARMORY, m_creature);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL);
//m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
//m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
@@ -246,7 +245,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, THRALL_MODEL_EQUIPPED);
break;
case 11:
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun();
break;
case 15:
m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
@@ -274,11 +273,12 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
case 30:
IsOnHold = true;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun(false);
break;
case 31:
DoScriptText(SAY_TH_MOUNTS_UP, m_creature);
DoMount();
SetRun();
break;
case 37:
//possibly regular patrollers? If so, remove this and let database handle them
@@ -290,6 +290,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000);
DoUnmount();
HadMount = false;
SetRun(false);
break;
case 60:
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
@@ -297,9 +298,10 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
IsOnHold = true;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pInstance->SetData(TYPE_THRALL_PART2, DONE);
SetRun();
break;
case 64:
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun(false);
break;
case 68:
m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
@@ -308,10 +310,10 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 71:
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun();
break;
case 81:
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun(false);
break;
case 83:
m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
@@ -321,9 +323,11 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
break;
case 84:
DoScriptText(SAY_TH_CHURCH_END, m_creature);
SetRun();
break;
case 91:
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun(false);
break;
case 93:
m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
@@ -332,7 +336,6 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 94:
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA))
{
if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID))
@@ -349,7 +352,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
break;
case 97:
DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun();
break;
case 98:
//trigger epoch Yell("Thrall! Come outside and face your fate! ....")
@@ -426,7 +429,6 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
{
m_creature->Mount(SKARLOC_MOUNT_MODEL);
m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
}
void DoUnmount()
{

View File

@@ -17,7 +17,7 @@
/* ScriptData
SDName: Tanaris
SD%Complete: 80
SDComment: Quest support: 2954, 4005, 10277, 648, 10279(Special flight path). Noggenfogger vendor
SDComment: Quest support: 648, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor
SDCategory: Tanaris
EndScriptData */
@@ -387,7 +387,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI
if (player)
{
DoScriptText(SAY_CHICKEN_COMP, m_creature);
((Player*)player)->GroupEventHappens(Q_OOX17, m_creature);
player->GroupEventHappens(Q_OOX17, m_creature);
}
break;
}

View File

@@ -38,12 +38,7 @@ EndContentData */
struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI
{
npc_defias_traitorAI(Creature *c) : npc_escortAI(c)
{
IsWalking = false;
}
bool IsWalking;
npc_defias_traitorAI(Creature *c) : npc_escortAI(c) { Reset(); }
void WaypointReached(uint32 i)
{
@@ -52,13 +47,10 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI
if (!player)
return;
if (IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
switch (i)
{
case 35:
IsWalking = true;
SetRun(false);
break;
case 36:
DoScriptText(SAY_PROGRESS, m_creature, player);
@@ -66,8 +58,8 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI
case 44:
DoScriptText(SAY_END, m_creature, player);
{
if (player && player->GetTypeId() == TYPEID_PLAYER)
((Player*)player)->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,m_creature);
if (player)
player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,m_creature);
}
break;
}
@@ -82,14 +74,7 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI
}
void Reset()
{
if (IsWalking && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
{
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
return;
}
IsWalking = false;
}
{}
void JustDied(Unit* killer)
{

View File

@@ -71,6 +71,12 @@ enum SelectAggroTarget
SELECT_TARGET_FARTHEST,
};
enum SCEquip
{
EQUIP_NO_CHANGE = -1,
EQUIP_UNEQUIP = 0
};
class TRINITY_DLL_SPEC UnitAI
{
protected: