aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-08-22 17:26:53 -0500
committerSubv <s.v.h21@hotmail.com>2012-08-22 17:26:53 -0500
commitdc95ce61b46ce2d542ee4c4dbdf35a9e854c4316 (patch)
treee673101dc6554a76dfacb5cf3497dd1d2bde4f41 /src/server/scripts/World
parentcecaab7948d5289439d1334d7bedcaae90e1fe3a (diff)
parent85ed0e32a9b2b029c1db3cf1a914b3940cf72b9b (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps
Conflicts: dep/PackageList.txt src/server/game/Movement/MotionMaster.cpp src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp src/server/game/Movement/MovementGenerators/PointMovementGenerator.h src/server/game/Movement/Spline/MoveSplineInit.h src/server/game/World/World.h
Diffstat (limited to 'src/server/scripts/World')
-rwxr-xr-xsrc/server/scripts/World/achievement_scripts.cpp47
-rw-r--r--src/server/scripts/World/areatrigger_scripts.cpp3
-rw-r--r--src/server/scripts/World/boss_emerald_dragons.cpp24
-rwxr-xr-xsrc/server/scripts/World/chat_log.cpp44
-rw-r--r--src/server/scripts/World/go_scripts.cpp66
-rw-r--r--src/server/scripts/World/guards.cpp3
-rw-r--r--src/server/scripts/World/item_scripts.cpp3
-rw-r--r--src/server/scripts/World/mob_generic_creature.cpp4
-rw-r--r--src/server/scripts/World/npc_innkeeper.cpp5
-rw-r--r--src/server/scripts/World/npc_professions.cpp6
-rw-r--r--src/server/scripts/World/npc_taxi.cpp4
-rw-r--r--src/server/scripts/World/npcs_special.cpp475
12 files changed, 340 insertions, 344 deletions
diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp
index 9bcf450b3aa..60572ee3e6a 100755
--- a/src/server/scripts/World/achievement_scripts.cpp
+++ b/src/server/scripts/World/achievement_scripts.cpp
@@ -235,30 +235,6 @@ class achievement_bg_av_perfection : public AchievementCriteriaScript
}
};
-class achievement_wg_didnt_stand_a_chance : public AchievementCriteriaScript
-{
-public:
- achievement_wg_didnt_stand_a_chance() : AchievementCriteriaScript("achievement_wg_didnt_stand_a_chance") { }
-
- bool OnCheck(Player* source, Unit* target)
- {
- if (!target)
- return false;
-
- if (Player* victim = target->ToPlayer())
- {
- if (!victim->IsMounted())
- return false;
-
- if (Vehicle* vehicle = source->GetVehicle())
- if (vehicle->GetVehicleInfo()->m_ID == 244) // Wintergrasp Tower Cannon
- return true;
- }
-
- return false;
- }
-};
-
class achievement_bg_sa_defense_of_ancients : public AchievementCriteriaScript
{
public:
@@ -313,6 +289,27 @@ class achievement_tilted : public AchievementCriteriaScript
}
};
+class achievement_not_even_a_scratch : public AchievementCriteriaScript
+{
+ public:
+ achievement_not_even_a_scratch() : AchievementCriteriaScript("achievement_not_even_a_scratch") { }
+
+ bool OnCheck(Player* source, Unit* /*target*/)
+ {
+ if (!source)
+ return false;
+
+ Battleground* battleground = source->GetBattleground();
+ if (!battleground)
+ return false;
+
+ if (static_cast<BattlegroundSA*>(battleground)->notEvenAScratch(source->GetTeam()))
+ return true;
+
+ return false;
+ }
+};
+
void AddSC_achievement_scripts()
{
new achievement_resilient_victory();
@@ -323,7 +320,6 @@ void AddSC_achievement_scripts()
new achievement_bg_ic_mowed_down();
new achievement_bg_sa_artillery();
new achievement_sickly_gazelle();
- new achievement_wg_didnt_stand_a_chance();
new achievement_everything_counts();
new achievement_bg_av_perfection();
new achievement_arena_kills("achievement_arena_2v2_kills", ARENA_TYPE_2v2);
@@ -331,4 +327,5 @@ void AddSC_achievement_scripts()
new achievement_arena_kills("achievement_arena_5v5_kills", ARENA_TYPE_5v5);
new achievement_bg_sa_defense_of_ancients();
new achievement_tilted();
+ new achievement_not_even_a_scratch();
}
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp
index daf0ef213d9..f302009a4f3 100644
--- a/src/server/scripts/World/areatrigger_scripts.cpp
+++ b/src/server/scripts/World/areatrigger_scripts.cpp
@@ -35,7 +35,8 @@ at_brewfest
at_area_52_entrance
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
/*######
## at_coilfang_waterfall
diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp
index 045dea9c9a9..abb20130ef8 100644
--- a/src/server/scripts/World/boss_emerald_dragons.cpp
+++ b/src/server/scripts/World/boss_emerald_dragons.cpp
@@ -224,9 +224,9 @@ class DreamFogTargetSelector
public:
DreamFogTargetSelector() { }
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* object) const
{
- return unit->HasAura(SPELL_SLEEP);
+ return object->ToUnit() && object->ToUnit()->HasAura(SPELL_SLEEP);
}
};
@@ -239,14 +239,14 @@ class spell_dream_fog_sleep : public SpellScriptLoader
{
PrepareSpellScript(spell_dream_fog_sleep_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& unitList)
{
- unitList.remove_if (DreamFogTargetSelector());
+ unitList.remove_if(DreamFogTargetSelector());
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
@@ -265,10 +265,12 @@ class MarkOfNatureTargetSelector
public:
MarkOfNatureTargetSelector() { }
- bool operator()(Unit* unit)
+ bool operator()(WorldObject* object) const
{
- // return anyone that isn't tagged or already under the influence of Aura of Nature
- return !(unit->HasAura(SPELL_MARK_OF_NATURE) && !unit->HasAura(SPELL_AURA_OF_NATURE));
+ if (Unit* unit = object->ToUnit())
+ // return anyone that isn't tagged or already under the influence of Aura of Nature
+ return !(unit->HasAura(SPELL_MARK_OF_NATURE) && !unit->HasAura(SPELL_AURA_OF_NATURE));
+ return true;
}
};
@@ -290,9 +292,9 @@ class spell_mark_of_nature : public SpellScriptLoader
return true;
}
- void FilterTargets(std::list<Unit*>& unitList)
+ void FilterTargets(std::list<WorldObject*>& targets)
{
- unitList.remove_if (MarkOfNatureTargetSelector());
+ targets.remove_if(MarkOfNatureTargetSelector());
}
void HandleEffect(SpellEffIndex effIndex)
@@ -305,7 +307,7 @@ class spell_mark_of_nature : public SpellScriptLoader
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_mark_of_nature_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
};
diff --git a/src/server/scripts/World/chat_log.cpp b/src/server/scripts/World/chat_log.cpp
index 2a5d814bfde..fb540c177bc 100755
--- a/src/server/scripts/World/chat_log.cpp
+++ b/src/server/scripts/World/chat_log.cpp
@@ -15,7 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
#include "Channel.h"
#include "Guild.h"
#include "Group.h"
@@ -31,25 +31,25 @@ public:
{
case CHAT_MSG_ADDON:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s sends: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s sends: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_SAY:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_PUBLIC))
- sLog->outChat("[SAY] Player %s says (language %u): %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[SAY] Player %s says (language %u): %s",
player->GetName(), lang, msg.c_str());
break;
case CHAT_MSG_EMOTE:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_PUBLIC))
- sLog->outChat("[TEXTEMOTE] Player %s emotes: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[TEXTEMOTE] Player %s emotes: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_YELL:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_PUBLIC))
- sLog->outChat("[YELL] Player %s yells (language %u): %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[YELL] Player %s yells (language %u): %s",
player->GetName(), lang, msg.c_str());
break;
}
@@ -58,10 +58,10 @@ public:
void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Player* receiver)
{
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_WHISPER))
- sLog->outChat("[WHISPER] Player %s tells %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[WHISPER] Player %s tells %s: %s",
player->GetName(), receiver ? receiver->GetName() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s tells %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s tells %s: %s",
player->GetName(), receiver ? receiver->GetName() : "<unknown>", msg.c_str());
}
@@ -73,52 +73,52 @@ public:
{
case CHAT_MSG_PARTY:
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_PARTY))
- sLog->outChat("[PARTY] Player %s tells group with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[PARTY] Player %s tells group with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s tells group with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s tells group with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
break;
case CHAT_MSG_PARTY_LEADER:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_PARTY))
- sLog->outChat("[PARTY] Leader %s tells group: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[PARTY] Leader %s tells group: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_RAID:
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_RAID))
- sLog->outChat("[RAID] Player %s tells raid with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[RAID] Player %s tells raid with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s tells raid with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s tells raid with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
break;
case CHAT_MSG_RAID_LEADER:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_RAID))
- sLog->outChat("[RAID] Leader player %s tells raid: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[RAID] Leader player %s tells raid: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_RAID_WARNING:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_RAID))
- sLog->outChat("[RAID] Leader player %s warns raid with: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[RAID] Leader player %s warns raid with: %s",
player->GetName(), msg.c_str());
break;
case CHAT_MSG_BATTLEGROUND:
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_BGROUND))
- sLog->outChat("[BATTLEGROUND] Player %s tells battleground with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[BATTLEGROUND] Player %s tells battleground with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s tells battleground with leader %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s tells battleground with leader %s: %s",
player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg.c_str());
break;
case CHAT_MSG_BATTLEGROUND_LEADER:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_BGROUND))
- sLog->outChat("[BATTLEGROUND] Leader player %s tells battleground: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[BATTLEGROUND] Leader player %s tells battleground: %s",
player->GetName(), msg.c_str());
break;
}
@@ -130,16 +130,16 @@ public:
{
case CHAT_MSG_GUILD:
if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_GUILD))
- sLog->outChat("[GUILD] Player %s tells guild %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[GUILD] Player %s tells guild %s: %s",
player->GetName(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str());
else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
- sLog->outChat("[ADDON] Player %s sends to guild %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[ADDON] Player %s sends to guild %s: %s",
player->GetName(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str());
break;
case CHAT_MSG_OFFICER:
if (sWorld->getBoolConfig(CONFIG_CHATLOG_GUILD))
- sLog->outChat("[OFFICER] Player %s tells guild %s officers: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[OFFICER] Player %s tells guild %s officers: %s",
player->GetName(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str());
break;
}
@@ -154,10 +154,10 @@ public:
channel->HasFlag(CHANNEL_FLAG_LFG));
if (sWorld->getBoolConfig(CONFIG_CHATLOG_SYSCHAN) && isSystem)
- sLog->outChat("[SYSCHAN] Player %s tells channel %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[SYSCHAN] Player %s tells channel %s: %s",
player->GetName(), channel->GetName().c_str(), msg.c_str());
else if (sWorld->getBoolConfig(CONFIG_CHATLOG_CHANNEL))
- sLog->outChat("[CHANNEL] Player %s tells channel %s: %s",
+ sLog->outDebug(LOG_FILTER_PLAYER_CHATLOG, "[CHANNEL] Player %s tells channel %s: %s",
player->GetName(), channel ? channel->GetName().c_str() : "<unknown>", msg.c_str());
}
};
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index 60ddf8990a7..3ce136b9737 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -50,7 +50,9 @@ go_large_gjalerbron_cage
go_veil_skith_cage
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*######
## go_cat_figurine
@@ -327,7 +329,7 @@ public:
if (Spell)
creature->CastSpell(player, Spell, false);
else
- sLog->outError("TSCR: go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", creature->GetEntry(), creature->getFaction());
+ sLog->outError(LOG_FILTER_TSCR, "go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", creature->GetEntry(), creature->getFaction());
}
}
}
@@ -1174,7 +1176,7 @@ class go_gjalerbron_cage : public GameObjectScript
player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0);
prisoner->AI()->Talk(SAY_FREE);
- prisoner->ForcedDespawn(6000);
+ prisoner->DespawnOrUnsummon(6000);
}
}
return true;
@@ -1201,7 +1203,7 @@ class go_large_gjalerbron_cage : public GameObjectScript
{
go->UseDoorOrButton();
player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, (*itr)->GetGUID());
- (*itr)->ForcedDespawn(6000);
+ (*itr)->DespawnOrUnsummon(6000);
(*itr)->AI()->Talk(SAY_FREE);
}
}
@@ -1235,7 +1237,7 @@ class go_veil_skith_cage : public GameObjectScript
{
go->UseDoorOrButton();
player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID());
- (*itr)->ForcedDespawn(5000);
+ (*itr)->DespawnOrUnsummon(5000);
(*itr)->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ());
(*itr)->AI()->Talk(SAY_FREE_0);
(*itr)->GetMotionMaster()->Clear();
@@ -1245,6 +1247,58 @@ class go_veil_skith_cage : public GameObjectScript
}
};
+/*######
+## go_frostblade_shrine
+######*/
+
+enum TheCleansing
+{
+ QUEST_THE_CLEANSING_HORDE = 11317,
+ QUEST_THE_CLEANSING_ALLIANCE = 11322,
+ SPELL_CLEANSING_SOUL = 43351,
+ SPELL_RECENT_MEDITATION = 61720,
+};
+
+class go_frostblade_shrine : public GameObjectScript
+{
+public:
+ go_frostblade_shrine() : GameObjectScript("go_frostblade_shrine") { }
+
+ bool OnGossipHello(Player* player, GameObject* go)
+ {
+ if (!player->HasAura(SPELL_RECENT_MEDITATION))
+ if (player->GetQuestStatus(QUEST_THE_CLEANSING_HORDE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_THE_CLEANSING_ALLIANCE) == QUEST_STATUS_INCOMPLETE)
+ {
+ go->UseDoorOrButton(10);
+ player->CastSpell(player, SPELL_CLEANSING_SOUL);
+ player->SetStandState(UNIT_STAND_STATE_SIT);
+ }
+ return true;
+ }
+};
+
+/*######
+## go_midsummer_bonfire
+######*/
+
+enum eMidsummerBonfire
+{
+ STAMP_OUT_BONFIRE_QUEST_COMPLETE = 45458,
+};
+
+class go_midsummer_bonfire : public GameObjectScript
+{
+public:
+ go_midsummer_bonfire() : GameObjectScript("go_midsummer_bonfire") { }
+
+ bool OnGossipSelect(Player* player, GameObject* /*go*/, uint32 /*sender*/, uint32 /*action*/)
+ {
+ player->CastSpell(player, STAMP_OUT_BONFIRE_QUEST_COMPLETE, true);
+ player->CLOSE_GOSSIP_MENU();
+ return false;
+ }
+};
+
void AddSC_go_scripts()
{
new go_cat_figurine;
@@ -1285,4 +1339,6 @@ void AddSC_go_scripts()
new go_gjalerbron_cage;
new go_large_gjalerbron_cage;
new go_veil_skith_cage;
+ new go_frostblade_shrine;
+ new go_midsummer_bonfire;
}
diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp
index e3100522fbe..4b0433fe0c7 100644
--- a/src/server/scripts/World/guards.cpp
+++ b/src/server/scripts/World/guards.cpp
@@ -29,7 +29,8 @@ guard_shattrath_aldor
guard_shattrath_scryer
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "GuardAI.h"
enum GuardGeneric
diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp
index ae69744ea2b..d888e6cb56b 100644
--- a/src/server/scripts/World/item_scripts.cpp
+++ b/src/server/scripts/World/item_scripts.cpp
@@ -30,7 +30,8 @@ item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
item_only_for_flight Items which should only useable while flying
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "Spell.h"
/*#####
diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp
index 208effee61b..be409670f5d 100644
--- a/src/server/scripts/World/mob_generic_creature.cpp
+++ b/src/server/scripts/World/mob_generic_creature.cpp
@@ -23,7 +23,9 @@ SDComment: Should be replaced with core based AI
SDCategory: Creatures
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "PassiveAI.h"
#define GENERIC_CREATURE_COOLDOWN 5000
diff --git a/src/server/scripts/World/npc_innkeeper.cpp b/src/server/scripts/World/npc_innkeeper.cpp
index fb7c0833d22..f57af517db2 100644
--- a/src/server/scripts/World/npc_innkeeper.cpp
+++ b/src/server/scripts/World/npc_innkeeper.cpp
@@ -23,7 +23,10 @@ SDComment: Complete
SDCategory: NPCs
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "GameEventMgr.h"
#define HALLOWEEN_EVENTID 12
#define SPELL_TRICK_OR_TREATED 24755
diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp
index 2afa80dd42c..175cfb190d7 100644
--- a/src/server/scripts/World/npc_professions.cpp
+++ b/src/server/scripts/World/npc_professions.cpp
@@ -23,7 +23,9 @@ SDComment: Provides learn/unlearn/relearn-options for professions. Not supported
SDCategory: NPCs
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
/*
A few notes for future developement:
@@ -242,7 +244,7 @@ bool EquippedOk(Player* player, uint32 spellId)
if (item && item->GetTemplate()->RequiredSpell == reqSpell)
{
//player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry());
+ sLog->outDebug(LOG_FILTER_TSCR, "player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry());
return false;
}
}
diff --git a/src/server/scripts/World/npc_taxi.cpp b/src/server/scripts/World/npc_taxi.cpp
index ceda8e0f6ac..6241978fbd2 100644
--- a/src/server/scripts/World/npc_taxi.cpp
+++ b/src/server/scripts/World/npc_taxi.cpp
@@ -24,7 +24,9 @@ SDCategory: NPCs
EndScriptData
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#define GOSSIP_SUSURRUS "I am ready."
#define GOSSIP_NETHER_DRAKE "I'm ready to fly! Take me up, dragon!"
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 6858827ed8e..5640a84317c 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -42,11 +42,22 @@ npc_locksmith 75% list of keys needs to be confirmed
npc_firework 100% NPC's summoned by rockets and rocket clusters, for making them cast visual
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "World.h"
+#include "PetAI.h"
+#include "PassiveAI.h"
+#include "CombatAI.h"
+#include "GameEventMgr.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "SpellAuras.h"
/*########
# npc_air_force_bots
@@ -130,14 +141,14 @@ public:
}
if (!SpawnAssoc)
- sLog->outErrorDb("TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", creature->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", creature->GetEntry());
else
{
CreatureTemplate const* spawnedTemplate = sObjectMgr->GetCreatureTemplate(SpawnAssoc->spawnedCreatureEntry);
if (!spawnedTemplate)
{
- sLog->outErrorDb("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", SpawnAssoc->spawnedCreatureEntry);
+ sLog->outError(LOG_FILTER_SQL, "TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", SpawnAssoc->spawnedCreatureEntry);
SpawnAssoc = NULL;
return;
}
@@ -157,7 +168,7 @@ public:
SpawnedGUID = summoned->GetGUID();
else
{
- sLog->outErrorDb("TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", SpawnAssoc->spawnedCreatureEntry);
+ sLog->outError(LOG_FILTER_SQL, "TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", SpawnAssoc->spawnedCreatureEntry);
SpawnAssoc = NULL;
}
@@ -835,7 +846,7 @@ void npc_doctor::npc_doctorAI::UpdateAI(uint32 const diff)
patientEntry = HordeSoldierId[rand() % 3];
break;
default:
- sLog->outError("TSCR: Invalid entry for Triage doctor. Please check your database");
+ sLog->outError(LOG_FILTER_TSCR, "Invalid entry for Triage doctor. Please check your database");
return;
}
@@ -1975,33 +1986,31 @@ public:
class npc_lightwell : public CreatureScript
{
-public:
- npc_lightwell() : CreatureScript("npc_lightwell") { }
-
- struct npc_lightwellAI : public PassiveAI
- {
- npc_lightwellAI(Creature* creature) : PassiveAI(creature) {}
+ public:
+ npc_lightwell() : CreatureScript("npc_lightwell") { }
- void Reset()
+ struct npc_lightwellAI : public PassiveAI
{
- DoCast(me, 59907, false); // Spell for Lightwell Charges
- }
+ npc_lightwellAI(Creature* creature) : PassiveAI(creature)
+ {
+ DoCast(me, 59907, false);
+ }
- void EnterEvadeMode()
- {
- if (!me->isAlive())
- return;
+ void EnterEvadeMode()
+ {
+ if (!me->isAlive())
+ return;
- me->DeleteThreatList();
- me->CombatStop(true);
- me->ResetPlayerDamageReq();
- }
- };
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->ResetPlayerDamageReq();
+ }
+ };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_lightwellAI(creature);
- }
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_lightwellAI(creature);
+ }
};
enum eTrainingDummy
@@ -2099,34 +2108,28 @@ public:
class npc_shadowfiend : public CreatureScript
{
-public:
- npc_shadowfiend() : CreatureScript("npc_shadowfiend") { }
-
- struct npc_shadowfiendAI : public ScriptedAI
- {
- npc_shadowfiendAI(Creature* creature) : ScriptedAI(creature) {}
+ public:
+ npc_shadowfiend() : CreatureScript("npc_shadowfiend") { }
- void DamageTaken(Unit* /*killer*/, uint32& damage)
+ struct npc_shadowfiendAI : public PetAI
{
- if (me->isSummon())
- if (Unit* owner = me->ToTempSummon()->GetSummoner())
- if (owner->HasAura(GLYPH_OF_SHADOWFIEND) && damage >= me->GetHealth())
- owner->CastSpell(owner, GLYPH_OF_SHADOWFIEND_MANA, true);
- }
+ npc_shadowfiendAI(Creature* creature) : PetAI(creature) {}
- void UpdateAI(uint32 const /*diff*/)
- {
- if (!UpdateVictim())
- return;
+ void JustDied(Unit* killer)
+ {
+ if (me->isSummon())
+ if (Unit* owner = me->ToTempSummon()->GetSummoner())
+ if (owner->HasAura(GLYPH_OF_SHADOWFIEND))
+ owner->CastSpell(owner, GLYPH_OF_SHADOWFIEND_MANA, true);
- DoMeleeAttackIfReady();
- }
- };
+ PetAI::JustDied(killer);
+ }
+ };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_shadowfiendAI(creature);
- }
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_shadowfiendAI(creature);
+ }
};
/*######
@@ -2193,7 +2196,7 @@ public:
}
};
- CreatureAI *GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* creature) const
{
return new npc_fire_elementalAI(creature);
}
@@ -2238,7 +2241,7 @@ public:
}
};
- CreatureAI *GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* creature) const
{
return new npc_earth_elementalAI(creature);
}
@@ -2248,78 +2251,111 @@ public:
# npc_wormhole
######*/
-#define GOSSIP_ENGINEERING1 "Borean Tundra."
-#define GOSSIP_ENGINEERING2 "Howling Fjord."
-#define GOSSIP_ENGINEERING3 "Sholazar Basin."
-#define GOSSIP_ENGINEERING4 "Icecrown."
-#define GOSSIP_ENGINEERING5 "Storm Peaks."
+#define GOSSIP_ENGINEERING1 "Borean Tundra"
+#define GOSSIP_ENGINEERING2 "Howling Fjord"
+#define GOSSIP_ENGINEERING3 "Sholazar Basin"
+#define GOSSIP_ENGINEERING4 "Icecrown"
+#define GOSSIP_ENGINEERING5 "Storm Peaks"
+#define GOSSIP_ENGINEERING6 "Underground..."
-enum eWormhole
+enum WormholeSpells
{
- SPELL_HOWLING_FJORD = 67838,
+ SPELL_BOREAN_TUNDRA = 67834,
SPELL_SHOLAZAR_BASIN = 67835,
SPELL_ICECROWN = 67836,
SPELL_STORM_PEAKS = 67837,
+ SPELL_HOWLING_FJORD = 67838,
+ SPELL_UNDERGROUND = 68081,
+
+ TEXT_WORMHOLE = 907,
- TEXT_WORMHOLE = 907
+ DATA_SHOW_UNDERGROUND = 1,
};
class npc_wormhole : public CreatureScript
{
-public:
- npc_wormhole() : CreatureScript("npc_wormhole") { }
+ public:
+ npc_wormhole() : CreatureScript("npc_wormhole") {}
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isSummon())
+ struct npc_wormholeAI : public PassiveAI
+ {
+ npc_wormholeAI(Creature* creature) : PassiveAI(creature) {}
+
+ void InitializeAI()
+ {
+ _showUnderground = urand(0, 100) == 0; // Guessed value, it is really rare though
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ return (type == DATA_SHOW_UNDERGROUND && _showUnderground) ? 1 : 0;
+ }
+
+ private:
+ bool _showUnderground;
+ };
+
+ bool OnGossipHello(Player* player, Creature* creature)
{
- if (player == creature->ToTempSummon()->GetSummoner())
+ if (creature->isSummon())
{
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+ if (player == creature->ToTempSummon()->GetSummoner())
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
+
+ if (creature->AI()->GetData(DATA_SHOW_UNDERGROUND))
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->PlayerTalkClass->SendGossipMenu(TEXT_WORMHOLE, creature->GetGUID());
+ player->PlayerTalkClass->SendGossipMenu(TEXT_WORMHOLE, creature->GetGUID());
+ }
}
+
+ return true;
}
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- bool roll = urand(0, 1);
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
+ {
+ player->PlayerTalkClass->ClearMenus();
- switch (action)
+ switch (action)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1: // Borean Tundra
+ player->CLOSE_GOSSIP_MENU();
+ creature->CastSpell(player, SPELL_BOREAN_TUNDRA, false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2: // Howling Fjord
+ player->CLOSE_GOSSIP_MENU();
+ creature->CastSpell(player, SPELL_HOWLING_FJORD, false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 3: // Sholazar Basin
+ player->CLOSE_GOSSIP_MENU();
+ creature->CastSpell(player, SPELL_SHOLAZAR_BASIN, false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 4: // Icecrown
+ player->CLOSE_GOSSIP_MENU();
+ creature->CastSpell(player, SPELL_ICECROWN, false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 5: // Storm peaks
+ player->CLOSE_GOSSIP_MENU();
+ creature->CastSpell(player, SPELL_STORM_PEAKS, false);
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 6: // Underground
+ player->CLOSE_GOSSIP_MENU();
+ creature->CastSpell(player, SPELL_UNDERGROUND, false);
+ break;
+ }
+
+ return true;
+ }
+
+ CreatureAI* GetAI(Creature* creature) const
{
- case GOSSIP_ACTION_INFO_DEF + 1: //Borean Tundra
- player->CLOSE_GOSSIP_MENU();
- if (roll) //At the moment we don't have chance on spell_target_position table so we hack this
- player->TeleportTo(571, 4305.505859f, 5450.839844f, 63.005806f, 0.627286f);
- else
- player->TeleportTo(571, 3201.936279f, 5630.123535f, 133.658798f, 3.855272f);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2: //Howling Fjord
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_HOWLING_FJORD, true);
- break;
- case GOSSIP_ACTION_INFO_DEF + 3: //Sholazar Basin
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_SHOLAZAR_BASIN, true);
- break;
- case GOSSIP_ACTION_INFO_DEF + 4: //Icecrown
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_ICECROWN, true);
- break;
- case GOSSIP_ACTION_INFO_DEF + 5: //Storm peaks
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_STORM_PEAKS, true);
- break;
+ return new npc_wormholeAI(creature);
}
- return true;
- }
};
/*######
@@ -2400,6 +2436,9 @@ enum eLockSmith
QUEST_HOTTER_THAN_HELL_H = 10764,
QUEST_RETURN_TO_KHAGDAR = 9837,
QUEST_CONTAINMENT = 13159,
+ QUEST_ETERNAL_VIGILANCE = 11011,
+ QUEST_KEY_TO_THE_FOCUSING_IRIS = 13372,
+ QUEST_HC_KEY_TO_THE_FOCUSING_IRIS = 13375,
ITEM_ARCATRAZ_KEY = 31084,
ITEM_SHADOWFORGE_KEY = 11000,
@@ -2407,21 +2446,28 @@ enum eLockSmith
ITEM_SHATTERED_HALLS_KEY = 28395,
ITEM_THE_MASTERS_KEY = 24490,
ITEM_VIOLET_HOLD_KEY = 42482,
+ ITEM_ESSENCE_INFUSED_MOONSTONE = 32449,
+ ITEM_KEY_TO_THE_FOCUSING_IRIS = 44582,
+ ITEM_HC_KEY_TO_THE_FOCUSING_IRIS = 44581,
SPELL_ARCATRAZ_KEY = 54881,
SPELL_SHADOWFORGE_KEY = 54882,
SPELL_SKELETON_KEY = 54883,
SPELL_SHATTERED_HALLS_KEY = 54884,
SPELL_THE_MASTERS_KEY = 54885,
- SPELL_VIOLET_HOLD_KEY = 67253
+ SPELL_VIOLET_HOLD_KEY = 67253,
+ SPELL_ESSENCE_INFUSED_MOONSTONE = 40173,
};
-#define GOSSIP_LOST_ARCATRAZ_KEY "I've lost my key to the Arcatraz."
-#define GOSSIP_LOST_SHADOWFORGE_KEY "I've lost my key to the Blackrock Depths."
-#define GOSSIP_LOST_SKELETON_KEY "I've lost my key to the Scholomance."
-#define GOSSIP_LOST_SHATTERED_HALLS_KEY "I've lost my key to the Shattered Halls."
-#define GOSSIP_LOST_THE_MASTERS_KEY "I've lost my key to the Karazhan."
-#define GOSSIP_LOST_VIOLET_HOLD_KEY "I've lost my key to the Violet Hold."
+#define GOSSIP_LOST_ARCATRAZ_KEY "I've lost my key to the Arcatraz."
+#define GOSSIP_LOST_SHADOWFORGE_KEY "I've lost my key to the Blackrock Depths."
+#define GOSSIP_LOST_SKELETON_KEY "I've lost my key to the Scholomance."
+#define GOSSIP_LOST_SHATTERED_HALLS_KEY "I've lost my key to the Shattered Halls."
+#define GOSSIP_LOST_THE_MASTERS_KEY "I've lost my key to the Karazhan."
+#define GOSSIP_LOST_VIOLET_HOLD_KEY "I've lost my key to the Violet Hold."
+#define GOSSIP_LOST_ESSENCE_INFUSED_MOONSTONE "I've lost my Essence-Infused Moonstone."
+#define GOSSIP_LOST_KEY_TO_THE_FOCUSING_IRIS "I've lost my Key to the Focusing Iris."
+#define GOSSIP_LOST_HC_KEY_TO_THE_FOCUSING_IRIS "I've lost my Heroic Key to the Focusing Iris."
class npc_locksmith : public CreatureScript
{
@@ -2456,6 +2502,18 @@ public:
if (player->GetQuestRewardStatus(QUEST_CONTAINMENT) && !player->HasItemCount(ITEM_VIOLET_HOLD_KEY, 1, true))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_VIOLET_HOLD_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
+ // Essence-Infused Moonstone
+ if (player->GetQuestRewardStatus(QUEST_ETERNAL_VIGILANCE) && !player->HasItemCount(ITEM_ESSENCE_INFUSED_MOONSTONE, 1, true))
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_ESSENCE_INFUSED_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
+
+ // Key to the Focusing Iris
+ if (player->GetQuestRewardStatus(QUEST_KEY_TO_THE_FOCUSING_IRIS) && !player->HasItemCount(ITEM_KEY_TO_THE_FOCUSING_IRIS, 1, true))
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_KEY_TO_THE_FOCUSING_IRIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
+
+ // Heroic Key to the Focusing Iris
+ if (player->GetQuestRewardStatus(QUEST_HC_KEY_TO_THE_FOCUSING_IRIS) && !player->HasItemCount(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS, 1, true))
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_HC_KEY_TO_THE_FOCUSING_IRIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
+
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
@@ -2490,171 +2548,17 @@ public:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, SPELL_VIOLET_HOLD_KEY, false);
break;
- }
- return true;
- }
-};
-
-/*######
-## npc_tabard_vendor
-######*/
-
-enum
-{
- QUEST_TRUE_MASTERS_OF_LIGHT = 9737,
- QUEST_THE_UNWRITTEN_PROPHECY = 9762,
- QUEST_INTO_THE_BREACH = 10259,
- QUEST_BATTLE_OF_THE_CRIMSON_WATCH = 10781,
- QUEST_SHARDS_OF_AHUNE = 11972,
-
- ACHIEVEMENT_EXPLORE_NORTHREND = 45,
- ACHIEVEMENT_TWENTYFIVE_TABARDS = 1021,
- ACHIEVEMENT_THE_LOREMASTER_A = 1681,
- ACHIEVEMENT_THE_LOREMASTER_H = 1682,
-
- ITEM_TABARD_OF_THE_HAND = 24344,
- ITEM_TABARD_OF_THE_BLOOD_KNIGHT = 25549,
- ITEM_TABARD_OF_THE_PROTECTOR = 28788,
- ITEM_OFFERING_OF_THE_SHATAR = 31408,
- ITEM_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI = 31404,
- ITEM_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI = 31405,
- ITEM_TABARD_OF_THE_SUMMER_SKIES = 35279,
- ITEM_TABARD_OF_THE_SUMMER_FLAMES = 35280,
- ITEM_TABARD_OF_THE_ACHIEVER = 40643,
- ITEM_LOREMASTERS_COLORS = 43300,
- ITEM_TABARD_OF_THE_EXPLORER = 43348,
-
- SPELL_TABARD_OF_THE_BLOOD_KNIGHT = 54974,
- SPELL_TABARD_OF_THE_HAND = 54976,
- SPELL_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI = 54977,
- SPELL_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI = 54982,
- SPELL_TABARD_OF_THE_ACHIEVER = 55006,
- SPELL_TABARD_OF_THE_PROTECTOR = 55008,
- SPELL_LOREMASTERS_COLORS = 58194,
- SPELL_TABARD_OF_THE_EXPLORER = 58224,
- SPELL_TABARD_OF_SUMMER_SKIES = 62768,
- SPELL_TABARD_OF_SUMMER_FLAMES = 62769
-};
-
-#define GOSSIP_LOST_TABARD_OF_BLOOD_KNIGHT "I've lost my Tabard of Blood Knight."
-#define GOSSIP_LOST_TABARD_OF_THE_HAND "I've lost my Tabard of the Hand."
-#define GOSSIP_LOST_TABARD_OF_THE_PROTECTOR "I've lost my Tabard of the Protector."
-#define GOSSIP_LOST_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI "I've lost my Green Trophy Tabard of the Illidari."
-#define GOSSIP_LOST_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI "I've lost my Purple Trophy Tabard of the Illidari."
-#define GOSSIP_LOST_TABARD_OF_SUMMER_SKIES "I've lost my Tabard of Summer Skies."
-#define GOSSIP_LOST_TABARD_OF_SUMMER_FLAMES "I've lost my Tabard of Summer Flames."
-#define GOSSIP_LOST_LOREMASTERS_COLORS "I've lost my Loremaster's Colors."
-#define GOSSIP_LOST_TABARD_OF_THE_EXPLORER "I've lost my Tabard of the Explorer."
-#define GOSSIP_LOST_TABARD_OF_THE_ACHIEVER "I've lost my Tabard of the Achiever."
-
-class npc_tabard_vendor : public CreatureScript
-{
-public:
- npc_tabard_vendor() : CreatureScript("npc_tabard_vendor") { }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- bool lostBloodKnight = false;
- bool lostHand = false;
- bool lostProtector = false;
- bool lostIllidari = false;
- bool lostSummer = false;
-
- //Tabard of the Blood Knight
- if (player->GetQuestRewardStatus(QUEST_TRUE_MASTERS_OF_LIGHT) && !player->HasItemCount(ITEM_TABARD_OF_THE_BLOOD_KNIGHT, 1, true))
- lostBloodKnight = true;
-
- //Tabard of the Hand
- if (player->GetQuestRewardStatus(QUEST_THE_UNWRITTEN_PROPHECY) && !player->HasItemCount(ITEM_TABARD_OF_THE_HAND, 1, true))
- lostHand = true;
-
- //Tabard of the Protector
- if (player->GetQuestRewardStatus(QUEST_INTO_THE_BREACH) && !player->HasItemCount(ITEM_TABARD_OF_THE_PROTECTOR, 1, true))
- lostProtector = true;
-
- //Green Trophy Tabard of the Illidari
- //Purple Trophy Tabard of the Illidari
- if (player->GetQuestRewardStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) &&
- (!player->HasItemCount(ITEM_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, 1, true) &&
- !player->HasItemCount(ITEM_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, 1, true) &&
- !player->HasItemCount(ITEM_OFFERING_OF_THE_SHATAR, 1, true)))
- lostIllidari = true;
-
- //Tabard of Summer Skies
- //Tabard of Summer Flames
- if (player->GetQuestRewardStatus(QUEST_SHARDS_OF_AHUNE) &&
- !player->HasItemCount(ITEM_TABARD_OF_THE_SUMMER_SKIES, 1, true) &&
- !player->HasItemCount(ITEM_TABARD_OF_THE_SUMMER_FLAMES, 1, true))
- lostSummer = true;
-
- if (lostBloodKnight || lostHand || lostProtector || lostIllidari || lostSummer)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- if (lostBloodKnight)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_BLOOD_KNIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if (lostHand)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_THE_HAND, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- if (lostProtector)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_THE_PROTECTOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- if (lostIllidari)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- }
-
- if (lostSummer)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_SUMMER_SKIES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_SUMMER_FLAMES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- }
-
- player->SEND_GOSSIP_MENU(13583, creature->GetGUID());
- }
- else
- player->GetSession()->SendListInventory(creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_TRADE:
- player->GetSession()->SendListInventory(creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_TABARD_OF_THE_BLOOD_KNIGHT, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_TABARD_OF_THE_HAND, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_TABARD_OF_THE_PROTECTOR, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 4:
- player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, false);
- break;
- case GOSSIP_ACTION_INFO_DEF + 5:
+ case GOSSIP_ACTION_INFO_DEF + 7:
player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, false);
+ player->CastSpell(player, SPELL_ESSENCE_INFUSED_MOONSTONE, false);
break;
- case GOSSIP_ACTION_INFO_DEF + 6:
+ case GOSSIP_ACTION_INFO_DEF + 8:
player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_TABARD_OF_SUMMER_SKIES, false);
+ player->AddItem(ITEM_KEY_TO_THE_FOCUSING_IRIS,1);
break;
- case GOSSIP_ACTION_INFO_DEF + 7:
+ case GOSSIP_ACTION_INFO_DEF + 9:
player->CLOSE_GOSSIP_MENU();
- player->CastSpell(player, SPELL_TABARD_OF_SUMMER_FLAMES, false);
+ player->AddItem(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS,1);
break;
}
return true;
@@ -2997,7 +2901,7 @@ public:
}
};
- CreatureAI *GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* creature) const
{
return new npc_fireworkAI(creature);
}
@@ -3097,6 +3001,31 @@ public:
};
};
+/*######
+## npc_generic_harpoon_cannon
+######*/
+
+class npc_generic_harpoon_cannon : public CreatureScript
+{
+public:
+ npc_generic_harpoon_cannon() : CreatureScript("npc_generic_harpoon_cannon") { }
+
+ struct npc_generic_harpoon_cannonAI : public ScriptedAI
+ {
+ npc_generic_harpoon_cannonAI(Creature* creature) : ScriptedAI(creature) {}
+
+ void Reset()
+ {
+ me->SetUnitMovementFlags(MOVEMENTFLAG_ROOT);
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_generic_harpoon_cannonAI(creature);
+ }
+};
+
void AddSC_npcs_special()
{
new npc_air_force_bots();
@@ -3124,10 +3053,10 @@ void AddSC_npcs_special()
new npc_wormhole();
new npc_pet_trainer();
new npc_locksmith();
- new npc_tabard_vendor();
new npc_experience();
new npc_fire_elemental();
new npc_earth_elemental();
new npc_firework();
new npc_spring_rabbit();
+ new npc_generic_harpoon_cannon();
}