Core/Script: Code style and remove unused core.

Signed-off-by: Gyx <[email protected]>
This commit is contained in:
Gyx
2012-03-28 15:15:48 +08:00
parent e050945c91
commit a20fa23ea6
27 changed files with 193 additions and 192 deletions
@@ -277,9 +277,7 @@ public:
void JustSummoned(Creature* summoned)
{
if (Player* player = GetPlayerForEscort())
{
summoned->AI()->AttackStart(player);
}
if (summoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH)
m_uiValrothGUID = summoned->GetGUID();
@@ -99,8 +99,7 @@ class npc_professor_phizzlethorpe : public CreatureScript
case 20:
Talk(EMOTE_PROGRESS_8);
Talk(SAY_PROGRESS_9, player->GetGUID());
if (player)
CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break;
}
}
@@ -139,52 +139,61 @@ public:
switch (i)
{
case 0:
{
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
DoScriptText(SAY_START, me, player);
break;
}
case 5:
DoScriptText(SAY_PROGRESS1, me, player);
case 11:
DoScriptText(SAY_PROGRESS2, me, player);
me->SetOrientation(4.762841f);
break;
case 18:
{
DoScriptText(SAY_PROGRESS3, me, player);
Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Summ1 && Summ2)
{
Summ1->Attack(me, true);
Summ2->Attack(player, true);
}
me->AI()->AttackStart(Summ1);
break;
}
case 19: me->SetWalk(false);
break;
case 25: me->SetWalk(true);
break;
case 30:
if (player && player->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
break;
case 32:
me->SetOrientation(2.978281f);
DoScriptText(SAY_END1, me, player);
break;
case 33:
me->SetOrientation(5.858011f);
DoScriptText(SAY_END2, me, player);
Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player);
break;
case 0:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
DoScriptText(SAY_START, me, player);
break;
case 5:
DoScriptText(SAY_PROGRESS1, me, player);
break;
case 11:
DoScriptText(SAY_PROGRESS2, me, player);
me->SetOrientation(4.762841f);
break;
case 18:
{
DoScriptText(SAY_PROGRESS3, me, player);
Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Summ1 && Summ2)
{
Summ1->Attack(me, true);
Summ2->Attack(player, true);
}
me->AI()->AttackStart(Summ1);
}
break;
case 19:
me->SetWalk(false);
break;
case 25:
me->SetWalk(true);
break;
case 30:
if (player->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
break;
case 32:
me->SetOrientation(2.978281f);
DoScriptText(SAY_END1, me, player);
break;
case 33:
me->SetOrientation(5.858011f);
DoScriptText(SAY_END2, me, player);
Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player);
break;
}
}
@@ -314,7 +314,7 @@ public:
{
m_uiPostEventTimer = 3000;
if (Unit* player = GetPlayerForEscort())
if (Player* player = GetPlayerForEscort())
{
switch (m_uiPostEventCount)
{
@@ -75,25 +75,44 @@ public:
switch (i)
{
case 1: DoScriptText(SAY_START, me, player);break;
case 13:
DoScriptText(SAY_LAST, me, player);
player->GroupEventHappens(QUEST_ESCORTING, me); break;
case 14: DoScriptText(SAY_THANKS, me, player); break;
case 15: {
Unit* Rane = me->FindNearestCreature(NPC_RANE, 20);
if (Rane)
case 1:
DoScriptText(SAY_START, me, player);
break;
case 13:
DoScriptText(SAY_LAST, me, player);
player->GroupEventHappens(QUEST_ESCORTING, me);
break;
case 14:
DoScriptText(SAY_THANKS, me, player);
break;
case 15:
if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20))
DoScriptText(SAY_RANE, Rane);
break;}
case 16: DoScriptText(SAY_ANSWER, me); break;
case 17: DoScriptText(SAY_MOVE_QUINN, me); break;
case 24: DoScriptText(SAY_GREETINGS, me); break;
case 25: {
Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20);
if (Quinn)
break;
case 16:
DoScriptText(SAY_ANSWER, me);
break;
case 17:
DoScriptText(SAY_MOVE_QUINN, me);
break;
case 24:
DoScriptText(SAY_GREETINGS, me);
break;
case 25:
if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20))
DoScriptText(SAY_QUINN, Quinn);
break;}
case 26: DoScriptText(SAY_ON_BYE, me, NULL); break;
break;
case 26:
DoScriptText(SAY_ON_BYE, me, NULL);
break;
}
}
@@ -380,8 +380,7 @@ public:
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (player)
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_TOMB_LIGHTBRINGER);
}
@@ -243,13 +243,11 @@ public:
break;
case 44:
DoScriptText(SAY_END, me, player);
{
if (player)
player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me);
}
player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me);
break;
}
}
void EnterCombat(Unit* who)
{
DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2), me, who);