Scripts: replace some SetOrientation() calls with spline packets and some random changes
This commit is contained in:
1 parent
bb45db65a0
commit
eddf1b5a64
15 files changed
+36
-59
No files matched your search
@@ -923,7 +923,7 @@ public:
|
||||
if (!ve)
|
||||
return false;
|
||||
|
||||
Creature* v = new Creature;
|
||||
Creature* v = new Creature();
|
||||
|
||||
Map* map = handler->GetSession()->GetPlayer()->GetMap();
|
||||
|
||||
|
||||
@@ -689,7 +689,7 @@ public:
|
||||
wpCreature->AddObjectToRemoveList();
|
||||
}
|
||||
// re-create
|
||||
Creature* wpCreature2 = new Creature;
|
||||
Creature* wpCreature2 = new Creature();
|
||||
if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
|
||||
@@ -913,7 +913,7 @@ public:
|
||||
Map* map = chr->GetMap();
|
||||
float o = chr->GetOrientation();
|
||||
|
||||
Creature* wpCreature = new Creature;
|
||||
Creature* wpCreature = new Creature();
|
||||
if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
|
||||
@@ -977,7 +977,7 @@ public:
|
||||
float o = chr->GetOrientation();
|
||||
Map* map = chr->GetMap();
|
||||
|
||||
Creature* creature = new Creature;
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
|
||||
@@ -1026,7 +1026,7 @@ public:
|
||||
Player* chr = handler->GetSession()->GetPlayer();
|
||||
Map* map = chr->GetMap();
|
||||
|
||||
Creature* creature = new Creature;
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
DoCast(me, SPELL_ICEARMOR, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)OVERRIDE { }
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE { }
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
|
||||
@@ -351,8 +351,7 @@ public:
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
me->SetOrientation(me->GetAngle(breathX, breathY));
|
||||
me->StopMoving();
|
||||
me->SetFacingTo(me->GetAngle(breathX, breathY));
|
||||
//DoTextEmote("takes a deep breath.", NULL);
|
||||
events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000);
|
||||
break;
|
||||
|
||||
@@ -258,7 +258,7 @@ class npc_shade_of_jindo : public CreatureScript
|
||||
DoCast(me, SPELL_INVISIBLE, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)OVERRIDE { }
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE { }
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
break;
|
||||
case 11:
|
||||
Talk(SAY_PROGRESS2, player->GetGUID());
|
||||
me->SetOrientation(4.762841f);
|
||||
me->SetFacingTo(4.762841f);
|
||||
break;
|
||||
case 18:
|
||||
{
|
||||
@@ -186,11 +186,11 @@ public:
|
||||
player->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
|
||||
break;
|
||||
case 32:
|
||||
me->SetOrientation(2.978281f);
|
||||
me->SetFacingTo(2.978281f);
|
||||
Talk(SAY_END1, player->GetGUID());
|
||||
break;
|
||||
case 33:
|
||||
me->SetOrientation(5.858011f);
|
||||
me->SetFacingTo(5.858011f);
|
||||
Talk(SAY_END2, player->GetGUID());
|
||||
Creature* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
|
||||
if (CaptainHelios)
|
||||
|
||||
@@ -308,18 +308,15 @@ public:
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
Unit* pKri = Unit::GetUnit(*me, instance->GetData64(DATA_KRI));
|
||||
Unit* pVem = Unit::GetUnit(*me, instance->GetData64(DATA_VEM));
|
||||
|
||||
switch (urand(0, 2))
|
||||
{
|
||||
case 0:
|
||||
if (pKri)
|
||||
DoCast(pKri, SPELL_HEAL);
|
||||
if (Creature* kri = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_KRI)))
|
||||
DoCast(kri, SPELL_HEAL);
|
||||
break;
|
||||
case 1:
|
||||
if (pVem)
|
||||
DoCast(pVem, SPELL_HEAL);
|
||||
if (Creature* vem = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VEM)))
|
||||
DoCast(vem, SPELL_HEAL);
|
||||
break;
|
||||
case 2:
|
||||
DoCast(me, SPELL_HEAL);
|
||||
|
||||
@@ -551,14 +551,13 @@ public:
|
||||
events.ScheduleEvent(EVENT_SCRIPT_11, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_11:
|
||||
me->SetOrientation(2.932153f);
|
||||
me->SendMovementFlagUpdate(true);
|
||||
me->SetFacingTo(2.932153f);
|
||||
Talk(SAY_BRANN_3, playerGUID);
|
||||
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
if (GameObject* go = ObjectAccessor::GetGameObject(*me, objectGUID[i]))
|
||||
go->Delete();
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_SCRIPT_12, 6000);
|
||||
break;
|
||||
case EVENT_SCRIPT_12:
|
||||
|
||||
@@ -400,7 +400,7 @@ public:
|
||||
|
||||
struct npc_commander_dawnforgeAI : public ScriptedAI
|
||||
{
|
||||
npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset(); }
|
||||
npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint64 PlayerGUID;
|
||||
uint64 ardonisGUID;
|
||||
@@ -411,9 +411,6 @@ public:
|
||||
uint32 Phase_Timer;
|
||||
bool isEvent;
|
||||
|
||||
float angle_dawnforge;
|
||||
float angle_ardonis;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
PlayerGUID = 0;
|
||||
@@ -438,21 +435,15 @@ public:
|
||||
{
|
||||
Creature* ardonis = ObjectAccessor::GetCreature(*me, ardonisGUID);
|
||||
Creature* pathaleon = ObjectAccessor::GetCreature(*me, pathaleonGUID);
|
||||
Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
|
||||
|
||||
if (!ardonis || !pathaleon || !player)
|
||||
if (!ardonis || !pathaleon)
|
||||
return;
|
||||
|
||||
//Calculate the angle to Pathaleon
|
||||
angle_dawnforge = me->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
|
||||
angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
|
||||
// Turn Dawnforge
|
||||
me->SetFacingToObject(pathaleon);
|
||||
|
||||
//Turn Dawnforge and update
|
||||
me->SetOrientation(angle_dawnforge);
|
||||
me->SendUpdateToPlayer(player);
|
||||
//Turn Ardonis and update
|
||||
ardonis->SetOrientation(angle_ardonis);
|
||||
ardonis->SendUpdateToPlayer(player);
|
||||
// Turn Ardonis
|
||||
ardonis->SetFacingToObject(pathaleon);
|
||||
|
||||
//Set them to kneel
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
@@ -464,20 +455,11 @@ public:
|
||||
{
|
||||
if (Unit* ardonis = ObjectAccessor::GetUnit(*me, ardonisGUID))
|
||||
{
|
||||
Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
|
||||
// Turn Dawnforge
|
||||
me->SetFacingToObject(ardonis);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
angle_dawnforge = me->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
|
||||
angle_ardonis = ardonis->GetAngle(me->GetPositionX(), me->GetPositionY());
|
||||
|
||||
//Turn Dawnforge and update
|
||||
me->SetOrientation(angle_dawnforge);
|
||||
me->SendUpdateToPlayer(player);
|
||||
//Turn Ardonis and update
|
||||
ardonis->SetOrientation(angle_ardonis);
|
||||
ardonis->SendUpdateToPlayer(player);
|
||||
// Turn Ardonis
|
||||
ardonis->SetFacingToObject(me);
|
||||
|
||||
//Set state
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
Reference in new issue
Block a user