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

Commit

Permalink
Scripts: add staff spawn and facings.
Browse files Browse the repository at this point in the history
  • Loading branch information
AriDEV3 committed Nov 29, 2023
1 parent d02df53 commit cdc1a9f
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions src/server/scripts/Pandaria/zone_wandering_island.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class npc_master_shang_xi_wood_of_staves : public CreatureScript
EVENT_MASTER_SHANG_XI_WOODS_TALK5 = 11,
EVENT_MASTER_SHANG_XI_WOODS_TALK6 = 12,
EVENT_MASTER_SHANG_XI_WOODS_CREDIT = 13,
EVENT_MASTER_SHANG_XI_WOODS_RESET = 14
EVENT_MASTER_SHANG_XI_WOODS_RESET = 14,
EVENT_MASTER_SHANG_XI_WOODS_SET_FACING1 = 15,
EVENT_MASTER_SHANG_XI_WOODS_KNEEL = 16,
};
public:
npc_master_shang_xi_wood_of_staves() : CreatureScript("npc_master_shang_xi_wood_of_staves") { }
Expand Down Expand Up @@ -92,12 +94,18 @@ class npc_master_shang_xi_wood_of_staves : public CreatureScript
case EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS1:
{
me->GetMotionMaster()->MovePoint(1, masterShangXiWoodsPos1);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_TALK3, 10000);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_SET_FACING1, 2000);
break;
}

case EVENT_MASTER_SHANG_XI_WOODS_SET_FACING1:
{
me->SetFacingTo(-M_PI * 1.75);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_TALK3, 8000);
break;
}
case EVENT_MASTER_SHANG_XI_WOODS_TALK3:
{
me->SetOrientation(6.0f);
std::list<Player*> playerList;
GetPlayerListInGrid(playerList, me, 15.0f);

Expand All @@ -112,41 +120,44 @@ class npc_master_shang_xi_wood_of_staves : public CreatureScript
case EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS2:
{
me->GetMotionMaster()->MovePoint(2, masterShangXiWoodsPos2);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS3, 2000);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS3, 1000);
break;
}
case EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS3:
{
me->GetMotionMaster()->MovePoint(3, masterShangXiWoodsPos3);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS4, 2000);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS4, 1000);
break;
}
case EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS4:
{
me->GetMotionMaster()->MovePoint(4, masterShangXiWoodsPos4);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS5, 2000);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS5, 1000);
break;
}
case EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS5:
{
me->GetMotionMaster()->MovePoint(5, masterShangXiWoodsPos5);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_TALK4, 2000);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_TALK4, 1000);
break;
}
case EVENT_MASTER_SHANG_XI_WOODS_TALK4:
{
if (Creature* staff = me->SummonCreature(57874, 873.09375f, 4462.259765625f, 241.41162109375f, 3.804818391799926757f, TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 70000))
me->SetFacingToObject(staff);
me->MonsterSay("Now Shen-zin Su is ill, and we are all in danger. With the help of the elements, you will break the silence. You will speak to him.", Language::LANG_UNIVERSAL, me);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS6, 5000);
break;
}
case EVENT_MASTER_SHANG_XI_WOODS_MOVE_POS6:
{
me->GetMotionMaster()->MovePoint(6, masterShangXiWoodsPos6);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_TALK5, 1000);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_TALK5, 2000);
break;
}
case EVENT_MASTER_SHANG_XI_WOODS_TALK5:
{
me->SetFacingTo(M_PI * 1.25);
me->MonsterSay("Aysa and Ji have retrieved the spirits and brought them here. You are to go with them, speak to the great Shen-zin Su, and do what must be done to save our people.", Language::LANG_UNIVERSAL, me);

events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_TALK6, 5000);
Expand All @@ -155,9 +166,14 @@ class npc_master_shang_xi_wood_of_staves : public CreatureScript
case EVENT_MASTER_SHANG_XI_WOODS_TALK6:
{
me->MonsterSay("You've come far, my young student. I see within you a great hero. I leave the fate of this land to you.", Language::LANG_UNIVERSAL, me);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_CREDIT, 5000);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_KNEEL, 5000);
break;
}
case EVENT_MASTER_SHANG_XI_WOODS_KNEEL:
{
me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
events.ScheduleEvent(EVENT_MASTER_SHANG_XI_WOODS_CREDIT, 2000);
}
case EVENT_MASTER_SHANG_XI_WOODS_CREDIT:
{
//TODO: staff plant.
Expand Down

0 comments on commit cdc1a9f

Please sign in to comment.