Scripts/Sholazar Basin: Reconnaissance Flight (12671)

Add workaround for the player/accessory mounting issue.
Some small additions.
Closes: 9443
This commit is contained in:
w1sht0l1v3
2014-04-27 02:23:33 +03:00
parent 113e6b0162
commit c20d0cb77e
2 changed files with 32 additions and 0 deletions

View File

@@ -1021,7 +1021,14 @@ public:
void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) OVERRIDE
{
if (apply && passenger->GetTypeId() == TYPEID_PLAYER)
{
/// @workaround - Because accessory gets unmounted when using vehicle_template_accessory.
/// When vehicle spawns accessory is mounted to seat 0,but when player mounts
/// he uses the same seat (instead of mounting to seat 1) kicking the accessory out.
passenger->ChangeSeat(1, false);
me->GetVehicleKit()->InstallAccessory(NPC_PILOT, 0, true, TEMPSUMMON_DEAD_DESPAWN, 0);
me->GetMotionMaster()->MovePath(NPC_PLANE, false);
}
}
void MovementInform(uint32 type, uint32 id) OVERRIDE
@@ -1056,6 +1063,7 @@ public:
case 25:
Talk(PLANE_EMOTE);
DoCast(SPELL_ENGINE);
me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVEMENT);
break;
}
}