Merge [SD2]

r1006 Restore build (using pointer to m_creature now exist in creatureAI). - Skip
r1007 Some cleanup in mr.stonefist script and remove strange call to AttackedBy()
r1008 Added support for quest 9752 - move waypoint to db

--HG--
branch : trunk
This commit is contained in:
Kudlaty
2009-06-15 01:59:46 +02:00
parent 4c2986c6b1
commit a4cb3799db
4 changed files with 126 additions and 93 deletions
@@ -0,0 +1,28 @@
DELETE FROM script_waypoint WHERE entry=17969;
INSERT INTO script_waypoint VALUES
(17969, 0, -930.048950, 5288.080078, 23.848402, 0, ''),
(17969, 1, -925.677917, 5296.482910, 18.183748, 0, ''),
(17969, 2, -924.297180, 5299.016113, 17.710915, 0, ''),
(17969, 3, -928.390076, 5317.022949, 18.208593, 0, ''),
(17969, 4, -930.620972, 5329.915039, 18.773422, 0, 'SAY_AMBUSH1'),
(17969, 5, -931.490295, 5357.654785, 18.027155, 0, 'SAY_PROGRESS'),
(17969, 6, -934.777771, 5369.341797, 22.278048, 0, ''),
(17969, 7, -934.521851, 5373.407227, 22.834690, 0, ''),
(17969, 8, -937.008545, 5382.980469, 22.699078, 0, ''),
(17969, 9, -941.948059, 5404.141602, 22.669743, 0, ''),
(17969, 10, -931.244263, 5415.846680, 23.063961, 0, 'at crossroad'),
(17969, 11, -901.497925, 5420.315430, 24.213270, 0, ''),
(17969, 12, -860.311707, 5415.617676, 23.671139, 0, ''),
(17969, 13, -777.988953, 5391.982422, 23.001669, 0, ''),
(17969, 14, -750.362000, 5385.786621, 22.765791, 0, ''),
(17969, 15, -731.339417, 5382.449707, 22.517065, 0, ''),
(17969, 16, -681.235901, 5381.377930, 22.050159, 2500, 'end bridge SAY_AMBUSH2'),
(17969, 17, -637.944458, 5384.338379, 22.205647, 0, 'SAY_END'),
(17969, 18, -608.954407, 5408.715332, 21.630386, 0, ''),
(17969, 19, -598.134277, 5413.608398, 21.412275, 0, ''),
(17969, 20, -571.268982, 5420.771973, 21.184925, 0, ''),
(17969, 21, -553.099915, 5424.616211, 21.193716, 0, ''),
(17969, 22, -524.745483, 5443.945313, 20.977013, 0, ''),
(17969, 23, -502.984985, 5446.283691, 22.149435, 0, ''),
(17969, 24, -472.463959, 5449.546875, 22.561453, 0, ''),
(17969, 25, -454.533264, 5461.302246, 22.602837, 30000, 'quest complete');
+29
View File
@@ -52,6 +52,35 @@ INSERT INTO script_waypoint VALUES
(16295, 33, 7603.768066, -7667.000488, 153.997726, 8000, 'SAY_END_2'),
(16295, 34, 7603.768066, -7667.000488, 153.997726, 0, '');
DELETE FROM script_waypoint WHERE entry=17969;
INSERT INTO script_waypoint VALUES
(17969, 0, -930.048950, 5288.080078, 23.848402, 0, ''),
(17969, 1, -925.677917, 5296.482910, 18.183748, 0, ''),
(17969, 2, -924.297180, 5299.016113, 17.710915, 0, ''),
(17969, 3, -928.390076, 5317.022949, 18.208593, 0, ''),
(17969, 4, -930.620972, 5329.915039, 18.773422, 0, 'SAY_AMBUSH1'),
(17969, 5, -931.490295, 5357.654785, 18.027155, 0, 'SAY_PROGRESS'),
(17969, 6, -934.777771, 5369.341797, 22.278048, 0, ''),
(17969, 7, -934.521851, 5373.407227, 22.834690, 0, ''),
(17969, 8, -937.008545, 5382.980469, 22.699078, 0, ''),
(17969, 9, -941.948059, 5404.141602, 22.669743, 0, ''),
(17969, 10, -931.244263, 5415.846680, 23.063961, 0, 'at crossroad'),
(17969, 11, -901.497925, 5420.315430, 24.213270, 0, ''),
(17969, 12, -860.311707, 5415.617676, 23.671139, 0, ''),
(17969, 13, -777.988953, 5391.982422, 23.001669, 0, ''),
(17969, 14, -750.362000, 5385.786621, 22.765791, 0, ''),
(17969, 15, -731.339417, 5382.449707, 22.517065, 0, ''),
(17969, 16, -681.235901, 5381.377930, 22.050159, 2500, 'end bridge SAY_AMBUSH2'),
(17969, 17, -637.944458, 5384.338379, 22.205647, 0, 'SAY_END'),
(17969, 18, -608.954407, 5408.715332, 21.630386, 0, ''),
(17969, 19, -598.134277, 5413.608398, 21.412275, 0, ''),
(17969, 20, -571.268982, 5420.771973, 21.184925, 0, ''),
(17969, 21, -553.099915, 5424.616211, 21.193716, 0, ''),
(17969, 22, -524.745483, 5443.945313, 20.977013, 0, ''),
(17969, 23, -502.984985, 5446.283691, 22.149435, 0, ''),
(17969, 24, -472.463959, 5449.546875, 22.561453, 0, ''),
(17969, 25, -454.533264, 5461.302246, 22.602837, 30000, 'quest complete');
DELETE FROM script_waypoint WHERE entry=467;
INSERT INTO script_waypoint VALUES
(467, 0, -10508.40, 1068.00, 55.21, 0, ''),
@@ -123,27 +123,33 @@ CreatureAI* GetAI_npc_bartleby(Creature *_creature)
## npc_dashel_stonefist
######*/
enum
{
QUEST_MISSING_DIPLO_PT8 = 1447,
FACTION_HOSTILE = 168
};
struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI
{
npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) {}
npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) { uiNormFaction = c->getFaction(); }
uint32 uiNormFaction;
void Reset()
{
m_creature->setFaction(11);
m_creature->setFaction(uiNormFaction);
}
void DamageTaken(Unit *done_by, uint32 & damage)
{
if((damage > m_creature->GetHealth()) || (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15)
if ((damage > m_creature->GetHealth()) || (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15)
{
//Take 0 damage
damage = 0;
if (done_by->GetTypeId() == TYPEID_PLAYER)
{
CAST_PLR(done_by)->AttackStop();
CAST_PLR(done_by)->AreaExploredOrEventHappens(1447);
}
CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_MISSING_DIPLO_PT8);
//m_creature->CombatStop();
EnterEvadeMode();
}
@@ -152,19 +158,19 @@ struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI
void EnterCombat(Unit *who) {}
};
bool QuestAccept_npc_dashel_stonefist(Player *player, Creature *_Creature, Quest const *_Quest)
bool QuestAccept_npc_dashel_stonefist(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
if(_Quest->GetQuestId() == 1447)
if(pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT8)
{
_Creature->setFaction(168);
CAST_AI(npc_dashel_stonefistAI, _Creature->AI())->AttackStart(player);
pCreature->setFaction(FACTION_HOSTILE);
CAST_AI(npc_dashel_stonefistAI, pCreature->AI())->AttackStart(pPlayer);
}
return true;
}
CreatureAI* GetAI_npc_dashel_stonefist(Creature *_creature)
CreatureAI* GetAI_npc_dashel_stonefist(Creature* pCreature)
{
return new npc_dashel_stonefistAI(_creature);
return new npc_dashel_stonefistAI(pCreature);
}
/*######
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Zangarmarsh
SD%Complete: 100
SDComment: Quest support: 9785, 9803, 10009, 9752. Mark Of ... buffs.
SDComment: Quest support: 9752, 9785, 9803, 10009. Mark Of ... buffs.
SDCategory: Zangarmarsh
EndScriptData */
@@ -255,71 +255,67 @@ bool GossipSelect_npc_mortog_steamhead(Player *player, Creature *_Creature, uint
## npc_kayra_longmane
######*/
#define SAY_PROGRESS_1 -1000360
#define SAY_PROGRESS_2 -1000361
#define SAY_PROGRESS_3 -1000362
#define SAY_PROGRESS_4 -1000363
#define SAY_PROGRESS_5 -1000364
#define SAY_PROGRESS_6 -1000365
enum
{
SAY_START = -1000360,
SAY_AMBUSH1 = -1000361,
SAY_PROGRESS = -1000362,
SAY_AMBUSH2 = -1000363,
SAY_NEAR_END = -1000364,
SAY_END = -1000365,
#define QUEST_EFU 9752
#define MOB_AMBUSH 18042
QUEST_ESCAPE_FROM = 9752,
NPC_SLAVEBINDER = 18042
};
struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI
{
npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {}
bool Completed;
void Reset()
{
Completed = false;
m_creature->setFaction(1660);
}
void Reset() { }
void EnterCombat(Unit* who){}
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->setFaction(14);
}
void WaypointReached(uint32 i)
{
Player* player = Unit::GetPlayer(PlayerGUID);
Unit* pUnit = Unit::GetUnit(*m_creature, PlayerGUID);
if (!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER)
return;
switch(i)
{
case 0: DoScriptText(SAY_PROGRESS_1, m_creature, player); break;
case 5: DoScriptText(SAY_PROGRESS_2, m_creature, player);
m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
case 4:
DoScriptText(SAY_AMBUSH1, m_creature, pUnit);
DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 6: DoScriptText(SAY_PROGRESS_3, m_creature, player);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
case 5:
DoScriptText(SAY_PROGRESS, m_creature, pUnit);
SetRun();
break;
case 18: DoScriptText(SAY_PROGRESS_4, m_creature, player);
m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
case 16:
DoScriptText(SAY_AMBUSH2, m_creature, pUnit);
DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
DoScriptText(SAY_PROGRESS_5, m_creature, player); break;
case 26: DoScriptText(SAY_PROGRESS_6, m_creature, player);
Completed = true;
if(player)
player->GroupEventHappens(QUEST_EFU, m_creature);
case 17:
SetRun(false);
DoScriptText(SAY_NEAR_END, m_creature, pUnit);
break;
case 26:
DoScriptText(SAY_END, m_creature, pUnit);
((Player*)pUnit)->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature);
break;
}
}
void JustDied(Unit* killer)
{
if (PlayerGUID && !Completed)
if (Unit* pUnit = Unit::GetUnit(*m_creature, PlayerGUID))
{
Player* player = Unit::GetPlayer(PlayerGUID);
if (player && !Completed)
player->FailQuest(QUEST_EFU);
if (((Player*)pUnit)->GetQuestStatus(QUEST_ESCAPE_FROM) == QUEST_STATUS_INCOMPLETE)
((Player*)pUnit)->FailQuest(QUEST_ESCAPE_FROM);
}
}
@@ -329,49 +325,23 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI
}
};
bool QuestAccept_npc_kayra_longmane(Player* player, Creature* creature, Quest const* quest)
bool QuestAccept_npc_kayra_longmane(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
if (quest->GetQuestId() == QUEST_EFU)
if (pQuest->GetQuestId() == QUEST_ESCAPE_FROM)
{
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID());
creature->setFaction(113);
DoScriptText(SAY_START, pCreature, pPlayer);
((npc_escortAI*)(pCreature->AI()))->Start(false, true, false, pPlayer->GetGUID());
}
return true;
}
CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* _Creature)
CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* pCreature)
{
npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(_Creature);
npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(pCreature);
thisAI->AddWaypoint(0, -931.88, 5283.56, 23.98);//SAY_PROGRESS_1
thisAI->AddWaypoint(1, -930.52, 5287.57, 23.82);
thisAI->AddWaypoint(2, -924.98, 5297.94, 17.78);
thisAI->AddWaypoint(3, -928.83, 5316.07, 18.18);
thisAI->AddWaypoint(4, -930.07, 5323.10, 18.63);
thisAI->AddWaypoint(5, -926.58, 5331.24, 18.74, 6000);//SAY_PROGRESS_2
thisAI->AddWaypoint(6, -926.58, 5331.24, 18.74, 3000);//SAY_PROGRESS_3 Run to the hills!
thisAI->AddWaypoint(7, -931.24, 5358.89, 18.14);
thisAI->AddWaypoint(8, -934.43, 5370.20, 22.41);
thisAI->AddWaypoint(9, -943.01, 5400.55, 22.74);
thisAI->AddWaypoint(10, -929.62, 5417.98, 23.07);
thisAI->AddWaypoint(11, -901.92, 5420.38, 24.19);
thisAI->AddWaypoint(12, -859.03, 5415.36, 23.64);
thisAI->AddWaypoint(13, -808.94, 5401.93, 23.11);
thisAI->AddWaypoint(14, -772.74, 5390.53, 22.97);
thisAI->AddWaypoint(15, -749.71, 5385.39, 22.75);
thisAI->AddWaypoint(16, -721.23, 5380.38, 22.47);
thisAI->AddWaypoint(17, -687.96, 5379.08, 22.16);
thisAI->AddWaypoint(18, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_4 Summon Ambush
thisAI->AddWaypoint(19, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_5
thisAI->AddWaypoint(20, -636.14, 5385.25, 22.20);
thisAI->AddWaypoint(21, -602.94, 5411.36, 21.48);
thisAI->AddWaypoint(22, -566.86, 5421.87, 21.25);
thisAI->AddWaypoint(23, -547.27, 5427.87, 21.10);
thisAI->AddWaypoint(24, -520.59, 5444.83, 21.15);
thisAI->AddWaypoint(25, -488.45, 5447.83, 22.38);
thisAI->AddWaypoint(26, -449.65, 5463.78, 21.77, 11000);//SAY_PROGRESS_6
thisAI->FillPointMovementListForCreature();
return thisAI;
return (CreatureAI*)thisAI;
}
/*######
## AddSC