Implement vehicles created by player mounts.
Original idea by Elmaster, packet research by Wrong, ty. --HG-- branch : trunk
This commit is contained in:
+3
-1
@@ -631,6 +631,7 @@ enum NPCFlags
|
||||
UNIT_NPC_FLAG_STABLEMASTER = 0x00400000, // 100%
|
||||
UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // cause client to send 997 opcode
|
||||
UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click), dynamic, set at loading and don't must be set in DB
|
||||
UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set
|
||||
UNIT_NPC_FLAG_GUARD = 0x10000000, // custom flag for guards
|
||||
UNIT_NPC_FLAG_OUTDOORPVP = 0x20000000, // custom flag for outdoor pvp creatures
|
||||
};
|
||||
@@ -1272,7 +1273,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
|
||||
bool IsMounted() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT ); }
|
||||
uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); }
|
||||
void Mount(uint32 mount);
|
||||
void Mount(uint32 mount, uint32 vehicleId=0);
|
||||
void Unmount();
|
||||
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
@@ -1913,6 +1914,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
bool IsAIEnabled, NeedChangeAI;
|
||||
MovementInfo m_movementInfo;
|
||||
bool CreateVehicleKit(uint32 id);
|
||||
void RemoveVehicleKit();
|
||||
Vehicle *GetVehicleKit()const { return m_vehicleKit; }
|
||||
Vehicle *GetVehicle() const { return m_vehicle; }
|
||||
bool IsOnVehicle(const Unit *unit) const { return m_vehicle && m_vehicle == unit->GetVehicleKit(); }
|
||||
|
||||
Reference in New Issue
Block a user