Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts: src/server/game/Groups/Group.cpp src/server/game/Handlers/BattleGroundHandler.cpp src/server/game/Handlers/MailHandler.cpp src/server/game/Handlers/MiscHandler.cpp src/server/game/Server/Protocol/Opcodes.cpp src/server/game/Server/Protocol/Opcodes.h src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSocket.cpp src/server/worldserver/worldserver.conf.dist
This commit is contained in:
1 parent
df2d42e5c7
commit
e3ea3b28bd
54 files changed
+533
-343
No files matched your search
@@ -13,6 +13,7 @@ set(scripts_STAT_SRCS
|
||||
Commands/cs_account.cpp
|
||||
Commands/cs_achievement.cpp
|
||||
Commands/cs_ban.cpp
|
||||
Commands/cs_bf.cpp
|
||||
Commands/cs_cast.cpp
|
||||
Commands/cs_character.cpp
|
||||
Commands/cs_debug.cpp
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (sWorld->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : ""))
|
||||
switch (sWorld->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : ""))
|
||||
{
|
||||
case BAN_SUCCESS:
|
||||
{
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (sWorld->BanAccount(mode, nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : ""))
|
||||
switch (sWorld->BanAccount(mode, nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : ""))
|
||||
{
|
||||
case BAN_SUCCESS:
|
||||
if (atoi(durationStr) > 0)
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
{ "add", SEC_ADMINISTRATOR, false, &HandleQuestAdd, "", NULL },
|
||||
{ "complete", SEC_ADMINISTRATOR, false, &HandleQuestComplete, "", NULL },
|
||||
{ "remove", SEC_ADMINISTRATOR, false, &HandleQuestRemove, "", NULL },
|
||||
{ "reward", SEC_ADMINISTRATOR, false, &HandleQuestReward, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
static ChatCommand commandTable[] =
|
||||
@@ -77,7 +78,7 @@ public:
|
||||
|
||||
// check item starting quest (it can work incorrectly if added without item in inventory)
|
||||
ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore();
|
||||
ItemTemplateContainer::const_iterator result = find_if (itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
|
||||
ItemTemplateContainer::const_iterator result = find_if(itc->begin(), itc->end(), Finder<uint32, ItemTemplate>(entry, &ItemTemplate::StartQuest));
|
||||
|
||||
if (result != itc->end())
|
||||
{
|
||||
@@ -244,6 +245,38 @@ public:
|
||||
player->CompleteQuest(entry);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleQuestReward(ChatHandler* handler, char const* args)
|
||||
{
|
||||
Player* player = handler->getSelectedPlayer();
|
||||
if (!player)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// .quest reward #entry
|
||||
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r
|
||||
char* cId = handler->extractKeyFromLink((char*)args, "Hquest");
|
||||
if (!cId)
|
||||
return false;
|
||||
|
||||
uint32 entry = atol(cId);
|
||||
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(entry);
|
||||
|
||||
// If player doesn't have the quest
|
||||
if (!quest || player->GetQuestStatus(entry) != QUEST_STATUS_COMPLETE)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
player->RewardQuest(quest, 0, player);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_quest_commandscript()
|
||||
|
||||
+6
-6
@@ -207,7 +207,7 @@ public:
|
||||
{
|
||||
if (!m_bIntro)
|
||||
{
|
||||
DoScriptText(SAY_INTRO, me);
|
||||
Talk(SAY_INTRO);
|
||||
m_bIntro = false;
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Summons.DespawnAll();
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_ANUBARAK, DONE);
|
||||
}
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
break;
|
||||
case NPC_SPIKE:
|
||||
summoned->CombatStart(target);
|
||||
DoScriptText(EMOTE_SPIKE, me, target);
|
||||
Talk(EMOTE_SPIKE, target->GetGUID());
|
||||
break;
|
||||
}
|
||||
Summons.Summon(summoned);
|
||||
@@ -260,7 +260,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
Talk(SAY_AGGRO);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetInCombatWithZone();
|
||||
if (instance)
|
||||
@@ -405,8 +405,8 @@ public:
|
||||
{
|
||||
m_bReachedPhase3 = true;
|
||||
DoCastAOE(SPELL_LEECHING_SWARM);
|
||||
DoScriptText(EMOTE_LEECHING_SWARM, me);
|
||||
DoScriptText(SAY_LEECHING_SWARM, me);
|
||||
Talk(EMOTE_LEECHING_SWARM);
|
||||
Talk(SAY_LEECHING_SWARM);
|
||||
}
|
||||
|
||||
if (m_uiBerserkTimer <= uiDiff && !me->HasAura(SPELL_BERSERK))
|
||||
|
||||
+7
-7
@@ -161,7 +161,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Summons.DespawnAll();
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_JARAXXUS, DONE);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
me->SetInCombatWithZone();
|
||||
if (instance)
|
||||
instance->SetData(TYPE_JARAXXUS, IN_PROGRESS);
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
@@ -186,8 +186,8 @@ public:
|
||||
|
||||
if (m_uiSummonInfernalEruptionTimer <= uiDiff)
|
||||
{
|
||||
DoScriptText(EMOTE_INFERNAL_ERUPTION, me);
|
||||
DoScriptText(SAY_INFERNAL_ERUPTION, me);
|
||||
Talk(EMOTE_INFERNAL_ERUPTION);
|
||||
Talk(SAY_INFERNAL_ERUPTION);
|
||||
DoCast(SPELL_INFERNAL_ERUPTION);
|
||||
m_uiSummonInfernalEruptionTimer = 2*MINUTE*IN_MILLISECONDS;
|
||||
} else m_uiSummonInfernalEruptionTimer -= uiDiff;
|
||||
@@ -217,8 +217,8 @@ public:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true))
|
||||
{
|
||||
DoScriptText(EMOTE_INCINERATE, me, target);
|
||||
DoScriptText(SAY_INCINERATE, me);
|
||||
Talk(EMOTE_INCINERATE, target->GetGUID());
|
||||
Talk(SAY_INCINERATE);
|
||||
DoCast(target, SPELL_INCINERATE_FLESH);
|
||||
}
|
||||
m_uiIncinerateFleshTimer = urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS);
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true))
|
||||
{
|
||||
DoScriptText(EMOTE_LEGION_FLAME, me, target);
|
||||
Talk(EMOTE_LEGION_FLAME, target->GetGUID());
|
||||
DoCast(target, SPELL_LEGION_FLAME);
|
||||
}
|
||||
m_uiLegionFlameTimer = 30*IN_MILLISECONDS;
|
||||
|
||||
+13
-3
@@ -905,6 +905,8 @@ public:
|
||||
if (m_uiMassiveCrashTimer <= diff)
|
||||
{
|
||||
me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 10.0f, 20.0f); // 1: Middle of the room
|
||||
SetCombatMovement(false);
|
||||
me->AttackStop();
|
||||
m_uiStage = 7; //Invalid (Do nothing more than move)
|
||||
m_uiMassiveCrashTimer = 30*IN_MILLISECONDS;
|
||||
} else m_uiMassiveCrashTimer -= diff;
|
||||
@@ -913,22 +915,28 @@ public:
|
||||
break;
|
||||
case 1:
|
||||
DoCastAOE(SPELL_MASSIVE_CRASH);
|
||||
me->StopMoving();
|
||||
me->AttackStop();
|
||||
m_uiStage = 2;
|
||||
break;
|
||||
case 2:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
{
|
||||
me->StopMoving();
|
||||
me->AttackStop();
|
||||
m_uiTrampleTargetGUID = target->GetGUID();
|
||||
me->SetTarget(m_uiTrampleTargetGUID);
|
||||
m_bTrampleCasted = false;
|
||||
SetCombatMovement(false);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
//SetCombatMovement(false);
|
||||
//me->GetMotionMaster()->MoveIdle();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_uiTrampleTimer = 4*IN_MILLISECONDS;
|
||||
m_uiStage = 3;
|
||||
} else m_uiStage = 6;
|
||||
break;
|
||||
case 3:
|
||||
me->StopMoving();
|
||||
me->AttackStop();
|
||||
if (m_uiTrampleTimer <= diff)
|
||||
{
|
||||
if (Unit* target = Unit::GetPlayer(*me, m_uiTrampleTargetGUID))
|
||||
@@ -941,12 +949,14 @@ public:
|
||||
me->GetMotionMaster()->MoveJump(2*me->GetPositionX()-m_fTrampleTargetX,
|
||||
2*me->GetPositionY()-m_fTrampleTargetY,
|
||||
me->GetPositionZ(),
|
||||
10.0f, 20.0f); // 2: Hop Backwards
|
||||
20.0f, 30.0f); // 2: Hop Backwards
|
||||
m_uiStage = 7; //Invalid (Do nothing more than move)
|
||||
} else m_uiStage = 6;
|
||||
} else m_uiTrampleTimer -= diff;
|
||||
break;
|
||||
case 4:
|
||||
me->StopMoving();
|
||||
me->AttackStop();
|
||||
Talk(EMOTE_TRAMPLE_START, m_uiTrampleTargetGUID);
|
||||
me->GetMotionMaster()->MoveCharge(m_fTrampleTargetX, m_fTrampleTargetY, m_fTrampleTargetZ+2, 42, 1);
|
||||
me->SetTarget(0);
|
||||
|
||||
+3
-3
@@ -254,7 +254,7 @@ struct boss_twin_baseAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
{
|
||||
if (Creature* pSister = GetSister())
|
||||
@@ -296,7 +296,7 @@ struct boss_twin_baseAI : public ScriptedAI
|
||||
instance->SetData(TYPE_VALKIRIES, IN_PROGRESS);
|
||||
}
|
||||
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
Talk(SAY_AGGRO);
|
||||
DoCast(me, m_uiSurgeSpellId);
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ struct boss_twin_baseAI : public ScriptedAI
|
||||
if (!m_bIsBerserk && m_uiBerserkTimer <= uiDiff)
|
||||
{
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
DoScriptText(SAY_BERSERK, me);
|
||||
Talk(SAY_BERSERK);
|
||||
m_bIsBerserk = true;
|
||||
}
|
||||
else
|
||||
|
||||
+11
@@ -244,10 +244,18 @@ class instance_trial_of_the_crusader : public InstanceMapScript
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_JARAXXUS:
|
||||
// Cleanup Icehowl
|
||||
if (Creature* icehowl = instance->GetCreature(IcehowlGUID))
|
||||
icehowl->DespawnOrUnsummon();
|
||||
if (data == DONE)
|
||||
EventStage = 2000;
|
||||
break;
|
||||
case TYPE_CRUSADERS:
|
||||
// Cleanup Jaraxxus
|
||||
if (Creature* jaraxxus = instance->GetCreature(JaraxxusGUID))
|
||||
jaraxxus->DespawnOrUnsummon();
|
||||
if (Creature* fizzlebang = instance->GetCreature(FizzlebangGUID))
|
||||
fizzlebang->DespawnOrUnsummon();
|
||||
switch (data)
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
@@ -267,6 +275,9 @@ class instance_trial_of_the_crusader : public InstanceMapScript
|
||||
}
|
||||
break;
|
||||
case TYPE_VALKIRIES:
|
||||
// Cleanup chest
|
||||
if (GameObject* cache = instance->GetGameObject(CrusadersCacheGUID))
|
||||
cache->Delete();
|
||||
switch (data)
|
||||
{
|
||||
case FAIL:
|
||||
|
||||
+1
-1
@@ -789,7 +789,7 @@ class npc_tirion_toc : public CreatureScript
|
||||
case 5005:
|
||||
m_uiUpdateTimer = 8000;
|
||||
instance->SetData(TYPE_EVENT, 5010);
|
||||
me->SummonCreature(NPC_LICH_KING_1, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5);
|
||||
me->SummonCreature(NPC_LICH_KING_1, ToCCommonLoc[2].GetPositionX(), ToCCommonLoc[2].GetPositionY(), ToCCommonLoc[2].GetPositionZ(), 5);
|
||||
break;
|
||||
case 5020:
|
||||
Talk(SAY_STAGE_4_03);
|
||||
|
||||
+2
-2
@@ -53,8 +53,8 @@ const Position ToCCommonLoc[]=
|
||||
{563.833008f, 195.244995f, 394.585561f, 0}, // 5 - Center
|
||||
{573.5f, 180.5f, 395.14f, 0}, // 6 Move 0 Right
|
||||
{553.5f, 180.5f, 395.14f, 0}, // 7 Move 0 Left
|
||||
{585.5f, 170.0f, 395.14f, 0}, // 8 Move 1 Right
|
||||
{545.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left
|
||||
{573.0f, 170.0f, 395.14f, 0}, // 8 Move 1 Right
|
||||
{555.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left
|
||||
{563.8f, 216.1f, 395.1f, 0}, // 10 Behind the door
|
||||
|
||||
{575.042358f, 195.260727f, 395.137146f, 0}, // 5
|
||||
|
||||
@@ -139,7 +139,7 @@ class npc_wg_demolisher_engineer : public CreatureScript
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender */, uint32 action)
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
@@ -207,7 +207,7 @@ class npc_wg_spirit_guide : public CreatureScript
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature */ , uint32 /*sender */ , uint32 action)
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender */ , uint32 action)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
@@ -225,17 +225,16 @@ class npc_wg_spirit_guide : public CreatureScript
|
||||
|
||||
struct npc_wg_spirit_guideAI : public ScriptedAI
|
||||
{
|
||||
npc_wg_spirit_guideAI(Creature* creature) : ScriptedAI(creature)
|
||||
{ }
|
||||
npc_wg_spirit_guideAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void UpdateAI(const uint32 /* diff */)
|
||||
void UpdateAI(uint32 const /*diff*/)
|
||||
{
|
||||
if (!me->HasUnitState(UNIT_STATE_CASTING))
|
||||
DoCast(me, SPELL_CHANNEL_SPIRIT_HEAL);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_wg_spirit_guideAI(creature);
|
||||
}
|
||||
@@ -258,7 +257,7 @@ class npc_wg_queue : public CreatureScript
|
||||
if (wintergrasp->IsWarTime())
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam()? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
|
||||
player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -275,7 +274,7 @@ class npc_wg_queue : public CreatureScript
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature */ , uint32 /*sender */ , uint32 /*action*/)
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender*/ , uint32 /*action*/)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
@@ -302,9 +301,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript
|
||||
|
||||
struct go_wg_vehicle_teleporterAI : public GameObjectAI
|
||||
{
|
||||
go_wg_vehicle_teleporterAI(GameObject* gameObject) : GameObjectAI(gameObject),
|
||||
_checkTimer(1000)
|
||||
{ }
|
||||
go_wg_vehicle_teleporterAI(GameObject* gameObject) : GameObjectAI(gameObject), _checkTimer(1000) { }
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
@@ -324,6 +321,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript
|
||||
}
|
||||
else _checkTimer -= diff;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _checkTimer;
|
||||
};
|
||||
@@ -358,12 +356,12 @@ class npc_wg_quest_giver : public CreatureScript
|
||||
|
||||
for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i)
|
||||
{
|
||||
uint32 quest_id = i->second;
|
||||
QuestStatus status = player->GetQuestStatus(quest_id);
|
||||
uint32 questId = i->second;
|
||||
QuestStatus status = player->GetQuestStatus(questId);
|
||||
if (status == QUEST_STATUS_COMPLETE)
|
||||
qm.AddMenuItem(quest_id, 4);
|
||||
qm.AddMenuItem(questId, 4);
|
||||
else if (status == QUEST_STATUS_INCOMPLETE)
|
||||
qm.AddMenuItem(quest_id, 4);
|
||||
qm.AddMenuItem(questId, 4);
|
||||
//else if (status == QUEST_STATUS_AVAILABLE)
|
||||
// qm.AddMenuItem(quest_id, 2);
|
||||
}
|
||||
@@ -549,17 +547,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
void AddSC_wintergrasp()
|
||||
{
|
||||
new npc_wg_queue();
|
||||
new npc_wg_spirit_guide();
|
||||
new npc_wg_demolisher_engineer();
|
||||
new go_wg_vehicle_teleporter();
|
||||
new npc_wg_quest_giver();
|
||||
new achievement_wg_didnt_stand_a_chance();
|
||||
new spell_wintergrasp_force_building();
|
||||
new spell_wintergrasp_grab_passenger();
|
||||
|
||||
new go_wg_vehicle_teleporter();
|
||||
new achievement_wg_didnt_stand_a_chance();
|
||||
}
|
||||
Reference in new issue
Block a user