Scripts/Quests: Fix Quest A Spirit Guide

- Ensures rep adjustment buff is always applied (overrides evade, implements existing evade + re-apply buff)
- Removes un-owned ravagers with incorrect faction from DB (the correct ones are spawned with their masters without the DB entries)
- Create some extra steps in the wolf's waypoints in order to generate some AI events for the Ryga NPC. I think it's a bit of a dirty solution, but it seems to work with minimal changes.
- Created RP series of events with Ryga NPC and Ancestral Wolf Spirit (Ryga Kneels, talks to wolf, then returns to spawn position after around a minute).

Closes #13619
Fix #4028
This commit is contained in:
pete318
2014-12-28 18:42:52 +00:00
committed by Nayd
parent 94bfeb8e6b
commit f2444eedf9
2 changed files with 53 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
DELETE FROM `creature` WHERE `id`=19461;
DELETE FROM `script_waypoint` WHERE `entry`=17077 AND `pointid` IN (51, 52);
INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES
(17077, 51, 519.146, 3886.7, 190.128, 10000, 'RYGA_WALK'),
(17077, 52, 519.146, 3886.7, 190.128, 1000, 'RYGA_RETURN');

View File

@@ -140,8 +140,8 @@ enum AncestralWolf
{
EMOTE_WOLF_LIFT_HEAD = 0,
EMOTE_WOLF_HOWL = 1,
SAY_WOLF_WELCOME = 2,
SPELL_ANCESTRAL_WOLF_BUFF = 29981,
SAY_WOLF_WELCOME = 0,
SPELL_ANCESTRAL_WOLF_BUFF = 29938,
NPC_RYGA = 17123
};
@@ -166,11 +166,16 @@ public:
void Reset() override
{
ryga = NULL;
}
// Override Evade Mode event, recast buff that was removed by standard handler
void EnterEvadeMode() override
{
npc_escortAI::EnterEvadeMode();
DoCast(me, SPELL_ANCESTRAL_WOLF_BUFF, true);
}
void MoveInLineOfSight(Unit* who) override
{
if (!ryga && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f))
if (Creature* temp = who->ToCreature())
@@ -188,10 +193,48 @@ public:
break;
case 2:
Talk(EMOTE_WOLF_HOWL);
DoCast(me, SPELL_ANCESTRAL_WOLF_BUFF, true);
break;
// Move Ryga into position
case 48:
if (Creature* ryga = me->FindNearestCreature(NPC_RYGA,70))
{
if (ryga->IsAlive() && !ryga->IsInCombat())
{
ryga->SetWalk(true);
ryga->SetSpeed(MOVE_WALK, 1.5f);
ryga->GetMotionMaster()->MovePoint(0, 517.340698f, 3885.03975f, 190.455978f, true);
Reset();
}
}
break;
// Ryga Kneels and welcomes spirit wolf
case 50:
if (ryga && ryga->IsAlive() && !ryga->IsInCombat())
ryga->AI()->Talk(SAY_WOLF_WELCOME);
if (Creature* ryga = me->FindNearestCreature(NPC_RYGA,70))
{
if (ryga->IsAlive() && !ryga->IsInCombat())
{
ryga->SetFacingTo(0.776773f);
ryga->SetStandState(UNIT_STAND_STATE_KNEEL);
ryga->AI()->Talk(SAY_WOLF_WELCOME);
Reset();
}
}
break;
// Ryga returns to spawn point
case 51:
if (Creature* ryga = me->FindNearestCreature(NPC_RYGA,70))
{
if (ryga->IsAlive() && !ryga->IsInCombat())
{
float fRetX, fRetY, fRetZ, fRetO;
ryga->GetRespawnPosition(fRetX, fRetY, fRetZ, &fRetO);
ryga->SetHomePosition(fRetX, fRetY, fRetZ, fRetO);
ryga->SetStandState(UNIT_STAND_STATE_STAND);
ryga->GetMotionMaster()->MoveTargetedHome();
Reset();
}
}
break;
}
}