aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authorRat <gmstreetrat@gmail.com>2012-01-01 22:31:48 +0100
committerRat <gmstreetrat@gmail.com>2012-01-01 22:31:48 +0100
commit0e950d5e467a63827d1e280929a2e5bd36e6dc98 (patch)
tree41c3424fe560ee1a338140203ffdf1b1ae7b6469 /src/server/scripts/World
parentbff7c18251e8c16dfbe3f4484a76d8df76f05076 (diff)
parentb1e19257bcd80427986cbb670cbc69c45d6154b6 (diff)
Merge branch '4.x' of git://github.com/TrinityCore/TrinityCore into 4.x
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r--src/server/scripts/World/areatrigger_scripts.cpp166
-rw-r--r--src/server/scripts/World/go_scripts.cpp54
-rw-r--r--src/server/scripts/World/item_scripts.cpp41
-rw-r--r--src/server/scripts/World/npcs_special.cpp10
4 files changed, 223 insertions, 48 deletions
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp
index 517746dac55..7d1ed17ed29 100644
--- a/src/server/scripts/World/areatrigger_scripts.cpp
+++ b/src/server/scripts/World/areatrigger_scripts.cpp
@@ -29,6 +29,9 @@ at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm
at_stormwright_shelf q12741
at_last_rites q12019
at_sholazar_waygate q12548
+at_nats_landing q11209
+at_bring_your_orphan_to q910 q910 q1800 q1479 q1687 q1558 q10951 q10952
+at_brewfest
EndContentData */
#include "ScriptPCH.h"
@@ -257,6 +260,166 @@ class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript
}
};
+/*######
+## at_nats_landing
+######*/
+
+enum NatsLanding
+{
+ QUEST_NATS_BARGAIN = 11209,
+ SPELL_FISH_PASTE = 42644,
+ NPC_LURKING_SHARK = 23928
+};
+
+class AreaTrigger_at_nats_landing : public AreaTriggerScript
+{
+ public:
+ AreaTrigger_at_nats_landing() : AreaTriggerScript("at_nats_landing") { }
+
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/)
+ {
+ if (!player->isAlive() || !player->HasAura(SPELL_FISH_PASTE))
+ return false;
+
+ if (player->GetQuestStatus(QUEST_NATS_BARGAIN) == QUEST_STATUS_INCOMPLETE)
+ {
+ if (!player->FindNearestCreature(NPC_LURKING_SHARK, 20.0f))
+ {
+ if (Creature* shark = player->SummonCreature(NPC_LURKING_SHARK, -4246.243f, -3922.356f, -7.488f, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100000))
+ shark->AI()->AttackStart(player);
+
+ return false;
+ }
+ }
+ return true;
+ }
+};
+
+/*######
+## at_bring_your_orphan_to
+######*/
+
+enum BringYourOrphanTo
+{
+ QUEST_DOWN_AT_THE_DOCKS = 910,
+ QUEST_GATEWAY_TO_THE_FRONTIER = 911,
+ QUEST_LORDAERON_THRONE_ROOM = 1800,
+ QUEST_BOUGHT_OF_ETERNALS = 1479,
+ QUEST_SPOOKY_LIGHTHOUSE = 1687,
+ QUEST_STONEWROUGHT_DAM = 1558,
+ QUEST_DARK_PORTAL_H = 10951,
+ QUEST_DARK_PORTAL_A = 10952,
+
+ AT_DOWN_AT_THE_DOCKS = 3551,
+ AT_GATEWAY_TO_THE_FRONTIER = 3549,
+ AT_LORDAERON_THRONE_ROOM = 3547,
+ AT_BOUGHT_OF_ETERNALS = 3546,
+ AT_SPOOKY_LIGHTHOUSE = 3552,
+ AT_STONEWROUGHT_DAM = 3548,
+ AT_DARK_PORTAL = 4356,
+
+ AURA_ORPHAN_OUT = 58818,
+};
+
+class AreaTrigger_at_bring_your_orphan_to : public AreaTriggerScript
+{
+ public:
+ AreaTrigger_at_bring_your_orphan_to() : AreaTriggerScript("at_bring_your_orphan_to") { }
+
+ bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
+ {
+ uint32 questId = 0;
+
+ if (player->isDead() || !player->HasAura(AURA_ORPHAN_OUT))
+ return false;
+
+ switch (trigger->id)
+ {
+ case AT_DOWN_AT_THE_DOCKS:
+ questId = QUEST_DOWN_AT_THE_DOCKS;
+ break;
+ case AT_GATEWAY_TO_THE_FRONTIER:
+ questId = QUEST_GATEWAY_TO_THE_FRONTIER;
+ break;
+ case AT_LORDAERON_THRONE_ROOM:
+ questId = QUEST_LORDAERON_THRONE_ROOM;
+ break;
+ case AT_BOUGHT_OF_ETERNALS:
+ questId = QUEST_BOUGHT_OF_ETERNALS;
+ break;
+ case AT_SPOOKY_LIGHTHOUSE:
+ questId = QUEST_SPOOKY_LIGHTHOUSE;
+ break;
+ case AT_STONEWROUGHT_DAM:
+ questId = QUEST_STONEWROUGHT_DAM;
+ break;
+ case AT_DARK_PORTAL:
+ questId = player->GetTeam() == ALLIANCE ? QUEST_DARK_PORTAL_A : QUEST_DARK_PORTAL_H;
+ break;
+ }
+
+ if (questId && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
+ player->AreaExploredOrEventHappens(questId);
+
+ return true;
+ }
+};
+
+/*######
+## at_brewfest
+######*/
+
+enum Brewfest
+{
+ NPC_TAPPER_SWINDLEKEG = 24711,
+ NPC_IPFELKOFER_IRONKEG = 24710,
+
+ AT_BREWFEST_DUROTAR = 4829,
+ AT_BREWFEST_DUN_MOROGH = 4820,
+
+ SAY_WELCOME = 4,
+
+ AREATRIGGER_TALK_COOLDOWN = 5, // in seconds
+};
+
+class AreaTrigger_at_brewfest : public AreaTriggerScript
+{
+ public:
+ AreaTrigger_at_brewfest() : AreaTriggerScript("at_brewfest")
+ {
+ // Initialize for cooldown
+ _triggerTimes[AT_BREWFEST_DUROTAR] = _triggerTimes[AT_BREWFEST_DUN_MOROGH] = 0;
+ }
+
+ bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
+ {
+ uint32 triggerId = trigger->id;
+ // Second trigger happened too early after first, skip for now
+ if (sWorld->GetGameTime() - _triggerTimes[triggerId] < AREATRIGGER_TALK_COOLDOWN)
+ return false;
+
+ switch (triggerId)
+ {
+ case AT_BREWFEST_DUROTAR:
+ if (Creature* tapper = player->FindNearestCreature(NPC_TAPPER_SWINDLEKEG, 20.0f))
+ tapper->AI()->Talk(SAY_WELCOME, player->GetGUID());
+ break;
+ case AT_BREWFEST_DUN_MOROGH:
+ if (Creature* ipfelkofer = player->FindNearestCreature(NPC_IPFELKOFER_IRONKEG, 20.0f))
+ ipfelkofer->AI()->Talk(SAY_WELCOME, player->GetGUID());
+ break;
+ default:
+ break;
+ }
+
+ _triggerTimes[triggerId] = sWorld->GetGameTime();
+ return false;
+ }
+
+ private:
+ std::map<uint32, time_t> _triggerTimes;
+};
+
void AddSC_areatrigger_scripts()
{
new AreaTrigger_at_coilfang_waterfall();
@@ -265,4 +428,7 @@ void AddSC_areatrigger_scripts()
new AreaTrigger_at_scent_larkorwi();
new AreaTrigger_at_last_rites();
new AreaTrigger_at_sholazar_waygate();
+ new AreaTrigger_at_nats_landing();
+ new AreaTrigger_at_bring_your_orphan_to();
+ new AreaTrigger_at_brewfest();
}
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index 44c3ab9bdc9..e93dd2751e6 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -16,13 +16,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: GO_Scripts
-SD%Complete: 100
-SDComment: Quest support: 4285, 4287, 4288(crystal pylons), 4296, 6481, 10990, 10991, 10992, Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089, 12843, 12982, 2936. Soulwell
-SDCategory: Game Objects
-EndScriptData */
-
/* ContentData
go_cat_figurine (the "trap" version of GO, two different exist)
go_northern_crystal_pylon
@@ -48,6 +41,15 @@ go_table_theka
go_soulwell
go_bashir_crystalforge
go_ethereal_teleport_pad
+go_soulwell
+go_dragonflayer_cage
+go_tadpole_cage
+go_black_cage
+go_amberpine_outhouse
+go_hive_pod
+go_gjalerbron_cage
+go_large_gjalerbron_cage
+go_veil_skith_cage
EndContentData */
#include "ScriptPCH.h"
@@ -1179,6 +1181,7 @@ public:
/*######
## Quest 1126: Hive in the Tower
+## go_hive_pod
######*/
enum eHives
@@ -1278,6 +1281,42 @@ class go_large_gjalerbron_cage : public GameObjectScript
}
};
+/*########
+#### go_veil_skith_cage
+#####*/
+
+enum MissingFriends
+{
+ QUEST_MISSING_FRIENDS = 10852,
+ NPC_CAPTIVE_CHILD = 22314,
+ SAY_FREE_0 = 0,
+};
+
+class go_veil_skith_cage : public GameObjectScript
+{
+ public:
+ go_veil_skith_cage() : GameObjectScript("go_veil_skith_cage") { }
+
+ bool OnGossipHello(Player* player, GameObject* go)
+ {
+ if (player->GetQuestStatus(QUEST_MISSING_FRIENDS) == QUEST_STATUS_INCOMPLETE)
+ {
+ std::list<Creature*> childrenList;
+ GetCreatureListWithEntryInGrid(childrenList, go, NPC_CAPTIVE_CHILD, INTERACTION_DISTANCE);
+ for (std::list<Creature*>::const_iterator itr = childrenList.begin(); itr != childrenList.end(); ++itr)
+ {
+ go->UseDoorOrButton();
+ player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID());
+ (*itr)->ForcedDespawn(5000);
+ (*itr)->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ());
+ (*itr)->AI()->Talk(SAY_FREE_0);
+ (*itr)->GetMotionMaster()->Clear();
+ }
+ }
+ return false;
+ }
+};
+
void AddSC_go_scripts()
{
new go_cat_figurine;
@@ -1319,4 +1358,5 @@ void AddSC_go_scripts()
new go_massive_seaforium_charge;
new go_gjalerbron_cage;
new go_large_gjalerbron_cage;
+ new go_veil_skith_cage;
}
diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp
index 4099c03384c..9bfa77271f5 100644
--- a/src/server/scripts/World/item_scripts.cpp
+++ b/src/server/scripts/World/item_scripts.cpp
@@ -24,7 +24,6 @@ SDCategory: Items
EndScriptData */
/* ContentData
-item_draenei_fishing_net(i23654) Hacklike implements chance to spawn item or creature
item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832)
item_flying_machine(i34060, i34061) Engineering crafted flying machines
item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
@@ -81,45 +80,6 @@ public:
};
/*#####
-# item_draenei_fishing_net
-#####*/
-
-class item_draenei_fishing_net : public ItemScript
-{
-public:
- item_draenei_fishing_net() : ItemScript("item_draenei_fishing_net") { }
-
- //This is just a hack and should be removed from here.
- //Creature/Item are in fact created before spell are sucessfully casted, without any checks at all to ensure proper/expected behavior.
- bool OnUse(Player* player, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
- {
- if (player->GetQuestStatus(9452) == QUEST_STATUS_INCOMPLETE)
- {
- if (urand(0, 99) < 35)
- {
- Creature* Murloc = player->SummonCreature(17102, player->GetPositionX(), player->GetPositionY()+20, player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
- if (Murloc)
- Murloc->AI()->AttackStart(player);
- }
- else
- {
- ItemPosCountVec dest;
- uint32 itemId = 23614;
- InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1);
- if (msg == EQUIP_ERR_OK)
- {
- if (Item* item = player->StoreNewItem(dest, itemId, true))
- player->SendNewItem(item, 1, false, true);
- }
- else
- player->SendEquipError(msg, NULL, NULL, itemId);
- }
- }
- return false;
- }
-};
-
-/*#####
# item_nether_wraith_beacon
#####*/
@@ -452,7 +412,6 @@ public:
void AddSC_item_scripts()
{
new item_only_for_flight();
- new item_draenei_fishing_net();
new item_nether_wraith_beacon();
new item_gor_dreks_ointment();
new item_incendiary_explosives();
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 38a56f7b64a..03fc07c9582 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -2026,6 +2026,16 @@ public:
{
DoCast(me, 59907, false); // Spell for Lightwell Charges
}
+
+ void EnterEvadeMode()
+ {
+ if (!me->isAlive())
+ return;
+
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->ResetPlayerDamageReq();
+ }
};
CreatureAI* GetAI(Creature* creature) const