aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp4
-rw-r--r--src/server/scripts/Commands/cs_gps.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp9
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp15
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/eversong_woods.cpp86
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp33
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp17
-rw-r--r--src/server/scripts/Northrend/dalaran.cpp5
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp2
-rw-r--r--src/server/scripts/Outland/nagrand.cpp734
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp51
15 files changed, 330 insertions, 644 deletions
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 2a352e92d01..68ccf96bb87 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -117,8 +117,8 @@ public:
bool first = true;
bool footer = false;
- ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, *HashMapHolder<Player>::GetLock(), true);
- HashMapHolder<Player>::MapType& m = sObjectAccessor->GetPlayers();
+ ACE_READ_GUARD_RETURN(HashMapHolder<Player>::LockType, guard, *HashMapHolder<Player>::GetLock(), true);
+ HashMapHolder<Player>::MapType const& m = sObjectAccessor->GetPlayers();
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
AccountTypes itrSec = itr->second->GetSession()->GetSecurity();
diff --git a/src/server/scripts/Commands/cs_gps.cpp b/src/server/scripts/Commands/cs_gps.cpp
index 2a270527fb8..eb791b35e58 100644
--- a/src/server/scripts/Commands/cs_gps.cpp
+++ b/src/server/scripts/Commands/cs_gps.cpp
@@ -70,7 +70,7 @@ public:
return false;
}
}
- CellPair cell_val = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
+ CellCoord cell_val = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
Cell cell(cell_val);
uint32 zone_id, area_id;
@@ -89,7 +89,7 @@ public:
float ground_z = map->GetHeight(obj->GetPositionX(), obj->GetPositionY(), MAX_HEIGHT);
float floor_z = map->GetHeight(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ());
- GridPair p = Trinity::ComputeGridPair(obj->GetPositionX(), obj->GetPositionY());
+ GridCoord p = Trinity::ComputeGridCoord(obj->GetPositionX(), obj->GetPositionY());
// 63? WHY?
int gx = 63 - p.x_coord;
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index 4de719d684e..4e3f3899b35 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
@@ -484,15 +484,14 @@ public:
float x, y, z;
me->GetPosition(x, y, z);
- CellPair pair(Trinity::ComputeCellPair(x, y));
+ CellCoord pair(Trinity::ComputeCellCoord(x, y));
Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllCreaturesOfEntryInRange check(me, entry, 100);
Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(me->GetMap()));
+ cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
{
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
index ba2d638d45f..413897c94e8 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
@@ -189,22 +189,21 @@ class boss_akilzon : public CreatureScript
for (uint8 i = 2; i < StormCount; ++i)
bp0 *= 2;
- CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
+ CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
std::list<Unit*> tempUnitMap;
{
- Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, 999);
+ Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS);
Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
- cell.Visit(p, world_unit_searcher, *(me->GetMap()));
- cell.Visit(p, grid_unit_searcher, *(me->GetMap()));
+ cell.Visit(p, world_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);
+ cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);
}
//dealdamege
for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
index d2ad81b4910..aea9e322583 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
@@ -233,9 +233,8 @@ class boss_janalai : public CreatureScript
me->GetPosition(x, y, z);
{
- CellPair pair(Trinity::ComputeCellPair(x, y));
+ CellCoord pair(Trinity::ComputeCellCoord(x, y));
Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllCreaturesOfEntryInRange check(me, MOB_EGG, 100);
@@ -243,7 +242,7 @@ class boss_janalai : public CreatureScript
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(me->GetMap()));
+ cell.Visit(pair, cSearcher, *me->GetMap(), *me, me->GetGridActivationRange());
}
//sLog->outError("Eggs %d at middle", templist.size());
@@ -267,9 +266,8 @@ class boss_janalai : public CreatureScript
me->GetPosition(x, y, z);
{
- CellPair pair(Trinity::ComputeCellPair(x, y));
+ CellCoord pair(Trinity::ComputeCellCoord(x, y));
Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllCreaturesOfEntryInRange check(me, MOB_FIRE_BOMB, 100);
@@ -277,7 +275,7 @@ class boss_janalai : public CreatureScript
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(me->GetMap()));
+ cell.Visit(pair, cSearcher, *me->GetMap(), *me, me->GetGridActivationRange());
}
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
{
@@ -519,9 +517,8 @@ class mob_janalai_hatcher : public CreatureScript
me->GetPosition(x, y, z);
{
- CellPair pair(Trinity::ComputeCellPair(x, y));
+ CellCoord pair(Trinity::ComputeCellCoord(x, y));
Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllCreaturesOfEntryInRange check(me, 23817, 50);
@@ -529,7 +526,7 @@ class mob_janalai_hatcher : public CreatureScript
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(me->GetMap()));
+ cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
}
//sLog->outError("Eggs %d at %d", templist.size(), side);
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
index 17968766a5f..3ff465a3c1d 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
@@ -162,9 +162,8 @@ class boss_nalorakk : public CreatureScript
me->GetPosition(x, y, z);
{
- CellPair pair(Trinity::ComputeCellPair(x, y));
+ CellCoord pair(Trinity::ComputeCellCoord(x, y));
Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllFriendlyCreaturesInGrid check(me);
@@ -172,7 +171,7 @@ class boss_nalorakk : public CreatureScript
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher);
- cell.Visit(pair, cSearcher, *(me->GetMap()));
+ cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange());
}
if (templist.empty())
diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp
index 10b7066068b..d02cce3f17c 100644
--- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp
+++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp
@@ -35,91 +35,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
/*######
-## npc_prospector_anvilward
-######*/
-
-#define GOSSIP_HELLO "I need a moment of your time, sir."
-#define GOSSIP_SELECT "Why... yes, of course. I've something to show you right inside this building, Mr. Anvilward."
-
-enum eProspectorAnvilward
-{
- SAY_ANVIL1 = -1000209,
- SAY_ANVIL2 = -1000210,
- QUEST_THE_DWARVEN_SPY = 8483,
-};
-
-class npc_prospector_anvilward : public CreatureScript
-{
-public:
- npc_prospector_anvilward() : CreatureScript("npc_prospector_anvilward") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(8240, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->CLOSE_GOSSIP_MENU();
- if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_anvilward::npc_prospector_anvilwardAI, creature->AI()))
- pEscortAI->Start(true, false, player->GetGUID());
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(QUEST_THE_DWARVEN_SPY) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(8239, creature->GetGUID());
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_prospector_anvilwardAI(creature);
- }
-
- struct npc_prospector_anvilwardAI : public npc_escortAI
- {
- // CreatureAI functions
- npc_prospector_anvilwardAI(Creature* c) : npc_escortAI(c) {}
-
- // Pure Virtual Functions
- void WaypointReached(uint32 i)
- {
- Player* player = GetPlayerForEscort();
-
- if (!player)
- return;
-
- switch (i)
- {
- case 0: DoScriptText(SAY_ANVIL1, me, player); break;
- case 5: DoScriptText(SAY_ANVIL2, me, player); break;
- case 6: me->setFaction(24); break;
- }
- }
-
- void Reset()
- {
- me->RestoreFaction();
- }
-
- void JustDied(Unit* /*killer*/)
- {
- me->RestoreFaction();
- }
- };
-
-};
-
-/*######
## Quest 9686 Second Trial
######*/
@@ -711,7 +626,6 @@ public:
void AddSC_eversong_woods()
{
- new npc_prospector_anvilward();
new npc_second_trial_controller();
new npc_second_trial_paladin();
new go_second_trial();
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
index 6186369a3a0..187ff9b9dd7 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp
@@ -459,7 +459,9 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20, 20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20, 20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10, 10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
if (creature)
CAST_AI(hyjal_trashAI, creature->AI())->useFlyPath = true;
- }else{//summon at gate
+ }
+ else
+ {//summon at gate
creature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10, 10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10, 10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10, 10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
}
break;
@@ -910,6 +912,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
DoMeleeAttackIfReady();
}
+
void hyjalAI::JustDied(Unit* /*killer*/)
{
if (IsDummy)return;
@@ -932,23 +935,20 @@ void hyjalAI::JustDied(Unit* /*killer*/)
instance->SetData(DATA_RESET_RAIDDAMAGE, 0);//reset damage on die
}
}
+
void hyjalAI::HideNearPos(float x, float y)
{
- CellPair pair(Trinity::ComputeCellPair(x, y));
+ CellCoord pair(Trinity::ComputeCellCoord(x, y));
Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
// First get all creatures.
std::list<Creature*> creatures;
Trinity::AllFriendlyCreaturesInGrid creature_check(me);
Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
- TypeContainerVisitor
- <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
- GridTypeMapContainer> creature_visitor(creature_searcher);
- // Get Creatures
- cell.Visit(pair, creature_visitor, *(me->GetMap()));
+ TypeContainerVisitor <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> creature_visitor(creature_searcher);
+ cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange());
if (!creatures.empty())
{
@@ -959,18 +959,19 @@ void hyjalAI::HideNearPos(float x, float y)
}
}
}
+
void hyjalAI::RespawnNearPos(float x, float y)
{
- CellPair p(Trinity::ComputeCellPair(x, y));
+ CellCoord p(Trinity::ComputeCellCoord(x, y));
Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::RespawnDo u_do;
Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(me, u_do);
TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
- cell.Visit(p, obj_worker, *me->GetMap());
+ cell.Visit(p, obj_worker, *me->GetMap(), *me, me->GetGridActivationRange());
}
+
void hyjalAI::WaypointReached(uint32 i)
{
if (i == 1 || (i == 0 && me->GetEntry() == THRALL))
@@ -992,9 +993,8 @@ void hyjalAI::WaypointReached(uint32 i)
}
//do some talking
//all alive guards walk near here
- CellPair pair(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
+ CellCoord pair(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
// First get all creatures.
@@ -1005,7 +1005,7 @@ void hyjalAI::WaypointReached(uint32 i)
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
- cell.Visit(pair, creature_visitor, *(me->GetMap()));
+ cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange());
if (!creatures.empty())
{
@@ -1034,9 +1034,8 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
{
if (TeleportTimer <= diff)
{
- CellPair pair(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY()));
+ CellCoord pair(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
std::list<Creature*> creatures;
@@ -1046,7 +1045,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
- cell.Visit(pair, creature_visitor, *(me->GetMap()));
+ cell.Visit(pair, creature_visitor, *(me->GetMap()), *me, me->GetGridActivationRange());
if (!creatures.empty())
{
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
index dea3d6eaede..605f3a11c8a 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp
@@ -118,7 +118,7 @@ public:
return;
float x=0.0f, y=0.0f, z=0.0f;
- me->GetRespawnCoord(x, y, z);
+ me->GetRespawnPosition(x, y, z);
if (uiCheckDistanceTimer <= uiDiff)
uiCheckDistanceTimer = 5*IN_MILLISECONDS;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
index e4749fd2ffe..be83c4d326a 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -284,7 +284,7 @@ public:
if (m_uiPenetratingColdTimer <= uiDiff)
{
- me->CastCustomSpell(SPELL_PENETRATING_COLD, SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5));
+ me->CastCustomSpell(SPELL_PENETRATING_COLD, SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5, 2, 5));
m_uiPenetratingColdTimer = 20*IN_MILLISECONDS;
} else m_uiPenetratingColdTimer -= uiDiff;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index 1688624be91..38f334058b8 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -1227,7 +1227,7 @@ class npc_tirion_fordring_tft : public CreatureScript
SetEquipmentSlots(true); // remove glow on ashbringer
}
- void sGossipSelect(Player* player, uint32 sender, uint32 action)
+ void sGossipSelect(Player* /*player*/, uint32 sender, uint32 action)
{
if (me->GetCreatureInfo()->GossipMenuId == sender && !action)
{
@@ -1407,14 +1407,14 @@ class npc_raging_spirit : public CreatureScript
DoCast(me, SPELL_BOSS_HITTIN_YA, true);
}
- void IsSummonedBy(Unit* summoner)
+ void IsSummonedBy(Unit* /*summoner*/)
{
// player is the spellcaster so register summon manually
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING)))
lichKing->AI()->JustSummoned(me);
}
- void JustDied(Unit* killer)
+ void JustDied(Unit* /*killer*/)
{
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING)))
lichKing->AI()->SummonedCreatureDespawn(me);
@@ -1931,7 +1931,7 @@ class npc_spirit_bomb : public CreatureScript
{
}
- void IsSummonedBy(Unit* summoner)
+ void IsSummonedBy(Unit* /*summoner*/)
{
float destX, destY, destZ;
me->GetPosition(destX, destY);
@@ -1954,7 +1954,7 @@ class npc_spirit_bomb : public CreatureScript
{
}
- void UpdateAI(uint32 const diff)
+ void UpdateAI(uint32 const /*diff*/)
{
UpdateVictim();
// no melee attacks
@@ -1983,7 +1983,7 @@ class npc_broken_frostmourne : public CreatureScript
_events.Reset();
}
- void IsSummonedBy(Unit* summoner)
+ void IsSummonedBy(Unit* /*summoner*/)
{
_events.SetPhase(PHASE_OUTRO);
_events.ScheduleEvent(EVENT_OUTRO_KNOCK_BACK, 3000, 0, PHASE_OUTRO);
@@ -2087,7 +2087,6 @@ class spell_the_lich_king_necrotic_plague : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- Unit* newCaster = GetTarget();
switch (GetTargetApplication()->GetRemoveMode())
{
case AURA_REMOVE_BY_ENEMY_SPELL:
@@ -2250,7 +2249,7 @@ class spell_the_lich_king_shadow_trap_visual : public SpellScriptLoader
{
PrepareAuraScript(spell_the_lich_king_shadow_trap_visual_AuraScript);
- void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes mode)
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
GetTarget()->CastSpell(GetTarget(), SPELL_SHADOW_TRAP_AURA, TRIGGERED_NONE);
@@ -2633,7 +2632,7 @@ class spell_the_lich_king_cast_back_to_caster : public SpellScriptLoader
{
PrepareSpellScript(spell_the_lich_king_cast_back_to_caster_SpellScript);
- void HandleScript(SpellEffIndex effIndex)
+ void HandleScript(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
}
diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp
index be9e9308f4f..8ff5a314dcc 100644
--- a/src/server/scripts/Northrend/dalaran.cpp
+++ b/src/server/scripts/Northrend/dalaran.cpp
@@ -70,8 +70,9 @@ public:
return;
Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself();
-
- if (!player || player->isGameMaster() || player->IsBeingTeleported())
+
+ // If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass
+ if (!player || player->isGameMaster() || player->IsBeingTeleported() || player->HasAura(70973) || player->HasAura(70971))
return;
switch (me->GetEntry())
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
index c081f0970f2..9b0a4a469ae 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
@@ -384,7 +384,7 @@ bool OPvPCapturePointNA::HandleCustomSpell(Player* player, uint32 spellId, GameO
int32 count = 10;
uint32 itemid = 24538;
// bomb id count
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemid, count, &noSpaceForCount);
+ InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemid, count, &noSpaceForCount);
if (msg != EQUIP_ERR_OK) // convert to possible store amount
count -= noSpaceForCount;
diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp
index b639050320c..726edb5efb2 100644
--- a/src/server/scripts/Outland/nagrand.cpp
+++ b/src/server/scripts/Outland/nagrand.cpp
@@ -19,330 +19,20 @@
/* ScriptData
SDName: Nagrand
SD%Complete: 90
-SDComment: Quest support: 9849, 9868, 9918, 9874, 9991, 10107, 10108, 10044, 10172, 10646, 10085, 10987. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
+SDComment: Quest support: 9868, 9874, 10044, 10172, 10085. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
SDCategory: Nagrand
EndScriptData */
/* ContentData
-mob_shattered_rumbler
-mob_lump
-npc_altruis_the_sufferer
npc_greatmother_geyah
-npc_lantresor_of_the_blade
npc_maghar_captive
npc_creditmarker_visit_with_ancestors
-mob_sparrowhawk
EndContentData */
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
/*######
-## mob_shattered_rumbler - this should be done with ACID
-######*/
-
-class mob_shattered_rumbler : public CreatureScript
-{
-public:
- mob_shattered_rumbler() : CreatureScript("mob_shattered_rumbler") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_shattered_rumblerAI (creature);
- }
-
- struct mob_shattered_rumblerAI : public ScriptedAI
- {
- bool Spawn;
-
- mob_shattered_rumblerAI(Creature* c) : ScriptedAI(c) {}
-
- void Reset()
- {
- Spawn = false;
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
- void SpellHit(Unit* Hitter, const SpellInfo* Spellkind)
- {
- if (Spellkind->Id == 32001 && !Spawn)
- {
- float x = me->GetPositionX();
- float y = me->GetPositionY();
- float z = me->GetPositionZ();
-
- Hitter->SummonCreature(18181, x+(0.7f * (rand()%30)), y+(rand()%5), z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
- Hitter->SummonCreature(18181, x+(rand()%5), y-(rand()%5), z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
- Hitter->SummonCreature(18181, x-(rand()%5), y+(0.5f *(rand()%60)), z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
- me->setDeathState(CORPSE);
- Spawn = true;
- }
- return;
- }
- };
-
-};
-
-/*######
-## mob_lump
-######*/
-
-#define SPELL_VISUAL_SLEEP 16093
-#define SPELL_SPEAR_THROW 32248
-
-#define LUMP_SAY0 -1000190
-#define LUMP_SAY1 -1000191
-
-#define LUMP_DEFEAT -1000192
-
-#define GOSSIP_HL "I need answers, ogre!"
-#define GOSSIP_SL1 "Why are Boulderfist out this far? You know that this is Kurenai territory."
-#define GOSSIP_SL2 "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar."
-#define GOSSIP_SL3 "This means war, Lump! War I say!"
-
-class mob_lump : public CreatureScript
-{
-public:
- mob_lump() : CreatureScript("mob_lump") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(9353, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(9354, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(9355, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->SEND_GOSSIP_MENU(9356, creature->GetGUID());
- player->TalkedToCreature(18354, creature->GetGUID());
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(9352, creature->GetGUID());
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_lumpAI(creature);
- }
-
- struct mob_lumpAI : public ScriptedAI
- {
- mob_lumpAI(Creature* c) : ScriptedAI(c)
- {
- bReset = false;
- }
-
- uint32 Reset_Timer;
- uint32 Spear_Throw_Timer;
- bool bReset;
-
- void Reset()
- {
- Reset_Timer = 60000;
- Spear_Throw_Timer = 2000;
-
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- void AttackedBy(Unit* pAttacker)
- {
- if (me->getVictim())
- return;
-
- if (me->IsFriendlyTo(pAttacker))
- return;
-
- AttackStart(pAttacker);
- }
-
- void DamageTaken(Unit* done_by, uint32 & damage)
- {
- if (done_by->GetTypeId() == TYPEID_PLAYER && me->HealthBelowPctDamaged(30, damage))
- {
- if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
- {
- //Take 0 damage
- damage = 0;
-
- CAST_PLR(done_by)->AttackStop();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->RemoveAllAuras();
- me->DeleteThreatList();
- me->CombatStop(true);
- me->setFaction(1080); //friendly
- me->SetStandState(UNIT_STAND_STATE_SIT);
- DoScriptText(LUMP_DEFEAT, me);
-
- bReset = true;
- }
- }
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- if (me->HasAura(SPELL_VISUAL_SLEEP))
- me->RemoveAura(SPELL_VISUAL_SLEEP);
-
- if (!me->IsStandState())
- me->SetStandState(UNIT_STAND_STATE_STAND);
-
- DoScriptText(RAND(LUMP_SAY0, LUMP_SAY1), me);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //check if we waiting for a reset
- if (bReset)
- {
- if (Reset_Timer <= diff)
- {
- EnterEvadeMode();
- bReset = false;
- me->setFaction(1711); //hostile
- return;
- }
- else Reset_Timer -= diff;
- }
-
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //Spear_Throw_Timer
- if (Spear_Throw_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SPEAR_THROW);
- Spear_Throw_Timer = 20000;
- } else Spear_Throw_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*######
-## npc_altruis_the_sufferer
-######*/
-
-#define GOSSIP_HATS1 "I see twisted steel and smell sundered earth."
-#define GOSSIP_HATS2 "Well...?"
-#define GOSSIP_HATS3 "[PH] Story about Illidan's Pupil"
-
-#define GOSSIP_SATS1 "Legion?"
-#define GOSSIP_SATS2 "And now?"
-#define GOSSIP_SATS3 "How do you see them now?"
-#define GOSSIP_SATS4 "Forge camps?"
-#define GOSSIP_SATS5 "Ok."
-#define GOSSIP_SATS6 "[PH] Story done"
-
-class npc_altruis_the_sufferer : public CreatureScript
-{
-public:
- npc_altruis_the_sufferer() : CreatureScript("npc_altruis_the_sufferer") { }
-
- bool OnQuestAccept(Player* player, Creature* /*creature*/, Quest const* /*quest*/)
- {
- if (!player->GetQuestRewardStatus(9991)) //Survey the Land, q-id 9991
- {
- player->CLOSE_GOSSIP_MENU();
- player->ActivateTaxiPathTo(532); //TaxiPath 532
- }
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF+10:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(9420, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
- player->SEND_GOSSIP_MENU(9421, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+12:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
- player->SEND_GOSSIP_MENU(9422, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+13:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
- player->SEND_GOSSIP_MENU(9423, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+14:
- player->SEND_GOSSIP_MENU(9424, creature->GetGUID());
- break;
-
- case GOSSIP_ACTION_INFO_DEF+20:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
- player->SEND_GOSSIP_MENU(9427, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+21:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(9991);
- break;
-
- case GOSSIP_ACTION_INFO_DEF+30:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SATS6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31);
- player->SEND_GOSSIP_MENU(384, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+31:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(10646);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- //gossip before obtaining Survey the Land
- if (player->GetQuestStatus(9991) == QUEST_STATUS_NONE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
-
- //gossip when Survey the Land is incomplete (technically, after the flight)
- if (player->GetQuestStatus(9991) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
-
- //wowwiki.com/Varedis
- if (player->GetQuestStatus(10646) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HATS3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30);
-
- player->SEND_GOSSIP_MENU(9419, creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
## npc_greatmother_geyah
######*/
@@ -453,83 +143,6 @@ public:
};
-/*######
-## npc_lantresor_of_the_blade
-######*/
-
-#define GOSSIP_HLB "I have killed many of your ogres, Lantresor. I have no fear."
-#define GOSSIP_SLB1 "Should I know? You look like an orc to me."
-#define GOSSIP_SLB2 "And the other half?"
-#define GOSSIP_SLB3 "I have heard of your kind, but I never thought to see the day when I would meet a half-breed."
-#define GOSSIP_SLB4 "My apologies. I did not mean to offend. I am here on behalf of my people."
-#define GOSSIP_SLB5 "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces."
-#define GOSSIP_SLB6 "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people."
-#define GOSSIP_SLB7 "What do I need to do?"
-
-class npc_lantresor_of_the_blade : public CreatureScript
-{
-public:
- npc_lantresor_of_the_blade() : CreatureScript("npc_lantresor_of_the_blade") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (uiAction)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(9362, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(9363, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(9364, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(9365, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(9366, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(9367, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(9368, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->SEND_GOSSIP_MENU(9369, creature->GetGUID());
- if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(10107);
- if (player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(10108);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HLB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(9361, creature->GetGUID());
-
- return true;
- }
-
-};
-
/*#####
## npc_maghar_captive
#####*/
@@ -747,113 +360,9 @@ public:
};
/*######
-## mob_sparrowhawk
+## go_corkis_prison and npc_corki
######*/
-#define SPELL_SPARROWHAWK_NET 39810
-#define SPELL_ITEM_CAPTIVE_SPARROWHAWK 39812
-
-class mob_sparrowhawk : public CreatureScript
-{
-public:
- mob_sparrowhawk() : CreatureScript("mob_sparrowhawk") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_sparrowhawkAI (creature);
- }
-
- struct mob_sparrowhawkAI : public ScriptedAI
- {
-
- mob_sparrowhawkAI(Creature* c) : ScriptedAI(c) {}
-
- uint32 Check_Timer;
- uint64 PlayerGUID;
- bool fleeing;
-
- void Reset()
- {
- me->RemoveAurasDueToSpell(SPELL_SPARROWHAWK_NET);
- Check_Timer = 1000;
- PlayerGUID = 0;
- fleeing = false;
- }
- void AttackStart(Unit* who)
- {
- if (PlayerGUID)
- return;
-
- ScriptedAI::AttackStart(who);
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
- void MoveInLineOfSight(Unit* who)
- {
- if (!who || PlayerGUID)
- return;
-
- if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
- {
- PlayerGUID = who->GetGUID();
- return;
- }
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (Check_Timer <= diff)
- {
- if (PlayerGUID)
- {
- if (fleeing && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)
- fleeing = false;
-
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
- if (player && me->IsWithinDistInMap(player, 30))
- {
- if (!fleeing)
- {
- me->DeleteThreatList();
- me->GetMotionMaster()->MoveFleeing(player);
- fleeing = true;
- }
- }
- else if (fleeing)
- {
- me->GetMotionMaster()->MovementExpired(false);
- PlayerGUID = 0;
- fleeing = false;
- }
- }
- Check_Timer = 1000;
- } else Check_Timer -= diff;
-
- if (PlayerGUID)
- return;
-
- ScriptedAI::UpdateAI(diff);
- }
-
- void SpellHit(Unit* caster, const SpellInfo* spell)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER)
- {
- if (spell->Id == SPELL_SPARROWHAWK_NET && CAST_PLR(caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
- {
- DoCast(caster, SPELL_ITEM_CAPTIVE_SPARROWHAWK, true);
- me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- }
- }
- return;
- }
- };
-};
-
enum CorkiData
{
// first quest
@@ -916,10 +425,6 @@ public:
}
};
-/*######
-## npc_corki
-######*/
-
class npc_corki : public CreatureScript
{
public:
@@ -970,16 +475,241 @@ public:
};
};
+/*#####
+## npc_kurenai_captive
+#####*/
+
+enum KurenaiCaptive
+{
+ SAY_KUR_START = 0,
+ SAY_KUR_NO_ESCAPE = 1,
+ SAY_KUR_MORE = 2,
+ SAY_KUR_MORE_TWO = 3,
+ SAY_KUR_LIGHTNING = 4,
+ SAY_KUR_SHOCK = 5,
+ SAY_KUR_COMPLETE = 6,
+
+ SPELL_KUR_CHAIN_LIGHTNING = 16006,
+ SPELL_KUR_EARTHBIND_TOTEM = 15786,
+ SPELL_KUR_FROST_SHOCK = 12548,
+ SPELL_KUR_HEALING_WAVE = 12491,
+
+ QUEST_TOTEM_KARDASH_A = 9879,
+
+ NPC_KUR_MURK_RAIDER = 18203,
+ NPC_KUR_MURK_BRUTE = 18211,
+ NPC_KUR_MURK_SCAVENGER = 18207,
+ NPC_KUR_MURK_PUTRIFIER = 18202,
+};
+
+static float kurenaiAmbushA[]= {-1568.805786f, 8533.873047f, 1.958f};
+static float kurenaiAmbushB[]= {-1491.554321f, 8506.483398f, 1.248f};
+
+class npc_kurenai_captive : public CreatureScript
+{
+public:
+ npc_kurenai_captive() : CreatureScript("npc_kurenai_captive") { }
+
+ bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
+ {
+ if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_A)
+ {
+ if (npc_kurenai_captiveAI* EscortAI = dynamic_cast<npc_kurenai_captiveAI*>(creature->AI()))
+ {
+ creature->SetStandState(UNIT_STAND_STATE_STAND);
+ EscortAI->Start(true, false, player->GetGUID(), quest);
+ DoScriptText(SAY_KUR_START, creature);
+
+ creature->SummonCreature(NPC_KUR_MURK_RAIDER, kurenaiAmbushA[0]+2.5f, kurenaiAmbushA[1]-2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ creature->SummonCreature(NPC_KUR_MURK_BRUTE, kurenaiAmbushA[0]-2.5f, kurenaiAmbushA[1]+2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ creature->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushA[0], kurenaiAmbushA[1], kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ }
+ }
+ return true;
+ }
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_kurenai_captiveAI(creature);
+ }
+
+ struct npc_kurenai_captiveAI : public npc_escortAI
+ {
+ npc_kurenai_captiveAI(Creature* creature) : npc_escortAI(creature) { }
+
+ uint32 ChainLightningTimer;
+ uint32 HealTimer;
+ uint32 FrostShockTimer;
+
+ void Reset()
+ {
+ ChainLightningTimer = 1000;
+ HealTimer = 0;
+ FrostShockTimer = 6000;
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ DoCast(me, SPELL_KUR_EARTHBIND_TOTEM, false);
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ if (!HasEscortState(STATE_ESCORT_ESCORTING))
+ return;
+
+ if (Player* player = GetPlayerForEscort())
+ {
+ if (player->GetQuestStatus(QUEST_TOTEM_KARDASH_A) != QUEST_STATUS_COMPLETE)
+ player->FailQuest(QUEST_TOTEM_KARDASH_A);
+ }
+ }
+
+ void WaypointReached(uint32 PointId)
+ {
+ switch(PointId)
+ {
+ case 3:
+ {
+ Talk(SAY_KUR_MORE);
+
+ if (Creature* temp = me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0], kurenaiAmbushB[1], kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
+ Talk(SAY_KUR_MORE_TWO);
+
+ me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0]-2.5f, kurenaiAmbushB[1]-2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushB[0]+2.5f, kurenaiAmbushB[1]+2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushB[0]+2.5f, kurenaiAmbushB[1]-2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
+ }
+ case 7:
+ {
+ Talk(SAY_KUR_COMPLETE);
+
+ if (Player* player = GetPlayerForEscort())
+ player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me);
+
+ SetRun();
+ break;
+ }
+ }
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ if (summoned->GetEntry() == NPC_KUR_MURK_BRUTE)
+ Talk(SAY_KUR_NO_ESCAPE);
+
+ // This function is for when we summoned enemies to fight - so that does NOT mean we should make our totem count in this!
+ if (summoned->isTotem())
+ return;
+
+ summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
+ summoned->AI()->AttackStart(me);
+ }
+
+ void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell)
+ {
+ if (spell->Id == SPELL_KUR_CHAIN_LIGHTNING)
+ {
+ if (rand()%30)
+ return;
+
+ Talk(SAY_KUR_LIGHTNING);
+ }
+
+ if (spell->Id == SPELL_KUR_FROST_SHOCK)
+ {
+ if (rand()%30)
+ return;
+
+ Talk(SAY_KUR_SHOCK);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->HasUnitState(UNIT_STAT_CASTING))
+ return;
+
+ if (ChainLightningTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_KUR_CHAIN_LIGHTNING);
+ ChainLightningTimer = urand(7000,14000);
+ } else ChainLightningTimer -= diff;
+
+ if (HealthBelowPct(30))
+ {
+ if (HealTimer <= diff)
+ {
+ DoCast(me, SPELL_KUR_HEALING_WAVE);
+ HealTimer = 5000;
+ } else HealTimer -= diff;
+ }
+
+ if (FrostShockTimer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_KUR_FROST_SHOCK);
+ FrostShockTimer = urand(7500,15000);
+ } else FrostShockTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+};
+
+/*######
+## go_warmaul_prison
+######*/
+
+enum FindingTheSurvivorsData
+{
+ QUEST_FINDING_THE_SURVIVORS = 9948,
+ NPC_MAGHAR_PRISONER = 18428,
+
+ SAY_FREE_0 = 0,
+ SAY_FREE_1 = 1,
+ SAY_FREE_2 = 2,
+ SAY_FREE_3 = 3,
+ SAY_FREE_4 = 4,
+};
+
+class go_warmaul_prison : public GameObjectScript
+{
+public:
+ go_warmaul_prison() : GameObjectScript("go_warmaul_prison") { }
+
+ bool OnGossipHello(Player* player, GameObject* go)
+ {
+ if (player->GetQuestStatus(QUEST_FINDING_THE_SURVIVORS) != QUEST_STATUS_INCOMPLETE)
+ return false;
+
+ if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 1.0f))
+ {
+ if (prisoner)
+ {
+ go->UseDoorOrButton();
+ if (player)
+ player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0);
+
+ prisoner->AI()->Talk(RAND(SAY_FREE_0, SAY_FREE_1, SAY_FREE_2, SAY_FREE_3, SAY_FREE_4), player->GetGUID());
+ prisoner->ForcedDespawn(6000);
+ }
+ }
+ return true;
+ }
+};
+
void AddSC_nagrand()
{
- new mob_shattered_rumbler();
- new mob_lump();
- new npc_altruis_the_sufferer();
new npc_greatmother_geyah();
- new npc_lantresor_of_the_blade();
new npc_maghar_captive();
new npc_creditmarker_visit_with_ancestors();
- new mob_sparrowhawk();
new npc_corki();
new go_corkis_prison();
+ new npc_kurenai_captive();
+ new go_warmaul_prison();
}
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 6ae9577070e..3b2cc5f5e00 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -899,7 +899,6 @@ class spell_q9874_liquid_fire : public SpellScriptLoader
};
};
-
enum SalvagingLifesStength
{
NPC_SHARD_KILL_CREDIT = 29303,
@@ -950,6 +949,7 @@ enum eBattleStandard
{
NPC_KING_OF_THE_MOUNTAINT_KC = 31766,
};
+
class spell_q13280_13283_plant_battle_standard: public SpellScriptLoader
{
public:
@@ -978,6 +978,54 @@ public:
}
};
+enum ChumTheWaterSummons
+{
+ SUMMON_ANGRY_KVALDIR = 66737,
+ SUMMON_NORTH_SEA_MAKO = 66738,
+ SUMMON_NORTH_SEA_THRESHER = 66739,
+ SUMMON_NORTH_SEA_BLUE_SHARK = 66740
+};
+
+class spell_q14112_14145_chum_the_water: public SpellScriptLoader
+{
+public:
+ spell_q14112_14145_chum_the_water() : SpellScriptLoader("spell_q14112_14145_chum_the_water") { }
+
+ class spell_q14112_14145_chum_the_water_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q14112_14145_chum_the_water_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellEntry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SUMMON_ANGRY_KVALDIR))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_MAKO))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_THRESHER))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_BLUE_SHARK))
+ return false;
+ return true;
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ caster->CastSpell(caster, RAND(SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK));
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_q14112_14145_chum_the_water_SpellScript();
+ }
+};
+
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -1001,4 +1049,5 @@ void AddSC_quest_spell_scripts()
new spell_q9874_liquid_fire();
new spell_q12805_lifeblood_dummy();
new spell_q13280_13283_plant_battle_standard();
+ new spell_q14112_14145_chum_the_water();
}