Merge pull request #5918 from GyxTom/master

Core/Misc: Various cleanups
This commit is contained in:
Shocker committed 2012-03-28 18:00:42 -07:00
commit a08cb234c0
86 files changed
+653 -547

No files matched your search

@@ -203,16 +203,16 @@ public:
pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
float angle = me->GetAngle(pAttumen);
float distance = me->GetDistance2d(pAttumen);
float newX = me->GetPositionX() + cos(angle)*(distance/2) ;
float newY = me->GetPositionY() + sin(angle)*(distance/2) ;
float newX = me->GetPositionX() + cos(angle)*(distance/2);
float newY = me->GetPositionY() + sin(angle)*(distance/2);
float newZ = 50;
//me->Relocate(newX, newY, newZ, angle);
//me->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
distance += 10;
newX = me->GetPositionX() + cos(angle)*(distance/2) ;
newY = me->GetPositionY() + sin(angle)*(distance/2) ;
newX = me->GetPositionX() + cos(angle)*(distance/2);
newY = me->GetPositionY() + sin(angle)*(distance/2);
pAttumen->GetMotionMaster()->Clear();
pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
//pAttumen->Relocate(newX, newY, newZ, -angle);
@@ -201,7 +201,7 @@ public:
void DeSpawnAdds()
{
for (uint8 i = 0; i < 4 ; ++i)
for (uint8 i = 0; i < 4; ++i)
{
Creature* Temp = NULL;
if (AddGUID[i])
@@ -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();
@@ -1011,8 +1011,7 @@ public:
if (fLichPositionX && fLichPositionY)
{
Unit* temp;
temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
temp->SetSpeed(MOVE_RUN, 2.0f);
@@ -301,7 +301,7 @@ class boss_hexlord_malacrass : public CreatureScript
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_YELL_DEATH);
for (uint8 i = 0; i < 4 ; ++i)
for (uint8 i = 0; i < 4; ++i)
{
Unit* Temp = Unit::GetUnit((*me), AddGUID[i]);
if (Temp && Temp->isAlive())
@@ -198,7 +198,7 @@ class boss_venoxis : public CreatureScript
case EVENT_HOLY_NOVA:
_inMeleeRange = 0;
for (uint8 i = 0; i < 10 ; ++i)
for (uint8 i = 0; i < 10; ++i)
{
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, i))
// check if target is within melee-distance
@@ -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;
}
}
@@ -85,6 +85,7 @@ public:
{
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (creature->isVendor())
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
@@ -95,7 +96,8 @@ public:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
player->SEND_GOSSIP_MENU(3985, creature->GetGUID());
}else
}
else
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
@@ -378,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);
@@ -123,9 +123,7 @@ class example_escort : public CreatureScript
{
// not a likely case, code here for the sake of example
if (killer == me)
{
DoScriptText(SAY_DEATH_1, me, player);
}
else
DoScriptText(SAY_DEATH_2, me, player);
}
@@ -52,7 +52,7 @@ class npc_henry_stern : public CreatureScript
public:
npc_henry_stern() : CreatureScript("npc_henry_stern") { }
bool OnGossipSelect (Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF + 1)
@@ -70,7 +70,7 @@ public:
return true;
}
bool OnGossipHello (Player* player, Creature* creature)
bool OnGossipHello(Player* player, Creature* creature)
{
if (player->GetBaseSkillValue(SKILL_COOKING) >= 175 && !player->HasSpell(SPELL_GOLDTHORN_TEA))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
@@ -81,7 +81,6 @@ public:
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
};
/*######
@@ -115,7 +115,7 @@ public:
case 45:
DoScriptText(SAY_WIN, me, player);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
if (player && player->GetTypeId() == TYPEID_PLAYER)
if (player->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me);
break;
case 46:
@@ -399,9 +399,9 @@ public:
enum
{
ZOMBIE = 7286,
DEAD_HERO = 7276,
ZOMBIE_CHANCE = 65,
ZOMBIE = 7286,
DEAD_HERO = 7276,
ZOMBIE_CHANCE = 65,
DEAD_HERO_CHANCE = 10
};
@@ -419,13 +419,12 @@ public:
if (randomchance < ZOMBIE_CHANCE)
go->SummonCreature(ZOMBIE, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
else
if ((randomchance-ZOMBIE_CHANCE) < DEAD_HERO_CHANCE)
if ((randomchance - ZOMBIE_CHANCE) < DEAD_HERO_CHANCE)
go->SummonCreature(DEAD_HERO, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
}
go->AddUse();
return false;
}
};
/*######
+17 -33
View File
@@ -100,8 +100,7 @@ class npc_torek : public CreatureScript
case 20:
DoScriptText(SAY_WIN, me, player);
Completed = true;
if (player)
player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
break;
case 21:
Talk(SAY_END, player->GetGUID());
@@ -177,47 +176,41 @@ class npc_torek : public CreatureScript
class npc_ruul_snowhoof : public CreatureScript
{
public:
npc_ruul_snowhoof()
: CreatureScript("npc_ruul_snowhoof")
{
}
npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { }
struct npc_ruul_snowhoofAI : public npc_escortAI
{
npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) {}
npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { }
void WaypointReached(uint32 i)
{
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (i)
{
case 0: {
case 0:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20);
if (Cage)
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
break;}
case 13:
break;
case 13:
me->SummonCreature(3922, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 19:
case 19:
me->SummonCreature(3922, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 21:{
if (player)
player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
break; }
case 21:
player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
break;
}
}
@@ -330,12 +323,10 @@ class npc_muglash : public CreatureScript
switch (i)
{
case 0:
if (player)
DoScriptText(SAY_MUG_START2, me, player);
DoScriptText(SAY_MUG_START2, me, player);
break;
case 24:
if (player)
DoScriptText(SAY_MUG_BRAZIER, me, player);
DoScriptText(SAY_MUG_BRAZIER, me, player);
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2))
{
@@ -345,9 +336,7 @@ class npc_muglash : public CreatureScript
break;
case 25:
DoScriptText(SAY_MUG_GRATITUDE, me);
if (player)
player->GroupEventHappens(QUEST_VORSHA, me);
player->GroupEventHappens(QUEST_VORSHA, me);
break;
case 26:
DoScriptText(SAY_MUG_PATROL, me);
@@ -378,14 +367,9 @@ class npc_muglash : public CreatureScript
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
if (player)
{
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_VORSHA);
}
}
}
void DoWaveSummon()
@@ -602,7 +602,7 @@ public:
ravager->AI()->AttackStart(player);
}
}
return true ;
return true;
}
};
+2 -3
View File
@@ -238,7 +238,7 @@ public:
break;
case 15:
if (player)
player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me);
player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me);
break;
}
}
@@ -249,8 +249,7 @@ public:
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (player)
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL);
return;
}
@@ -641,9 +641,9 @@ public:
DoScriptText(SAY_QUEST_COMPLETE, me, player);
me->SetSpeed(MOVE_RUN, 1.2f, true);
me->SetWalk(false);
if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H))
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H))
player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me);
if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A))
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A))
player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me);
break;
case 39:
@@ -663,10 +663,11 @@ public:
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (HasEscortState(STATE_ESCORT_ESCORTING) && player)
if (player && HasEscortState(STATE_ESCORT_ESCORTING))
{
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H))
player->FailQuest(QUEST_STINKYS_ESCAPE_H);
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A))
player->FailQuest(QUEST_STINKYS_ESCAPE_A);
}
+1 -3
View File
@@ -154,9 +154,7 @@ public:
DoScriptText(SAY_OOX_END, me);
// Award quest credit
if (Player* player = GetPlayerForEscort())
{
player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me);
}
player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me);
break;
}
}
@@ -123,17 +123,18 @@ public:
switch (i)
{
case 16:
DoScriptText(SAY_AMBUSH, me);
me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 18: me->SetInFront(player);
DoScriptText(SAY_END, me, player);
if (player)
case 16:
DoScriptText(SAY_AMBUSH, me);
me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 18:
me->SetInFront(player);
DoScriptText(SAY_END, me, player);
player->GroupEventHappens(QUEST_PROTECT_KAYA, me);
break;
break;
}
}
+4 -7
View File
@@ -435,7 +435,8 @@ public:
if (!player)
return;
switch (i) {
switch (i)
{
case 23:
me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_FIRST, -8355.96f, -4447.79f, 10.10f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
@@ -453,11 +454,8 @@ public:
break;
case 86:
if (player)
{
DoScriptText(SAY_OOX_END, me);
player->GroupEventHappens(Q_OOX17, me);
}
DoScriptText(SAY_OOX_END, me);
player->GroupEventHappens(Q_OOX17, me);
break;
}
}
@@ -474,7 +472,6 @@ public:
summoned->AI()->AttackStart(me);
}
};
};
/*####
@@ -595,11 +595,6 @@ public:
void WaypointReached(uint32 uiPointId)
{
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (uiPointId)
{
case 0:
@@ -277,7 +277,6 @@ public:
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
}
};
};
/*#####
@@ -316,6 +315,7 @@ public:
{
if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(738, creature->GetGUID());
return true;
@@ -410,7 +410,6 @@ public:
bool OnGossipHello(Player* player, GameObject* go)
{
if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE)
{
if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true))
@@ -421,7 +420,7 @@ public:
}
}
return true ;
return true;
}
};
@@ -104,8 +104,7 @@ public:
break;
case 55:
DoScriptText(SAY_FINISH, me, player);
if (player)
player->GroupEventHappens(QUEST_CHASING_AME, me);
player->GroupEventHappens(QUEST_CHASING_AME, me);
break;
}
}
+2 -2
View File
@@ -161,12 +161,12 @@ public:
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HWDM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(3377, creature->GetGUID());
}else
}
else
player->SEND_GOSSIP_MENU(3375, creature->GetGUID());
return true;
}
};
void AddSC_winterspring()
@@ -105,7 +105,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTERS ; ++i)
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
if (EncounterStatus[i] == IN_PROGRESS)
return true;
return false;
@@ -457,7 +457,7 @@ public:
{
if (HealthBelowPct(45))
{
Phase = 3 ;
Phase = 3;
DoScriptText(SAY_REQUEST_AID, me);
//here Lich King should respond to KelThuzad but I don't know which Creature to make talk
//so for now just make Kelthuzad says it.
@@ -465,7 +465,6 @@ public:
playerDied = buff2;
}
};
};
void AddSC_instance_naxxramas()
@@ -203,7 +203,7 @@ public:
if (!instance || instance->GetData(DATA_UROM_PLATAFORM) > 2)
return;
for (uint8 i = 0; i < 4 ; i++)
for (uint8 i = 0; i < 4; i++)
{
SetPosition(i);
me->SummonCreature(Group[group[instance->GetData(DATA_UROM_PLATAFORM)]].entry[i], x, y, me->GetPositionZ(), me->GetOrientation());
@@ -308,7 +308,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader
float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation();
for (std::list<Unit*>::iterator itr = targetList.begin() ; itr != targetList.end();)
for (std::list<Unit*>::iterator itr = targetList.begin(); itr != targetList.end();)
{
Position pos;
(*itr)->GetPosition(&pos);
@@ -355,7 +355,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader
float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation();
for (std::list<Unit*>::iterator itr = targetList.begin() ; itr != targetList.end();)
for (std::list<Unit*>::iterator itr = targetList.begin(); itr != targetList.end();)
{
Position pos;
(*itr)->GetPosition(&pos);
@@ -48,65 +48,77 @@ public:
void Reset()
{
if (fm_Type == 0) fm_Type = GetForgeMasterType();
if (fm_Type == 0)
fm_Type = GetForgeMasterType();
CheckForge();
}
void CheckForge()
{
if (instance)
if (instance)
{
switch (fm_Type)
{
case 1:
instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE);
break;
case 2:
instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE);
break;
case 3:
instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE);
break;
case 1:
instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE);
break;
case 2:
instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE);
break;
case 3:
instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE);
break;
}
}
}
void JustDied(Unit* /*killer*/)
{
if (fm_Type == 0) fm_Type = GetForgeMasterType();
if (fm_Type == 0)
fm_Type = GetForgeMasterType();
if (instance)
{
switch (fm_Type)
{
case 1:
instance->SetData(EVENT_FORGE_1, DONE);
break;
case 2:
instance->SetData(EVENT_FORGE_2, DONE);
break;
case 3:
instance->SetData(EVENT_FORGE_3, DONE);
break;
case 1:
instance->SetData(EVENT_FORGE_1, DONE);
break;
case 2:
instance->SetData(EVENT_FORGE_2, DONE);
break;
case 3:
instance->SetData(EVENT_FORGE_3, DONE);
break;
}
}
}
void EnterCombat(Unit* /*who*/)
{
if (fm_Type == 0) fm_Type = GetForgeMasterType();
if (fm_Type == 0)
fm_Type = GetForgeMasterType();
if (instance)
{
switch (fm_Type)
{
case 1:
instance->SetData(EVENT_FORGE_1, IN_PROGRESS);
break;
case 2:
instance->SetData(EVENT_FORGE_2, IN_PROGRESS);
break;
case 3:
instance->SetData(EVENT_FORGE_3, IN_PROGRESS);
break;
case 1:
instance->SetData(EVENT_FORGE_1, IN_PROGRESS);
break;
case 2:
instance->SetData(EVENT_FORGE_2, IN_PROGRESS);
break;
case 3:
instance->SetData(EVENT_FORGE_3, IN_PROGRESS);
break;
}
}
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
@@ -115,29 +127,26 @@ public:
uint8 GetForgeMasterType()
{
float diff = 30.0f;
int near_f = 0;
uint8 near_f = 0;
for (uint8 i = 0; i < 3 ; ++i)
for (uint8 i = 0; i < 3; ++i)
{
GameObject* temp;
temp = me->FindNearestGameObject(entry_search[i], 30);
if (temp)
if (GameObject* go = me->FindNearestGameObject(entry_search[i], 30))
{
if (me->IsWithinDist(temp, diff, false))
if (me->IsWithinDist(go, diff, false))
{
near_f = i + 1;
diff = me->GetDistance2d(temp);
diff = me->GetDistance2d(go);
}
}
}
switch (near_f)
{
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
}
}
@@ -152,7 +161,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_utgarde_keep()
@@ -1876,8 +1876,7 @@ public:
me->SetPhaseMask(1, true);
DoScriptText(SAY_5, me);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
if (player)
player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
SetRun(true);
break;
}
@@ -79,6 +79,7 @@ public:
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (i)
{
case 9:
@@ -102,6 +102,7 @@ public:
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (i)
{
case 1:
@@ -109,8 +110,7 @@ public:
SetRun(true);
break;
case 23:
if (player)
player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
me->DespawnOrUnsummon();
break;
case 5:
@@ -113,8 +113,8 @@ public:
if (Player* player = GetPlayerForEscort())
{
if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE)
player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS);
if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE)
player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS);
}
}
};
@@ -401,12 +401,12 @@ public:
{
m_uiChatTimer = 4000;
}
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
if (player)
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_DISASTER);
}
}
+9 -6
View File
@@ -377,15 +377,18 @@ public:
void WaypointReached(uint32 i)
{
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (i)
{
case 26:
DoScriptText(SAY_END_WP_REACHED, me, player);
break;
case 27:
if (player)
case 26:
DoScriptText(SAY_END_WP_REACHED, me, player);
break;
case 27:
player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me);
break;
break;
}
}
+1 -1
View File
@@ -1071,7 +1071,7 @@ public:
SummonList.clear();
for (uint8 uiI = 0; uiI < 16 ; uiI++)
for (uint8 uiI = 0; uiI < 16; uiI++)
{
if (Creature* summon = me->SummonCreature(Boss[uiBossRandom].uiAdd, AddSpawnPosition[uiI]))
{
@@ -236,8 +236,8 @@ class boss_warchief_kargath_bladefist : public CreatureScript
float x, y, randx, randy;
randx = 0.0f + rand()%40;
randy = 0.0f + rand()%40;
x = 210+ randx ;
y = -60- randy ;
x = 210+ randx;
y = -60- randy;
me->GetMotionMaster()->MovePoint(1, x, y, me->GetPositionZ());
Wait_Timer = 0;
}
+6 -14
View File
@@ -90,7 +90,6 @@ public:
player->AreaExploredOrEventHappens(10044);
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 10:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
@@ -135,12 +134,10 @@ public:
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
}
else
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
};
/*#####
@@ -235,7 +232,6 @@ public:
DoScriptText(SAY_MAG_MORE_REPLY, temp);
me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
@@ -311,7 +307,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
/*######
@@ -356,7 +351,6 @@ public:
}
}
};
};
/*######
@@ -401,6 +395,7 @@ public:
player->KilledMonsterCredit(NPC_CORKI_CREDIT_1, 0);
}
}
if (go->GetEntry() == GO_CORKIS_PRISON_2)
{
if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true))
@@ -411,6 +406,7 @@ public:
player->KilledMonsterCredit(NPC_CORKI_2, 0);
}
}
if (go->GetEntry() == GO_CORKIS_PRISON_3)
{
if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true))
@@ -689,15 +685,11 @@ class go_warmaul_prison : public GameObjectScript
if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 5.0f))
{
if (prisoner)
{
go->UseDoorOrButton();
if (player)
player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0);
go->UseDoorOrButton();
player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0);
prisoner->AI()->Talk(SAY_FREE, player->GetGUID());
prisoner->ForcedDespawn(6000);
}
prisoner->AI()->Talk(SAY_FREE, player->GetGUID());
prisoner->ForcedDespawn(6000);
}
return true;
}
+3 -6
View File
@@ -910,8 +910,7 @@ public:
break;
case 12:
if (player)
player->GroupEventHappens(Q_ALMABTRIEB, me);
player->GroupEventHappens(Q_ALMABTRIEB, me);
if (me->FindNearestCreature(N_THADELL, 30))
DoScriptText(SAY_THADELL_1, me); break;
case 13:
@@ -986,16 +985,14 @@ public:
}
break;
case 36: //return and quest_complete
if (player)
player->CompleteQuest(QUEST_MARK_V_IS_ALIVE);
player->CompleteQuest(QUEST_MARK_V_IS_ALIVE);
break;
}
}
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (player)
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_MARK_V_IS_ALIVE);
}
@@ -1108,7 +1108,6 @@ public:
break;
case 50:
DoScriptText(SAY_WIL_END, me, player);
player->GroupEventHappens(QUEST_ESCAPE_COILSCAR, me);
break;
}
@@ -349,9 +349,9 @@ public:
case 53: DoScriptText(WHISP18, me, player); break;
case 54: DoScriptText(WHISP19, me, player); break;
case 55: DoScriptText(WHISP20, me, player); break;
case 56: DoScriptText(WHISP21, me, player);
if (player)
player->GroupEventHappens(10211, me);
case 56:
DoScriptText(WHISP21, me, player);
player->GroupEventHappens(10211, me);
break;
}
}
+31 -20
View File
@@ -470,29 +470,40 @@ public:
switch (i)
{
case 0:
{
GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10);
if (Cage)
Cage->SetGoState(GO_STATE_ACTIVE);
}
break;
case 2: DoScriptText(SAY_PROGRESS_1, me, player); break;
case 5: DoScriptText(SAY_PROGRESS_2, me, player); break;
case 6: DoScriptText(SAY_PROGRESS_3, me, player); break;
case 29:DoScriptText(SAY_PROGRESS_4, me, player);
if (player)
{
case 0:
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10))
Cage->SetGoState(GO_STATE_ACTIVE);
break;
case 2:
DoScriptText(SAY_PROGRESS_1, me, player);
break;
case 5:
DoScriptText(SAY_PROGRESS_2, me, player);
break;
case 6:
DoScriptText(SAY_PROGRESS_3, me, player);
break;
case 29:
DoScriptText(SAY_PROGRESS_4, me, player);
if (player->GetTeam() == ALLIANCE)
player->GroupEventHappens(QUEST_EFTW_A, me);
else if (player->GetTeam() == HORDE)
player->GroupEventHappens(QUEST_EFTW_H, me);
}
me->SetInFront(player); break;
case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
case 31: DoCast(me, SPELL_CAT);
me->SetWalk(false);
break;
me->SetInFront(player);
break;
case 30:
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
break;
case 31:
DoCast(me, SPELL_CAT);
me->SetWalk(false);
break;
}
}
@@ -676,7 +687,7 @@ public:
me->SummonCreature(NPC_CABAL_SKRIMISHER, -2793.55f, 5412.79f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 11:
if (player && player->GetTypeId() == TYPEID_PLAYER)
if (player->GetTypeId() == TYPEID_PLAYER)
player->GroupEventHappens(QUEST_ESCAPING_THE_TOMB, me);
break;
}
@@ -56,6 +56,7 @@ public:
{
if (creature->GetEntry() == 17900)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
if (creature->GetEntry() == 17901)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
}
+1 -1
View File
@@ -337,7 +337,7 @@ class spell_dk_death_pact : public SpellScriptLoader
void FilterTargets(std::list<Unit*>& unitList)
{
Unit* unit_to_add = NULL;
for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end(); ++itr)
for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
{
if ((*itr)->GetTypeId() == TYPEID_UNIT
&& (*itr)->GetOwnerGUID() == GetCaster()->GetGUID()
+4 -4
View File
@@ -1589,15 +1589,15 @@ class spell_item_brewfest_mount_transformation : public SpellScriptLoader
{
case SPELL_BREWFEST_MOUNT_TRANSFORM:
if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ;
spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100;
else
spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ;
spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60;
break;
case SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE:
if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ;
spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100;
else
spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ;
spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60;
break;
default:
return;
@@ -371,7 +371,7 @@ class boss_ysondre : public CreatureScript
{
Talk(SAY_YSONDRE_SUMMON_DRUIDS);
for (uint8 i = 0 ; i < 10 ; ++i)
for (uint8 i = 0; i < 10; ++i)
DoCast(me, SPELL_SUMMON_DRUID_SPIRITS, true);
++_stage;
}