aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/Makefile.am2
-rw-r--r--src/bindings/scripts/ScriptMgr.cpp10
-rw-r--r--src/bindings/scripts/VC71/71ScriptDev2.vcproj8
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj8
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj8
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp11
-rw-r--r--src/bindings/scripts/include/sc_creature.h2
-rw-r--r--src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp152
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp1
-rw-r--r--src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp203
-rw-r--r--src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp249
-rw-r--r--src/game/Chat.cpp6
-rw-r--r--src/game/Level2.cpp128
-rw-r--r--src/game/Level3.cpp109
-rw-r--r--src/game/Pet.h1
-rw-r--r--src/game/Player.h1
-rw-r--r--src/game/Spell.cpp16
-rw-r--r--src/game/SpellAuras.cpp4
-rw-r--r--src/game/Unit.cpp16
-rw-r--r--src/game/Unit.h2
-rw-r--r--src/game/WaypointMovementGenerator.cpp14
21 files changed, 807 insertions, 144 deletions
diff --git a/src/bindings/scripts/Makefile.am b/src/bindings/scripts/Makefile.am
index 2789b2a51b7..94a01ac23af 100644
--- a/src/bindings/scripts/Makefile.am
+++ b/src/bindings/scripts/Makefile.am
@@ -69,6 +69,7 @@ scripts/npc/npc_innkeeper.cpp \
scripts/npc/npc_professions.cpp \
scripts/npc/npcs_special.cpp \
scripts/zone/alterac_mountains/alterac_mountains.cpp \
+scripts/zone/arathi_highlands/arathi_highlands.cpp \
scripts/zone/ashenvale_forest/ashenvale.cpp\
scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp \
scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp \
@@ -274,6 +275,7 @@ scripts/zone/netherstorm/netherstorm.cpp \
scripts/zone/onyxias_lair/boss_onyxia.cpp \
scripts/zone/orgrimmar/orgrimmar.cpp \
scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp \
+scripts/zone/razorfen_kraul/razorfen_kraul.cpp \
scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp \
scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp \
scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp \
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp
index 76ad10fe6b3..49a1dc79cc8 100644
--- a/src/bindings/scripts/ScriptMgr.cpp
+++ b/src/bindings/scripts/ScriptMgr.cpp
@@ -108,6 +108,8 @@ extern void AddSC_npcs_special();
extern void AddSC_alterac_mountains();
//Arathi Highlands
+extern void AddSC_arathi_highlands();
+
//Ashenvale Forest
extern void AddSC_ashenvale();
@@ -408,6 +410,9 @@ extern void AddSC_orgrimmar();
//Razorfen Downs
extern void AddSC_boss_amnennar_the_coldbringer();
+//Razorfen Kraul
+extern void AddSC_razorfen_kraul();
+
//Redridge Mountains
//Ruins of Ahn'Qiraj
//Scarlet Monastery
@@ -1304,6 +1309,8 @@ void ScriptsInit()
AddSC_alterac_mountains();
//Arathi Highlands
+ AddSC_arathi_highlands();
+
//Ashenvale Forest
AddSC_ashenvale();
@@ -1604,6 +1611,9 @@ void ScriptsInit()
//Razorfen Downs
AddSC_boss_amnennar_the_coldbringer();
+ //Razorfen Kraul
+ AddSC_razorfen_kraul();
+
//Redridge Mountains
//Ruins of Ahn'Qiraj
//Scarlet Monastery
diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
index 8eb464b81c8..5d8da080d66 100644
--- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
@@ -372,6 +372,10 @@
<Filter
Name="Arathi Highlands"
>
+ <File
+ RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Deadmines"
@@ -528,6 +532,10 @@
<Filter
Name="Razorfen Kraul"
>
+ <File
+ RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Redridge Mountains"
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index f07fc80900e..60b74c03320 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -549,6 +549,10 @@
<Filter
Name="Arathi Highlands"
>
+ <File
+ RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Deadmines"
@@ -705,6 +709,10 @@
<Filter
Name="Razorfen Kraul"
>
+ <File
+ RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Redridge Mountains"
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 613ba6fa3c8..9c8c7da5a93 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -542,6 +542,10 @@
<Filter
Name="Arathi Highlands"
>
+ <File
+ RelativePath="..\scripts\zone\arathi_highlands\arathi_highlands.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Deadmines"
@@ -698,6 +702,10 @@
<Filter
Name="Razorfen Kraul"
>
+ <File
+ RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Redridge Mountains"
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp
index cd1e5788ebd..590118e7a8c 100644
--- a/src/bindings/scripts/include/sc_creature.cpp
+++ b/src/bindings/scripts/include/sc_creature.cpp
@@ -236,9 +236,14 @@ void ScriptedAI::DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool trigger
m_creature->CastSpell(who, spellInfo, triggered);
}
-void ScriptedAI::DoSay(const char* text, uint32 language, Unit* target)
-{
- if (target) m_creature->Say(text, language, target->GetGUID());
+void ScriptedAI::DoSay(const char* text, uint32 language, Unit* target, bool SayEmote)
+{
+ if (target)
+ {
+ m_creature->Say(text, language, target->GetGUID());
+ if(SayEmote)
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
+ }
else m_creature->Say(text, language, 0);
}
diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h
index 90a66911ac7..1878e6e11dc 100644
--- a/src/bindings/scripts/include/sc_creature.h
+++ b/src/bindings/scripts/include/sc_creature.h
@@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
void DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool triggered = false);
//Creature say
- void DoSay(const char* text, uint32 language, Unit* target);
+ void DoSay(const char* text, uint32 language, Unit* target, bool SayEmote = false);
//Creature Yell
void DoYell(const char* text, uint32 language, Unit* target);
diff --git a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp
new file mode 100644
index 00000000000..92dcb34a433
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp
@@ -0,0 +1,152 @@
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Arathi Highlands
+SD%Complete: 100
+SDComment: Quest support: 665
+SDCategory: Arathi Highlands
+EndScriptData */
+
+/* ContentData
+npc_professor_phizzlethorpe
+EndContentData */
+
+#include "precompiled.h"
+#include "../../npc/npc_escortAI.h"
+
+/*######
+## npc_professor_phizzlethorpe
+######*/
+
+#define SAY_PROGRESS_1 "Ok, $N. Follow me to the cave where I'll attempt to harness the power of the rune stone into these goggles."
+#define SAY_PROGRESS_2 "I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage."
+#define SAY_PROGRESS_3 "I'll begin drawing energy from the stone. Your job, $N, i to defend me. This place is cursed... trust me."
+#define EMOTE_PROGRESS_4 "begins tinkering with the goggles before the stone."
+#define SAY_AGGRO "Help!!! Get these things off me so I can get my work done!"
+#define SAY_PROGRESS_5 "Almost done! Just a little longer!"
+#define SAY_PROGRESS_6 "I've done it! I have harnessed the power of the stone into the goggles! Let's get out of here!"
+#define SAY_PROGRESS_7 "Phew! Glad to be back from that creepy cave."
+#define EMOTE_PROGRESS_8 "hands one glowing goggles over to Doctor Draxlegauge."
+#define SAY_PROGRESS_9 "Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!"
+
+#define QUEST_SUNKEN_TREASURE 665
+#define MOB_VENGEFUL_SURGE 2776
+
+struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
+{
+ npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {Reset();}
+
+ void WaypointReached(uint32 i)
+ {
+ Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
+
+ switch(i)
+ {
+ case 4:DoSay(SAY_PROGRESS_2, LANG_UNIVERSAL, player, true);break;
+ case 5:DoSay(SAY_PROGRESS_3, LANG_UNIVERSAL, player, true);break;
+ case 8:DoTextEmote(EMOTE_PROGRESS_4, NULL);break;
+ case 9:
+ {
+ Creature* sum1 = m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
+ Creature* sum2 = m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
+ sum1->Attack(m_creature, true);
+ sum2->Attack(m_creature, true);
+ break;
+ }
+ case 10:DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, player, true);break;
+ case 11:DoSay(SAY_PROGRESS_6, LANG_UNIVERSAL, player, true);break;
+ case 19:DoSay(SAY_PROGRESS_7, LANG_UNIVERSAL, player, true); break;
+ case 20:
+ DoTextEmote(EMOTE_PROGRESS_8, NULL);
+ DoSay(SAY_PROGRESS_9, LANG_UNIVERSAL, player, true);
+ ((Player*)player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature);
+ break;
+ }
+ }
+
+ void Reset(){}
+
+ void Aggro(Unit* who)
+ {
+ DoSay(SAY_AGGRO, LANG_UNIVERSAL, NULL);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (PlayerGUID)
+ {
+ Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
+ if (player)
+ ((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ npc_escortAI::UpdateAI(diff);
+ }
+};
+
+bool QuestAccept_npc_professor_phizzlethorpe(Player* player, Creature* creature, Quest const* quest)
+{
+ if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
+ {
+ creature->Say(SAY_PROGRESS_1, LANG_UNIVERSAL, player->GetGUID());
+ ((npc_escortAI*)(creature->AI()))->Start(false, false, false, player->GetGUID());
+ }
+ return true;
+}
+
+CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature)
+{
+ npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature);
+
+ professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08);
+ professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24);
+ professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24);
+ professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67);
+ professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000);
+ professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000);
+ professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56);
+ professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31);
+ professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000);
+ professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000);
+ professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000);
+ professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000);
+ professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31);
+ professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56);
+ professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42);
+ professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67);
+ professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24);
+ professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24);
+ professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08);
+ professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000);
+ professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000);
+
+ return (CreatureAI*)professor_phizzlethorpeAI;
+}
+
+void AddSC_arathi_highlands()
+{
+ Script * newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_professor_phizzlethorpe";
+ newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI;
+ newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe;
+ newscript->RegisterSelf();
+} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp
index 9e390e6bb21..30e8a49b84a 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp
@@ -58,6 +58,7 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI
Attumen = 0;
Mount_Timer = 0;
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetVisibility(VISIBILITY_ON);
}
diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp
new file mode 100644
index 00000000000..2d70b503a77
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp
@@ -0,0 +1,203 @@
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+SDName: Razorfen Kraul
+SD%Complete: 100
+SDComment: Quest support: 1144
+SDCategory: Razorfen Kraul
+EndScriptData */
+
+/* ContentData
+npc_willix
+EndContentData */
+
+#include "precompiled.h"
+#include "../../npc/npc_escortAI.h"
+
+#define SAY_READY -1047000
+#define SAY_POINT -10470001
+#define SAY_AGGRO1 -1047002
+#define SAY_BLUELEAF -1047003
+#define SAY_DANGER -1047004
+#define SAY_BAD -1047005
+#define SAY_THINK -1047006
+#define SAY_SOON -1047007
+#define SAY_FINALY -1047008
+#define SAY_WIN -1047009
+#define SAY_END -1047010
+
+#define QUEST_WILLIX_THE_IMPORTER 1144
+#define ENTRY_BOAR 4514
+
+struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI
+{
+npc_willixAI(Creature *c) : npc_escortAI(c) {Reset();}
+
+ void WaypointReached(uint32 i)
+ {
+ Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
+
+ if (!player)
+ return;
+
+ switch (i)
+ {
+ case 3:
+ m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
+ DoScriptText(SAY_POINT, m_creature, player);
+ break;
+ case 4:
+ m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
+ case 8:
+ DoScriptText(SAY_BLUELEAF, m_creature, player);
+ break;
+ case 9:
+ DoScriptText(SAY_DANGER, m_creature, player);
+ break;
+ case 13:
+ DoScriptText(SAY_BAD, m_creature, player);
+ break;
+ case 14:
+ m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
+ case 25:
+ DoScriptText(SAY_THINK, m_creature, player);
+ break;
+ case 31:
+ DoScriptText(SAY_SOON, m_creature, player);
+ break;
+ case 42:
+ DoScriptText(SAY_FINALY, m_creature, player);
+ break;
+ case 43:
+ m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
+ case 45:
+ DoScriptText(SAY_WIN, m_creature, player);
+ if (player && player->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature);
+ break;
+ case 46:
+ DoScriptText(SAY_END, m_creature, player);
+ break;
+ }
+ }
+
+ void Reset() {}
+
+ void Aggro(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO1, m_creature, NULL);
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ summoned->AI()->AttackStart(m_creature);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (PlayerGUID)
+ {
+ if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
+ ((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ npc_escortAI::UpdateAI(diff);
+ }
+};
+
+bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* quest)
+{
+ if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER)
+ {
+ ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
+ DoScriptText(SAY_READY, creature, player);
+ }
+
+ return true;
+}
+
+CreatureAI* GetAI_npc_willix(Creature *_Creature)
+{
+ npc_willixAI* thisAI = new npc_willixAI(_Creature);
+
+ thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000);
+ thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45);
+ thisAI->AddWaypoint(2, 2187, 1843.49, 59.33);
+ thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000);
+ thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000);
+ thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32);
+ thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85);
+ thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13);
+ thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000);
+ thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000);
+ thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27);
+ thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85);
+ thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71);
+ thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000);
+ thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000);
+ thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74);
+ thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41);
+ thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27);
+ thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92);
+ thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42);
+ thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70);
+ thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24);
+ thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21);
+ thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24);
+ thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24);
+ thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000);
+ thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26);
+ thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89);
+ thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40);
+ thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35);
+ thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65);
+ thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70);
+ thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79);
+ thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8);
+ thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93);
+ thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44);
+ thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11);
+ thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57);
+ thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62);
+ thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22);
+ thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39);
+ thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000);
+ thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000);
+ thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000);
+ thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18);
+ thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000);
+ thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000);
+
+ return (CreatureAI*)thisAI;
+}
+
+void AddSC_razorfen_kraul()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_willix";
+ newscript->GetAI = &GetAI_npc_willix;
+ newscript->pQuestAccept = &QuestAccept_npc_willix;
+ newscript->RegisterSelf();
+} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
index ee95d5066f3..be29cf79f0e 100644
--- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Shadowmoon_Valley
SD%Complete: 100
-SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082. Vendor Drake Dealer Hurlunk.
+SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 11082, 10451. Vendor Drake Dealer Hurlunk.
SDCategory: Shadowmoon Valley
EndScriptData */
@@ -30,9 +30,11 @@ npc_murkblood_overseer
npc_neltharaku
npc_karynaku
npc_oronok_tornheart
+npc_earthmender_wilda
EndContentData */
#include "precompiled.h"
+#include "../../npc/npc_escortAI.h"
/*#####
# mob_mature_netherwing_drake
@@ -1036,6 +1038,245 @@ bool QuestAccept_Overlord_Morghor(Player *player, Creature *_Creature, const Que
return false;
}
+/*####
+# npc_earthmender_wilda
+####*/
+
+#define SAY_START "I sense the tortured spirits, $N. They are this way, come quickly!"
+#define SAY_AGGRO1 "Watch out!"
+#define SAY_AGGRO2 "Naga attackers! Defend yourself!"
+#define ASSASSIN_SAY_AGGRO1 "Kill them all!"
+#define ASSASSIN_SAY_AGGRO2 "You will never essscape Coilssskarrr..."
+#define SAY_PROGRESS1 "Grant me protection $N, i must break trough their foul magic!"
+#define SAY_PROGRESS2 "The naga of Coilskar are exceptionally cruel to their prisoners. It is a miracle that I survived inside that watery prison for as long as I did. Earthmother be praised."
+#define SAY_PROGRESS3 "Now we must find the exit."
+#define SAY_PROGRESS4 "Lady Vashj must answer for these atrocities. She must be brought to justice!"
+#define SAY_PROGRESS5 "The tumultuous nature of the great waterways of Azeroth and Draenor are a direct result of tormented water spirits."
+#define SAY_PROGRESS6 "It shouldn't be much further, $N. The exit is just up ahead."
+#define SAY_END "Thank you, $N. Please return to my brethren at the Altar of Damnation, near the Hand of Gul'dan, and tell them that Wilda is safe. May the Earthmother watch over you..."
+
+
+#define QUEST_ESCAPE_FROM_COILSKAR_CISTERN 10451
+#define NPC_COILSKAR_ASSASSIN 21044
+
+struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI
+{
+ npc_earthmender_wildaAI(Creature *c) : npc_escortAI(c) {Reset();}
+
+ void Aggro(Unit *who)
+ {
+ Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
+
+ if(who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_COILSKAR_ASSASSIN)
+ DoSay(SAY_AGGRO2, LANG_UNIVERSAL, player);
+ else DoSay(SAY_AGGRO1, LANG_UNIVERSAL, player);
+ }
+
+ void Reset()
+ {
+ m_creature->setFaction(1726);
+ }
+
+ void WaypointReached(uint32 i)
+ {
+ Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
+
+ if (!player)
+ return;
+
+ switch(i)
+ {
+ case 0:
+ DoSay(SAY_START, LANG_UNIVERSAL, player);
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_TALK);
+ break;
+ case 13:
+ DoSay(SAY_PROGRESS1, LANG_UNIVERSAL, player);
+ SummonAssassin();
+ break;
+ case 14:
+ SummonAssassin(); break;
+ case 15:
+ DoSay(SAY_PROGRESS3, LANG_UNIVERSAL, player); break;
+ case 19:
+ switch(rand()%3)
+ {
+ case 0:
+ DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break;
+ case 1:
+ DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break;
+ case 2:
+ DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break;
+ }
+ break;
+ case 20:
+ SummonAssassin(); break;
+ case 26:
+ switch(rand()%3)
+ {
+ case 0:
+ DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break;
+ case 1:
+ DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break;
+ case 2:
+ DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break;
+ }
+ break;
+ case 27:
+ SummonAssassin(); break;
+ case 33:
+ switch(rand()%3)
+ {
+ case 0:
+ DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break;
+ case 1:
+ DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break;
+ case 2:
+ DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break;
+ }
+ break;
+ case 34:
+ SummonAssassin(); break;
+ case 37:
+ switch(rand()%3)
+ {
+ case 0:
+ DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break;
+ case 1:
+ DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break;
+ case 2:
+ DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break;
+ }
+ break;
+ case 38:
+ SummonAssassin(); break;
+ case 39:
+ DoSay(SAY_PROGRESS6, LANG_UNIVERSAL, player); break;
+ case 43:
+ switch(rand()%3)
+ {
+ case 0:
+ DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player); break;
+ case 1:
+ DoSay(SAY_PROGRESS4, LANG_UNIVERSAL, player); break;
+ case 2:
+ DoSay(SAY_PROGRESS5, LANG_UNIVERSAL, player); break;
+ }
+ break;
+ case 44:
+ SummonAssassin(); break;
+ case 50:
+ DoSay(SAY_END, LANG_UNIVERSAL, player);
+ ((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_COILSKAR_CISTERN, m_creature);
+ break;
+ }
+ }
+
+ void SummonAssassin()
+ {
+ Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
+
+ Creature* CoilskarAssassin = m_creature->SummonCreature(NPC_COILSKAR_ASSASSIN, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 0);
+ if( CoilskarAssassin )
+ {
+ switch(rand()%2)
+ {
+ case 0:
+ CoilskarAssassin->Say(ASSASSIN_SAY_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break;
+ case 1:
+ CoilskarAssassin->Say(ASSASSIN_SAY_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break;
+ }
+ CoilskarAssassin->AI()->AttackStart(m_creature);
+ }
+ else error_log("SD2 ERROR: Coilskar Assassin couldn't be summmoned");
+ }
+
+ void JustDied(Unit* killer)
+ {
+ if (PlayerGUID)
+ {
+ Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
+ if (player)
+ ((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_COILSKAR_CISTERN);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ npc_escortAI::UpdateAI(diff);
+ }
+};
+
+CreatureAI* GetAI_npc_earthmender_wildaAI(Creature *_Creature)
+{
+ npc_earthmender_wildaAI* earthmender_wildaAI = new npc_earthmender_wildaAI(_Creature);
+
+ earthmender_wildaAI->AddWaypoint(0, -2637.466064, 1359.977905, 35.889114, 2000); // SAY_START
+ earthmender_wildaAI->AddWaypoint(1, -2666.364990, 1348.222656, 34.445557);
+ earthmender_wildaAI->AddWaypoint(2, -2693.789307, 1336.964966, 34.445557);
+ earthmender_wildaAI->AddWaypoint(3, -2715.495361, 1328.054443, 34.106014);
+ earthmender_wildaAI->AddWaypoint(4, -2742.530762, 1314.138550, 33.606144);
+ earthmender_wildaAI->AddWaypoint(5, -2745.077148, 1311.108765, 33.630898);
+ earthmender_wildaAI->AddWaypoint(6, -2749.855225, 1302.737915, 33.475632);
+ earthmender_wildaAI->AddWaypoint(7, -2753.639648, 1294.059448, 33.314930);
+ earthmender_wildaAI->AddWaypoint(8, -2756.796387, 1285.122192, 33.391262);
+ earthmender_wildaAI->AddWaypoint(9, -2750.042969, 1273.661987, 33.188259);
+ earthmender_wildaAI->AddWaypoint(10, -2740.378418, 1258.846680, 33.212521);
+ earthmender_wildaAI->AddWaypoint(11, -2733.629395, 1248.259766, 33.640598);
+ earthmender_wildaAI->AddWaypoint(12, -2727.212646, 1238.606445, 33.520847);
+ earthmender_wildaAI->AddWaypoint(13, -2726.377197, 1237.264526, 33.461823, 4000); // SAY_PROGRESS1
+ earthmender_wildaAI->AddWaypoint(14, -2746.383301, 1266.390625, 33.191952, 2000);
+ earthmender_wildaAI->AddWaypoint(15, -2746.383301, 1266.390625, 33.191952, 4000); // SAY_PROGRESS3
+ earthmender_wildaAI->AddWaypoint(16, -2758.927734, 1285.134155, 33.341728);
+ earthmender_wildaAI->AddWaypoint(17, -2761.845703, 1292.313599, 33.209042);
+ earthmender_wildaAI->AddWaypoint(18, -2758.871826, 1300.677612, 33.285332);
+ earthmender_wildaAI->AddWaypoint(19, -2758.871826, 1300.677612, 33.285332);
+ earthmender_wildaAI->AddWaypoint(20, -2753.928955, 1307.755859, 33.452457);
+ earthmender_wildaAI->AddWaypoint(20, -2738.612061, 1316.191284, 33.482975);
+ earthmender_wildaAI->AddWaypoint(21, -2727.897461, 1320.013916, 33.381111);
+ earthmender_wildaAI->AddWaypoint(22, -2709.458740, 1315.739990, 33.301838);
+ earthmender_wildaAI->AddWaypoint(23, -2704.658936, 1301.620361, 32.463303);
+ earthmender_wildaAI->AddWaypoint(24, -2704.120117, 1298.922607, 32.768162);
+ earthmender_wildaAI->AddWaypoint(25, -2691.798340, 1292.846436, 33.852642);
+ earthmender_wildaAI->AddWaypoint(26, -2682.879639, 1288.853882, 32.995399);
+ earthmender_wildaAI->AddWaypoint(27, -2661.869141, 1279.682495, 26.686783);
+ earthmender_wildaAI->AddWaypoint(28, -2648.943604, 1270.272827, 24.147522);
+ earthmender_wildaAI->AddWaypoint(29, -2642.506836, 1262.938721, 23.512444);
+ earthmender_wildaAI->AddWaypoint(20, -2636.984863, 1252.429077, 20.418257);
+ earthmender_wildaAI->AddWaypoint(31, -2648.113037, 1224.984863, 8.691818);
+ earthmender_wildaAI->AddWaypoint(32, -2658.393311, 1200.136719, 5.492243);
+ earthmender_wildaAI->AddWaypoint(33, -2668.504395, 1190.450562, 3.127407);
+ earthmender_wildaAI->AddWaypoint(34, -2685.930420, 1174.360840, 5.163924);
+ earthmender_wildaAI->AddWaypoint(35, -2701.613770, 1160.026367, 5.611311);
+ earthmender_wildaAI->AddWaypoint(36, -2714.659668, 1149.980347, 4.342373);
+ earthmender_wildaAI->AddWaypoint(37, -2721.443359, 1145.002808, 1.913474);
+ earthmender_wildaAI->AddWaypoint(38, -2733.962158, 1143.436279, 2.620415);
+ earthmender_wildaAI->AddWaypoint(39, -2757.876709, 1146.937500, 6.184002, 2000); // SAY_PROGRESS6
+ earthmender_wildaAI->AddWaypoint(40, -2772.300537, 1166.052734, 6.331811);
+ earthmender_wildaAI->AddWaypoint(41, -2790.265381, 1189.941650, 5.207958);
+ earthmender_wildaAI->AddWaypoint(42, -2805.448975, 1208.663940, 5.557623);
+ earthmender_wildaAI->AddWaypoint(43, -2820.617676, 1225.870239, 6.266103);
+ earthmender_wildaAI->AddWaypoint(44, -2831.926758, 1237.725830, 5.808506);
+ earthmender_wildaAI->AddWaypoint(45, -2842.578369, 1252.869629, 6.807481);
+ earthmender_wildaAI->AddWaypoint(46, -2846.344971, 1258.727295, 7.386168);
+ earthmender_wildaAI->AddWaypoint(47, -2847.556396, 1266.771729, 8.208790);
+ earthmender_wildaAI->AddWaypoint(48, -2841.654541, 1285.809204, 7.933223);
+ earthmender_wildaAI->AddWaypoint(49, -2841.754883, 1289.832520, 6.990304);
+ earthmender_wildaAI->AddWaypoint(50, -2871.398438, 1302.348145, 6.807335, 8000); // SAY_END
+
+ return (CreatureAI*)earthmender_wildaAI;
+}
+
+bool QuestAccept_npc_earthmender_wilda(Player* player, Creature* creature, Quest const* quest)
+{
+ if (quest->GetQuestId() == QUEST_ESCAPE_FROM_COILSKAR_CISTERN)
+ {
+ creature->setFaction(1725);
+ ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
+ }
+ return true;
+}
+
void AddSC_shadowmoon_valley()
{
Script *newscript;
@@ -1107,4 +1348,10 @@ void AddSC_shadowmoon_valley()
newscript->pGossipHello = &GossipHello_npc_yarzill_fly;
newscript->pGossipSelect = &GossipSelect_npc_yarzill_fly;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_earthmender_wilda";
+ newscript->GetAI = &GetAI_npc_earthmender_wildaAI;
+ newscript->pQuestAccept = &QuestAccept_npc_earthmender_wilda;
+ newscript->RegisterSelf();
}
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 2cee426fded..c05fd2b35c6 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -859,6 +859,8 @@ int ChatHandler::ParseCommands(const char* text)
if(strlen(text) < 2)
return 0;
+ std::string fullcmd = text; // original `text` can't be used. It content destroyed in command code processing.
+
/// ignore messages staring from many dots.
if(text[0] == '.' && text[1] == '.' || text[0] == '!' && text[1] == '!')
return 0;
@@ -867,9 +869,7 @@ int ChatHandler::ParseCommands(const char* text)
if(text[0] == '!' || text[0] == '.')
++text;
- std::string fullcmd = text; // original `text` can't be used. It content destroyed in command code processing.
-
- if(!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
+ if(!ExecuteCommandInTable(getCommandTable(), text, fullcmd) && m_session->GetSecurity() > SEC_PLAYER)
SendSysMessage(LANG_NO_CMD);
return 1;
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 5f3b12b0eb8..97a094585d1 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -1679,80 +1679,72 @@ bool ChatHandler::HandleNpcFactionIdCommand(const char* args)
//kick player
bool ChatHandler::HandleKickPlayerCommand(const char *args)
{
- char* kickName = strtok((char*)args, " ");
- char* kickReason = strtok(NULL, "\n");
+ if(!*args)
+ return false;
+
+ const char* kickName = strtok((char*)args, " ");
+ if(!kickName)
+ {
- if (!kickName)
- {
- Player* player = getSelectedPlayer();
+ SendSysMessage(LANG_NO_CHAR_SELECTED);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ std::string name = kickName;
- if(!player)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
+ if(!normalizePlayerName(name))
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ if(m_session && name==m_session->GetPlayer()->GetName())
+ {
+ SendSysMessage(LANG_COMMAND_KICKSELF);
+ SetSentErrorMessage(true);
+ return false;
+ }
- if(player==m_session->GetPlayer())
- {
- SendSysMessage(LANG_COMMAND_KICKSELF);
- SetSentErrorMessage(true);
- return false;
- }
-
- if(player->GetSession()->GetSecurity() > m_session->GetSecurity())
- {
- SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
- SetSentErrorMessage(true);
- return false;
- }
+ Player* player = objmgr.GetPlayer(kickName);
+ if(!player)
+ {
+ SendSysMessage(LANG_PLAYER_NOT_FOUND);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ if(player->GetSession()->GetSecurity() > m_session->GetSecurity())
+ {
+ SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* kickReason = strtok(NULL, "\n");
+ std::string reason = "No Reason";
+ if(kickReason)
+ {reason = kickReason;}
- player->GetSession()->KickPlayer();
- }
- else
+ if(sWorld.KickPlayer(name.c_str()))
{
- std::string name = kickName;
- std::string reason = "No Reason";
- if(kickReason)
- reason = kickReason;
-
- if(!normalizePlayerName(name))
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- if(m_session && name==m_session->GetPlayer()->GetName())
- {
- SendSysMessage(LANG_COMMAND_KICKSELF);
- SetSentErrorMessage(true);
- return false;
- }
-
- if(objmgr.GetPlayer(kickName)->GetSession()->GetSecurity() > m_session->GetSecurity())
- {
- SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
- SetSentErrorMessage(true);
- return false;
- }
-
- if(sWorld.KickPlayer(name))
- {
- if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
- {
- sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), m_session->GetPlayer()->GetName(), reason.c_str());
- }
- else
- {
- PSendSysMessage(LANG_COMMAND_KICKMESSAGE, name.c_str(), m_session->GetPlayer()->GetName(), reason.c_str());
- }
- }
- else
- PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER, name.c_str());
- }
+ if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
+ {
+ sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), m_session->GetPlayer()->GetName(), reason.c_str());
+ }
+ else
+ {
+ PSendSysMessage(LANG_COMMAND_KICKMESSAGE, name.c_str(), m_session->GetPlayer()->GetName(), reason.c_str());
+ }
+ }
+ else
+ {
+ PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER, name.c_str());
+ return false;
+ }
- return true;
+ return true;
}
//show info of player
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 6bdffe0b187..ae0ea508308 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -731,43 +731,57 @@ bool ChatHandler::HandleLoadScriptsCommand(const char* args)
bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
{
- char* arg1 = strtok((char*)args, " ");
- if( !arg1 )
+ if(!*args)
return false;
- /// must be NULL if targeted syntax and must be not nULL if not targeted
- char* arg2 = strtok(NULL, " ");
-
std::string targetAccountName;
uint32 targetAccountId = 0;
uint32 targetSecurity = 0;
+ uint32 gm = 0;
+ char* arg1 = strtok((char*)args, " ");
+ char* arg2 = strtok(NULL, " ");
- /// only target player different from self allowed (if targetPlayer!=NULL then not console)
- Player* targetPlayer = getSelectedPlayer();
- if(targetPlayer && m_session->GetPlayer()!=targetPlayer)
+ if(getSelectedPlayer() && arg1 && !arg2)
{
- /// wrong command syntax or unexpected targeting
- if(arg2)
- return false;
+ targetAccountId = getSelectedPlayer()->GetSession()->GetAccountId();
+ accmgr.GetName(targetAccountId, targetAccountName);
+ Player* targetPlayer = getSelectedPlayer();
+ gm = atoi(arg1);
- /// security level expected in arg2 after this if.
- arg2 = arg1;
+ // Check for invalid specified GM level.
+ if ( (gm < SEC_PLAYER || gm > SEC_ADMINISTRATOR) )
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
+ return false;
+ }
- targetAccountId = targetPlayer->GetSession()->GetAccountId();
+ // Check if targets GM level and specified GM level is not higher than current gm level
targetSecurity = targetPlayer->GetSession()->GetSecurity();
- if(!accmgr.GetName(targetAccountId,targetAccountName))
+ if(targetSecurity >= m_session->GetSecurity() || gm >= m_session->GetSecurity() )
{
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,targetAccountName.c_str());
+ SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
SetSentErrorMessage(true);
return false;
}
- }
- else
+
+ // Decide which string to show
+ if(m_session->GetPlayer()!=targetPlayer)
+ {
+ PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm);
+ }else{
+ PSendSysMessage(LANG_YOURS_SECURITY_CHANGED, m_session->GetPlayer()->GetName(), gm);
+ }
+
+ loginDatabase.PExecute("UPDATE account SET gmlevel = '%d' WHERE id = '%u'", gm, targetAccountId);
+ return true;
+ }else
{
- /// wrong command syntax (second arg expected)
+ // Check for second parameter
if(!arg2)
return false;
-
+
+ // Check for account
targetAccountName = arg1;
if(!AccountMgr::normilizeString(targetAccountName))
{
@@ -775,41 +789,34 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
SetSentErrorMessage(true);
return false;
}
+
+ // Check for invalid specified GM level.
+ gm = atoi(arg2);
+ if ( (gm < SEC_PLAYER || gm > SEC_ADMINISTRATOR) )
+ {
+ SendSysMessage(LANG_BAD_VALUE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ targetAccountId = accmgr.GetId(arg1);
+ /// m_session==NULL only for console
+ uint32 plSecurity = m_session ? m_session->GetSecurity() : SEC_CONSOLE;
- targetAccountId = accmgr.GetId(targetAccountName);
+ /// can set security level only for target with less security and to less security that we have
+ /// This is also reject self apply in fact
targetSecurity = accmgr.GetSecurity(targetAccountId);
- }
-
- int32 gm = (int32)atoi(arg2);
- if ( gm < SEC_PLAYER || gm > SEC_ADMINISTRATOR )
- {
- SendSysMessage(LANG_BAD_VALUE);
- SetSentErrorMessage(true);
- return false;
- }
-
- /// m_session==NULL only for console
- uint32 plSecurity = m_session ? m_session->GetSecurity() : SEC_CONSOLE;
-
- /// can set security level only for target with less security and to less security that we have
- /// This is also reject self apply in fact
- if(targetSecurity >= plSecurity || uint32(gm) >= plSecurity )
- {
- SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
- SetSentErrorMessage(true);
- return false;
- }
+ if(targetSecurity >= plSecurity || gm >= plSecurity )
+ {
+ SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
+ SetSentErrorMessage(true);
+ return false;
+ }
- if(targetPlayer)
- {
- ChatHandler(targetPlayer).PSendSysMessage(LANG_YOURS_SECURITY_CHANGED,GetName(), gm);
- targetPlayer->GetSession()->SetSecurity(gm);
+ PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm);
+ loginDatabase.PExecute("UPDATE account SET gmlevel = '%d' WHERE id = '%u'", gm, targetAccountId);
+ return true;
}
-
- PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm);
- loginDatabase.PExecute("UPDATE account SET gmlevel = '%i' WHERE id = '%u'", gm, targetAccountId);
-
- return true;
}
/// Set password for account
diff --git a/src/game/Pet.h b/src/game/Pet.h
index 670d4101911..178ebfb131e 100644
--- a/src/game/Pet.h
+++ b/src/game/Pet.h
@@ -214,6 +214,7 @@ class Pet : public Creature
uint64 GetAuraUpdateMask() { return m_auraUpdateMask; }
void SetAuraUpdateMask(uint8 slot) { m_auraUpdateMask |= (uint64(1) << slot); }
+ void UnsetAuraUpdateMask(uint8 slot) { m_auraUpdateMask &= ~(uint64(1) << slot); }
void ResetAuraUpdateMask() { m_auraUpdateMask = 0; }
DeclinedName const* GetDeclinedNames() const { return m_declinedname; }
diff --git a/src/game/Player.h b/src/game/Player.h
index d46d6b69aaa..ef111762efa 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2156,6 +2156,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void SetGroupUpdateFlag(uint32 flag) { m_groupUpdateMask |= flag; }
uint64 GetAuraUpdateMask() { return m_auraUpdateMask; }
void SetAuraUpdateMask(uint8 slot) { m_auraUpdateMask |= (uint64(1) << slot); }
+ void UnsetAuraUpdateMask(uint8 slot) { m_auraUpdateMask &= ~(uint64(1) << slot); }
Player* GetNextRandomRaidMember(float radius);
PartyResult CanUninviteFromGroup() const;
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 8d5757595cb..e515c592c50 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1127,6 +1127,14 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if( m_caster != unit )
{
+ if (unit->GetCharmerOrOwnerGUID() != m_caster->GetGUID())
+ {
+ if (unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
+ {
+ m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
+ return;
+ }
+ }
if( !m_caster->IsFriendlyTo(unit) )
{
// for delayed spells ignore not visible explicit target
@@ -1536,10 +1544,10 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
case TARGET_UNIT_TARGET_ANY: // SelectMagnetTarget()?
case TARGET_UNIT_TARGET_PARTY:
case TARGET_UNIT_SINGLE_UNKNOWN:
- TagUnitMap.push_back(m_targets.getUnitTarget());
+ TagUnitMap.push_back(target);
break;
case TARGET_UNIT_PARTY_TARGET:
- m_caster->GetPartyMember(TagUnitMap, radius);
+ target->GetPartyMember(TagUnitMap, radius);
break;
case TARGET_UNIT_TARGET_ENEMY:
if(Unit* pUnitTarget = SelectMagnetTarget())
@@ -2148,11 +2156,11 @@ void Spell::cancel()
{
Unit* unit = m_caster->GetGUID()==(*ihit).targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID);
if( unit && unit->isAlive() )
- unit->RemoveAurasDueToSpell(m_spellInfo->Id);
+ unit->RemoveAurasDueToCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
}
}
- m_caster->RemoveAurasDueToSpell(m_spellInfo->Id);
+ m_caster->RemoveAurasDueToCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
SendChannelUpdate(0);
SendInterrupted(0);
SendCastResult(SPELL_FAILED_INTERRUPTED);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 67791f825d4..38ca4e91d4c 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -882,7 +882,7 @@ void Aura::_AddAura()
SendAuraUpdate(false);
// update for out of range group members
- m_target->UpdateAuraForGroup(slot);
+ m_target->UpdateAuraForGroup(slot, true);
}
}
else // use found slot
@@ -970,7 +970,7 @@ void Aura::_RemoveAura()
SendAuraUpdate(true);
// update for out of range group members
- m_target->UpdateAuraForGroup(slot);
+ m_target->UpdateAuraForGroup(slot, false);
if( IsSealSpell(GetSpellProto()) )
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT,false);
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 56a63cc5220..5a2503f99fe 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -11199,6 +11199,8 @@ void Unit::CleanupsBeforeDelete()
{
if(m_uint32Values) // only for fully created object
{
+ UnpossessSelf(false);
+ RemoveAllFromVision();
InterruptNonMeleeSpells(true);
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
CombatStop();
@@ -11208,8 +11210,6 @@ void Unit::CleanupsBeforeDelete()
RemoveAllAuras();
RemoveAllGameObjects();
RemoveAllDynObjects();
- UnpossessSelf(false);
- RemoveAllFromVision();
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
}
RemoveFromWorld();
@@ -12400,7 +12400,7 @@ uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectT
return CastingTime;
}
-void Unit::UpdateAuraForGroup(uint8 slot)
+void Unit::UpdateAuraForGroup(uint8 slot, bool apply)
{
if(GetTypeId() == TYPEID_PLAYER)
{
@@ -12408,7 +12408,10 @@ void Unit::UpdateAuraForGroup(uint8 slot)
if(player->GetGroup())
{
player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_AURAS);
- player->SetAuraUpdateMask(slot);
+ if(apply)
+ player->SetAuraUpdateMask(slot);
+ else
+ player->UnsetAuraUpdateMask(slot);
}
}
else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
@@ -12420,7 +12423,10 @@ void Unit::UpdateAuraForGroup(uint8 slot)
if(owner && (owner->GetTypeId() == TYPEID_PLAYER) && ((Player*)owner)->GetGroup())
{
((Player*)owner)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_AURAS);
- pet->SetAuraUpdateMask(slot);
+ if(apply)
+ pet->SetAuraUpdateMask(slot);
+ else
+ pet->UnsetAuraUpdateMask(slot);
}
}
}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index e2d1a25e7a2..31787663968 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1449,7 +1449,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void UpdateReactives(uint32 p_time);
// group updates
- void UpdateAuraForGroup(uint8 slot);
+ void UpdateAuraForGroup(uint8 slot, bool apply);
// pet auras
typedef std::set<PetAura const*> PetAuraSet;
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index 8786d25549e..589afa088c3 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -94,10 +94,14 @@ template<>
void
WaypointMovementGenerator<Creature>::Initialize(Creature &u)
{
- u.StopMoving();
- if(!path_id)
- path_id = u.GetWaypointPath();
- waypoints = WaypointMgr.GetPath(path_id);
+ u.StopMoving();
+ i_currentNode = -1; // uint32, become 0 in the first update
+ i_nextMoveTime.Reset(0);
+ StopedByPlayer = false;
+ if(!path_id)
+ path_id = u.GetWaypointPath();
+ /*i_currentNode = 0;
+ waypoints = WaypointMgr.GetPath(path_id);
if(waypoints && waypoints->size())
{
Traveller<Creature> traveller(u);
@@ -105,7 +109,7 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
InitTraveller(u,node);
i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
- }
+ }*/
}
template<>