Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Scripts: Add script for aysa in chamber of whispers.
Browse files Browse the repository at this point in the history
  • Loading branch information
AriDEV3 committed Nov 27, 2023
1 parent 927ff69 commit 4612441
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sql/updates/world/2023_11_27_world_05.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
UPDATE `creature_template` SET `ScriptName`='npc_aysa_chamber_of_whispers' WHERE `entry`=55744;

DELETE FROM `areatrigger_scripts` WHERE `entry`=7041;
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(7041, 'at_chamber_of_whispers_entrance');
107 changes: 107 additions & 0 deletions src/server/scripts/Pandaria/zone_wandering_island.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,112 @@
#include "ScriptedGossip.h"
#include "Player.h"

const Position aysaChamberMovePos1 = { 647.493f, 4224.63f, 202.90865f, 2.426f };
const Position aysaChamberMovePos2 = { 598.57294f, 4266.661f, 206.54927f };
const Position aysaChamberMovePos3 = { 580.1649f, 4283.193f, 210.18248f };
const Position aysaChamberMoveEnd = { 543.9549, 4317.2744, 212.22935 };
class npc_aysa_chamber_of_whispers : public CreatureScript
{
public:
npc_aysa_chamber_of_whispers() : CreatureScript("npc_aysa_chamber_of_whispers") { }

struct npc_aysa_chamber_of_whispersAI : public CreatureAI
{
enum aysaChamberOfWhisperEvents
{
EVENT_INTRO = 1,
EVENT_DEACTIVATE_1 = 2,
EVENT_MOVE_POS_MID = 3,
EVENT_MOVE_POS_3 = 4,
EVENT_DEACTIVATE_2 = 5,
EVENT_MOVE_POS_END = 6,
EVENT_OUTRO = 7,
};
EventMap events;
npc_aysa_chamber_of_whispersAI(Creature* creature) : CreatureAI(creature)
{
creature->MonsterSay("Wait!", Language::LANG_UNIVERSAL, creature);
events.ScheduleEvent(EVENT_INTRO, 1000);
}
void UpdateAI(uint32 diff) OVERRIDE
{
events.Update(diff);

switch (events.ExecuteEvent())
{
case EVENT_INTRO:
{
me->MonsterSay("We need to wait for the winds to settle, then make a break for the cover of the far hallway.", Language::LANG_UNIVERSAL, me);
me->GetMotionMaster()->MovePoint(0, aysaChamberMovePos1);
events.ScheduleEvent(EVENT_DEACTIVATE_1, 2000);
break;
}
case EVENT_DEACTIVATE_1:
{
if (GameObject* cloud1 = me->FindNearestGameObject(209685, 30.0f))
{
cloud1->UseDoorOrButton(60000);
}
events.ScheduleEvent(EVENT_MOVE_POS_MID, 5000);
break;
}
case EVENT_MOVE_POS_MID:
{
me->GetMotionMaster()->MovePoint(1, aysaChamberMovePos2);
events.ScheduleEvent(EVENT_MOVE_POS_3, 10000);
break;
}
case EVENT_MOVE_POS_3:
{
me->MonsterSay("Wait for another opening. I'll meet you on the far side.", Language::LANG_UNIVERSAL, me);
events.ScheduleEvent(EVENT_DEACTIVATE_2, 2000);
}
case EVENT_DEACTIVATE_2:
{
me->GetMotionMaster()->MovePoint(2, aysaChamberMovePos3);
std::list<GameObject*> clouds;
me->GetGameObjectListWithEntryInGrid(clouds, 209685, 60.0f);
if (!clouds.empty())
{
for (std::list<GameObject*>::iterator itr = clouds.begin(); itr != clouds.end(); ++itr)
{
if ((*itr)->GetGUIDLow() == 88728)
{
if (GameObject* cloud2 = (*itr))
cloud2->UseDoorOrButton(60000);
}
}
}
events.ScheduleEvent(EVENT_MOVE_POS_END, 1000);
break;
}
case EVENT_MOVE_POS_END:
{
me->GetMotionMaster()->MovePoint(3, aysaChamberMoveEnd);
events.ScheduleEvent(EVENT_OUTRO, 10000);
break;
}
case EVENT_OUTRO:
{
me->MonsterSay("Dafeng! What's wrong? Why are you hiding back here?", Language::LANG_UNIVERSAL, me);
std::list<Player*> playerList;
GetPlayerListInGrid(playerList, me, 45.0f);

for (auto&& player : playerList)
{
player->KilledMonsterCredit(55666);
}
break;
}
}
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_aysa_chamber_of_whispersAI(creature);
}
};


const Position shuPos1 = { 650.30f, 3127.16f, 89.62f };
const Position shuPos2 = { 625.25f, 3127.88f, 87.95f };
Expand Down Expand Up @@ -1061,6 +1167,7 @@ class npc_aysa_cloudsinger : public CreatureScript

void AddSC_wandering_island()
{
new npc_aysa_chamber_of_whispers();
new npc_uplift_draft();
new npc_shu_dailo();
new npc_shu_pool_of_reflection();
Expand Down
20 changes: 20 additions & 0 deletions src/server/scripts/World/areatrigger_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ EndContentData */
#include "ScriptedCreature.h"
#include "Player.h"

class AreaTrigger_at_chamber_of_whispers_entrance : public AreaTriggerScript
{
public:
AreaTrigger_at_chamber_of_whispers_entrance() : AreaTriggerScript("at_chamber_of_whispers_entrance") { }

bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) OVERRIDE
{
if (player->GetQuestStatus(29785) == QUEST_STATUS_INCOMPLETE)
{
if (!player->HasAura(104571))
{
player->CastSpell(player, 104593);
return true;
}
}
return false;
}
};

const Position WugouPosMandori = { 927.5729f, 3610.2399f, 196.4969f };
//7858
class AreaTrigger_at_mandori_village_wugou : AreaTriggerScript
Expand Down Expand Up @@ -725,6 +744,7 @@ class AreaTrigger_at_frostgrips_hollow : public AreaTriggerScript

void AddSC_areatrigger_scripts()
{
new AreaTrigger_at_chamber_of_whispers_entrance();
new AreaTrigger_at_mandori_village_wugou();
new AreaTrigger_at_mandori_village_shu();
new AreaTrigger_at_shrine_of_inner_light();
Expand Down

0 comments on commit 4612441

Please sign in to comment.