Jump to content
×
×
  • Create New...
  • 0

[C++]Recherche patch pour utiliser les montures à deux places


nono24

Question

Salut,

 

Je suis désespérément à la recherche d'un patch...

Mais malheureusement mes recherche n'aboutisse...

Pour les core trinity j'ai trouvé ce patch...si ca peut aidé quelqu'un.

 

Voila le code

diff -r 928055767c00 src/game/Group.h
--- a/src/game/Group.h	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/Group.h	Thu Oct 15 03:47:46 2009 -0300
@@ -87,6 +87,7 @@
    GROUP_UPDATE_FLAG_PET_AURAS         = 0x00040000,       // uint64 mask, for each bit set uint32 spellid + uint8 unk, pet auras...
    GROUP_UPDATE_FLAG_VEHICLE_SEAT      = 0x00080000,       // uint32 vehicle_seat_id (index from VehicleSeat.dbc)
    GROUP_UPDATE_PET                    = 0x0007FC00,       // all pet flags
+    GROUP_UPDATE_VEHICLE                = 0x000FFC00,       // all vehicle flags
    GROUP_UPDATE_FULL                   = 0x0007FFFF,       // all known flags
};

diff -r 928055767c00 src/game/GroupHandler.cpp
--- a/src/game/GroupHandler.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/GroupHandler.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -31,6 +31,7 @@
#include "SocialMgr.h"
#include "Util.h"
#include "SpellAuras.h"
+#include "Vehicle.h"

class Aura;

@@ -797,6 +798,13 @@
        else
            *data << (uint64) 0;
    }
+    if (mask & GROUP_UPDATE_FLAG_VEHICLE_SEAT)
+    {
+		if(player->GetVehicle()){
+			Vehicle* vv=player->GetVehicle();
+	        *data << (uint32) vv->GetVehicleInfo()->m_seatID[player->m_movementInfo.t_seat];
+		}
+    }
}

/*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/
diff -r 928055767c00 src/game/MapManager.cpp
--- a/src/game/MapManager.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/MapManager.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -19,7 +19,7 @@
 */

#ifdef MULTI_THREAD_MAP
-#include 
+//#include 
#endif
#include "MapManager.h"
#include "InstanceSaveMgr.h"
diff -r 928055767c00 src/game/MovementHandler.cpp
--- a/src/game/MovementHandler.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/MovementHandler.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -256,9 +256,15 @@
        recv_data.rpos(recv_data.wpos());                   // prevent warnings spam
        return;
    }
-
    /* handle special cases */
-    if (movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT)
+	if((movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT) && (movementInfo.flags  & MOVEMENTFLAG_ROOT) && (recv_data.size()==52))
+	{
+		if(plMover->GetVehicle() && plMover->GetVehicle()->GetBase()->GetTypeId()==TYPEID_PLAYER)
+		{
+			_player->ExitVehicle();
+		}
+		//return;
+	}else if (movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT)
    {
        // transports size limited
        // (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped)
@@ -325,7 +331,6 @@
    GetPlayer()->SendMessageToSet(&data, false);

    mover->m_movementInfo = movementInfo;
-
    if(mover->GetVehicle())
    {
        mover->SetOrientation(movementInfo.o);
diff -r 928055767c00 src/game/Object.cpp
--- a/src/game/Object.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/Object.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -462,8 +462,14 @@
    // 0x80
    if(flags & UPDATEFLAG_VEHICLE)                          // unused for now
    {
-        *data << uint32(((Unit*)this)->GetVehicleKit()->GetVehicleInfo()->m_ID);  // vehicle id
-        *data << float(0);                                  // facing adjustment
+		if(((Unit*)this)->GetVehicleKit())
+		{
+			*data << uint32(((Unit*)this)->GetVehicleKit()->GetVehicleInfo()->m_ID);  // vehicle id
+			*data << float(0);                                  // facing adjustment
+		}else{
+			*data << uint32(0);  // vehicle id
+			*data << float(0);  
+		}
    }

    // 0x200
@@ -538,7 +544,8 @@

                    if (GetTypeId() == TYPEID_UNIT && !target->canSeeSpellClickOn((Creature*)this))
                        appendValue &= ~UNIT_NPC_FLAG_SPELLCLICK;
-
+					if (GetTypeId() == TYPEID_PLAYER && ((Player*)this)->IsVehicle())
+                        appendValue &= ~UNIT_NPC_FLAG_SPELLCLICK;
                    *data << uint32(appendValue);
                }
                else if (index == UNIT_FIELD_AURASTATE)
diff -r 928055767c00 src/game/Opcodes.cpp
--- a/src/game/Opcodes.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/Opcodes.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -938,7 +938,7 @@
    /*0x38B*/ { "SMSG_REALM_SPLIT",                             STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x38C*/ { "CMSG_REALM_SPLIT",                             STATUS_AUTHED,   &WorldSession::HandleRealmSplitOpcode          },
    /*0x38D*/ { "CMSG_MOVE_CHNG_TRANSPORT",                     STATUS_LOGGEDIN, &WorldSession::HandleMovementOpcodes           },
-    /*0x38E*/ { "MSG_PARTY_ASSIGNMENT",                         STATUS_LOGGEDIN, &WorldSession::HandlePartyAssignmentOpcode     },
+	/*0x38E*/ { "MSG_PARTY_ASSIGNMENT",                         STATUS_LOGGEDIN, &WorldSession::HandlePartyAssignmentOpcode     },
    /*0x38F*/ { "SMSG_OFFER_PETITION_ERROR",                    STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x390*/ { "SMSG_TIME_SYNC_REQ",                           STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x391*/ { "CMSG_TIME_SYNC_RESP",                          STATUS_LOGGEDIN, &WorldSession::HandleTimeSyncResp              },
@@ -1216,12 +1216,12 @@
    /*0x4A1*/ { "SMSG_SERVER_INFO_RESPONSE",                    STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x4A2*/ { "CMSG_CHECK_LOGIN_CRITERIA",                    STATUS_NEVER,    &WorldSession::Handle_NULL                     },
    /*0x4A3*/ { "SMSG_SERVER_BUCK_DATA_START",                  STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
-    /*0x4A4*/ { "CMSG_QUERY_VEHICLE_STATUS",                    STATUS_NEVER,    &WorldSession::Handle_NULL                     },
+    /*0x4A4*/ { "CMSG_QUERY_VEHICLE_STATUS",                    STATUS_LOGGEDIN, &WorldSession::Handle_NULL			            },
    /*0x4A5*/ { "UMSG_UNKNOWN_1189",                            STATUS_NEVER,    &WorldSession::Handle_NULL                     },
    /*0x4A6*/ { "SMSG_UNKNOWN_1190",                            STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
-    /*0x4A7*/ { "SMSG_UNKNOWN_1191",                            STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
+    /*0x4A7*/ { "SMSG_PLAYER_VEHICLE_DATA",                     STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x4A8*/ { "CMSG_UNKNOWN_1192",                            STATUS_NEVER,    &WorldSession::Handle_NULL                     },
-    /*0x4A9*/ { "CMSG_EJECT_PASSENGER",                         STATUS_NEVER,    &WorldSession::Handle_NULL                     },
+	/*0x4A9*/ { "CMSG_EJECT_PASSENGER",                         STATUS_LOGGEDIN, &WorldSession::HandleEjectPasenger             },
    /*0x4AA*/ { "SMSG_PET_GUIDS",                               STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x4AB*/ { "SMSG_CLIENTCACHE_VERSION",                     STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x4AC*/ { "UMSG_UNKNOWN_1196",                            STATUS_NEVER,    &WorldSession::Handle_NULL                     },
diff -r 928055767c00 src/game/Opcodes.h
--- a/src/game/Opcodes.h	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/Opcodes.h	Thu Oct 15 03:47:46 2009 -0300
@@ -1227,7 +1227,7 @@
    CMSG_QUERY_VEHICLE_STATUS                       = 0x4A4, // not found
    UMSG_UNKNOWN_1189                               = 0x4A5, // not found, old SMSG_PET_GUIDS
    SMSG_UNKNOWN_1190                               = 0x4A6, // smsg unk, old SMSG_CLIENTCACHE_VERSION
-    SMSG_UNKNOWN_1191                               = 0x4A7, // smsg guid+uint32 (vehicle)
+    SMSG_PLAYER_VEHICLE_DATA                        = 0x4A7, // smsg guid+uint32 (vehicle)
    CMSG_UNKNOWN_1192                               = 0x4A8, // cmsg uint64
    CMSG_EJECT_PASSENGER                            = 0x4A9, // cmsg uint64
    SMSG_PET_GUIDS                                  = 0x4AA, // shifted+5
diff -r 928055767c00 src/game/SpellAuras.cpp
--- a/src/game/SpellAuras.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/SpellAuras.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -3222,7 +3222,7 @@
            if(GetSpellProto()->Effect[i] == SPELL_EFFECT_SUMMON
                && GetSpellProto()->EffectMiscValue[i] == GetMiscValue())
                display_id = 0;
-        m_target->Mount(display_id);
+        m_target->Mount(display_id,ci->VehicleId);
    }
    else
    {
diff -r 928055767c00 src/game/Transports.cpp
--- a/src/game/Transports.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/Transports.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -475,6 +475,11 @@

bool Transport::AddPassenger(Player* passenger)
{
+	if(passenger->IsMounted()){
+		passenger->RemoveAurasByType(SPELL_AURA_MOUNTED);
+		passenger->Unmount();
+	}
+
    if(m_passengers.insert(passenger).second)
        sLog.outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName());
    return true;
diff -r 928055767c00 src/game/Unit.cpp
--- a/src/game/Unit.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/Unit.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -441,22 +441,30 @@

void Unit::SendMonsterMoveTransport(Unit *vehicleOwner)
{
-    WorldPacket data(SMSG_MONSTER_MOVE_TRANSPORT, GetPackGUID().size()+vehicleOwner->GetPackGUID().size());
-    data.append(GetPackGUID());
-    data.append(vehicleOwner->GetPackGUID());
-    data << int8(GetTransSeat());
-    data << uint8(0);
-    data << GetPositionX() - vehicleOwner->GetPositionX();
-    data << GetPositionY() - vehicleOwner->GetPositionY();
-    data << GetPositionZ() - vehicleOwner->GetPositionZ();
-    data << uint32(getMSTime());
-    data << uint8(4);
-    data << GetTransOffsetO();
-    data << uint32(MOVEFLAG_ENTER_TRANSPORT);
-    data << uint32(0); // move time
-    data << uint32(0);//GetTransOffsetX();
-    data << uint32(0);//GetTransOffsetY();
-    data << uint32(0);//GetTransOffsetZ();
+	if (vehicleOwner->GetTypeId()==TYPEID_PLAYER)
+	{
+		WorldPacket data2( SMSG_PLAYER_VEHICLE_DATA, vehicleOwner->GetPackGUID().size()+4);
+			data2.append(vehicleOwner->GetPackGUID());
+			data2 << uint32(GetVehicle()->GetVehicleInfo()->m_ID);
+		((Player*)this)->GetSession()->SendPacket(&data2);
+	}
+		WorldPacket data(SMSG_MONSTER_MOVE_TRANSPORT, GetPackGUID().size()+vehicleOwner->GetPackGUID().size());
+		data.append(GetPackGUID());
+		data.append(vehicleOwner->GetPackGUID());
+		data << int8(GetTransSeat());
+		data << uint8(0);
+		data << GetPositionX() - vehicleOwner->GetPositionX();
+		data << GetPositionY() - vehicleOwner->GetPositionY();
+		data << GetPositionZ() - vehicleOwner->GetPositionZ();
+		data << uint32(getMSTime());
+		data << uint8(4);
+		data << GetTransOffsetO();
+		data << uint32(MOVEFLAG_ENTER_TRANSPORT);
+		data << uint32(0); // move time
+		data << uint32(0); // Number of waypoints
+		data << uint32(0); // GetTransOffsetX();
+		data << uint32(0); // GetTransOffsetY();
+		data << uint32(0); // GetTransOffsetZ();
    SendMessageToSet(&data, true);
}

@@ -10456,7 +10464,7 @@
    return uint32((WeaponSpeed * PPM) / 600.0f);   // result is chance in percents (probability = Speed_in_sec * (PPM / 60))
}

-void Unit::Mount(uint32 mount)
+void Unit::Mount(uint32 mount,uint32 VehicleId)
{
    RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOUNT);

@@ -10480,6 +10488,21 @@
        }
    }

+		if(VehicleId!=0 && GetTypeId()==TYPEID_PLAYER)
+		{
+			if(VehicleEntry const *ve = sVehicleStore.LookupEntry(VehicleId))
+			{
+				CreateVehicleKit(VehicleId);
+				GetVehicleKit()->Reset();	
+				WorldPacket data( SMSG_PLAYER_VEHICLE_DATA, GetPackGUID().size()+4);
+					data.appendPackGUID(GetGUID());
+					data << uint32(VehicleId);
+				((Player*)this)->GetSession()->SendPacket(&data);
+
+				data.Initialize(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
+				((Player*)this)->GetSession()->SendPacket( &data );
+			}
+		}
}

void Unit::Unmount()
@@ -10505,6 +10528,19 @@
        else
            ((Player*)this)->ResummonPetTemporaryUnSummonedIfAny();
    }
+
+	if(GetTypeId()==TYPEID_PLAYER && IsVehicle())
+	{
+		RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE);
+		GetVehicleKit()->Uninstall();
+		CreateVehicleKit(0);
+		RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+		WorldPacket data( SMSG_PLAYER_VEHICLE_DATA, 8+4 );
+		data.appendPackGUID(GetGUID());
+		data << uint32(0);
+		((Player*)this)->SendMessageToSet( &data,true );
+		((Player*)this)->SendUpdateObjectToAllExcept(NULL);
+	}
}

void Unit::SetInCombatWith(Unit* enemy)
@@ -14135,8 +14171,8 @@
            case CHARM_TYPE_VEHICLE:
                SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
                ((Player*)charmer)->SetClientControl(this, 1);
-                ((Player*)charmer)->SetViewpoint(this, true);
-                ((Player*)charmer)->VehicleSpellInitialize();
+				((Player*)charmer)->SetViewpoint(this, true);
+				((Player*)charmer)->VehicleSpellInitialize();
                break;
            case CHARM_TYPE_POSSESS:
                addUnitState(UNIT_STAT_POSSESSED);
@@ -14301,6 +14337,11 @@

bool Unit::CreateVehicleKit(uint32 id)
{
+	if(id==0){
+		m_vehicleKit->m_Seats.clear();
+		m_vehicleKit=NULL;
+		m_unitTypeMask &= ~UNIT_MASK_VEHICLE;
+	}
    VehicleEntry const *vehInfo = sVehicleStore.LookupEntry(id);
    if(!vehInfo)
        return false;
@@ -14833,8 +14874,11 @@
    m_movementInfo.t_time = 0;
    m_movementInfo.t_seat = 0;

-    Relocate(vehicle->GetBase());
-
+    Relocate(vehicle->GetBase()->GetPositionX(),
+		vehicle->GetBase()->GetPositionY(),
+		vehicle->GetBase()->GetPositionZ());
+	if(((Player*)this)->GetGroup())
+		((Player*)this)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_VEHICLE_SEAT);
    //Send leave vehicle, not correct
    if(GetTypeId() == TYPEID_PLAYER)
    {
@@ -14869,14 +14913,13 @@
            }
            break;
    }
-
-    *data << uint32(GetUnitMovementFlags()); // movement flags
-    *data << uint16(m_movementInfo.unk1);    // 2.3.0
-    *data << uint32(getMSTime());                           // time
-    *data << GetPositionX();
-    *data << GetPositionY();
-    *data << GetPositionZ();
-    *data << GetOrientation();
+		*data << uint32(GetUnitMovementFlags()); // movement flags
+		*data << uint16(m_movementInfo.unk1);    // 2.3.0
+		*data << uint32(getMSTime());                           // time
+		*data << GetPositionX();
+		*data << GetPositionY();
+		*data << GetPositionZ();
+		*data << GetOrientation();

    // 0x00000200
    if(GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT)
diff -r 928055767c00 src/game/Unit.h
--- a/src/game/Unit.h	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/Unit.h	Thu Oct 15 03:47:46 2009 -0300
@@ -1261,7 +1261,7 @@

        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; }
@@ -1894,6 +1894,7 @@

        void OutDebugInfo() const;
        virtual bool isBeingLoaded() const { return false;}
+		void AddUpdateFlags(uint32 flag){if(!(m_updateFlag & flag)) m_updateFlag|=flag;}
    protected:
        explicit Unit ();

diff -r 928055767c00 src/game/Vehicle.cpp
--- a/src/game/Vehicle.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/Vehicle.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -23,7 +23,7 @@
#include "Unit.h"
#include "Util.h"
#include "WorldPacket.h"
-
+#include "World.h"
#include "CreatureAI.h"
#include "ZoneScript.h"

@@ -350,3 +359,34 @@
    me->CombatStop();
    me->AddObjectToRemoveList();
}
+
+void Vehicle::UpdatePassengers()
+{
+	    for(SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
+        if(Unit *passenger = itr->second.passenger)
+        {
+            if(passenger->GetVehicle() != this)
+					continue;
+            if(itr->second.passenger && passenger->GetTypeId()==TYPEID_PLAYER)
+            {
+				Player* pl= ((Player*)passenger);
+				if( me->GetDistance(passenger) > (World::GetMaxVisibleDistanceOnContinents()/2))
+				{
+					pl->SetPosition(
+					me->GetPositionX()-pl->GetTransOffsetX(),
+					me->GetPositionY()-pl->GetTransOffsetY(),
+					me->GetPositionZ()-pl->GetTransOffsetZ(),
+					pl->GetOrientation());
+
+					pl->m_movementInfo.x=me->GetPositionX()-pl->GetTransOffsetX();
+					pl->m_movementInfo.y=me->GetPositionY()-pl->GetTransOffsetY();
+					pl->m_movementInfo.z=me->GetPositionZ()-pl->GetTransOffsetZ();
+
+					WorldPacket data(MSG_MOVE_HEARTBEAT, 32);
+						data.append(pl->GetPackGUID());
+						pl->BuildMovementPacket(&data);
+						pl->GetSession()->SendPacket(&data);
+				}
+            }
+        }
+}
\ No newline at end of file
diff -r 928055767c00 src/game/Vehicle.h
--- a/src/game/Vehicle.h	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/Vehicle.h	Thu Oct 15 03:47:46 2009 -0300
@@ -62,6 +62,8 @@
        void RemovePassenger(Unit *passenger);
        void RemoveAllPassengers();
        void Dismiss();
+		void UpdatePassengers();
+		bool HaveSpace() {return m_usableSeatNum;}

        SeatMap m_Seats;

diff -r 928055767c00 src/game/WorldSession.cpp
--- a/src/game/WorldSession.cpp	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/WorldSession.cpp	Thu Oct 15 03:47:46 2009 -0300
@@ -41,7 +41,7 @@
#include "SocialMgr.h"
#include "zlib/zlib.h"
#include "ScriptCalls.h"
-
+#include "Vehicle.h"
/// WorldSession constructor
WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale) :
LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time),
@@ -135,7 +135,7 @@
    }

    #endif                                                  // !TRINITY_DEBUG
-
+	uint32 psize=packet->size();
    if (m_Socket->SendPacket (*packet) == -1)
        m_Socket->CloseSocket ();
}
@@ -189,6 +189,16 @@
        else
        {
            OpcodeHandler& opHandle = opcodeTable[packet->GetOpcode()];
+/*			if(_player)
+			{
+				if(packet->GetOpcode()!=CMSG_MOVE_TIME_SKIPPED)
+				{
+					sLog.outError("Send:%u (OP:%u)<%s>",_player->GetGUID(), opcodeTable[packet->GetOpcode()],LookupOpcodeName(packet->GetOpcode()));
+					packet->Print();
+					packet->rpos(0);
+				}
+			}*/
+				
            try
            {
                switch (opHandle.status)
@@ -731,8 +741,15 @@
    data >> mi->y;
    data >> mi->z;
    data >> mi->o;
-
-    if(mi->flags & MOVEMENTFLAG_ONTRANSPORT)
+	if((mi->flags & MOVEMENTFLAG_ONTRANSPORT) && (mi->flags  & MOVEMENTFLAG_ROOT) && (data.size()==52))
+	{   
+        data >> mi->t_seat;
+		data >> mi->t_x;
+        data >> mi->t_y;
+        data >> mi->t_z;
+        data >> mi->t_o;
+		data.read_skip(5);
+	}else if(mi->flags & MOVEMENTFLAG_ONTRANSPORT)
    {
        if(!data.readPackGUID(mi->t_guid))
            return;
@@ -895,4 +912,17 @@
    // set m_GUID that can be used while player loggined and later until m_playerRecentlyLogout not reset
    if(_player)
        m_GUIDLow = _player->GetGUIDLow();
+}
+void WorldSession::HandleEjectPasenger(WorldPacket &data)
+{
+	if(data.GetOpcode()==CMSG_EJECT_PASSENGER)
+	{
+		if(Vehicle* Vv= _player->GetVehicleKit())
+		{
+			uint64 guid;
+			data >> guid;
+			if(Player* Pl=ObjectAccessor::FindPlayer(guid))
+				Pl->ExitVehicle();
+		}
+	}
}
\ No newline at end of file
diff -r 928055767c00 src/game/WorldSession.h
--- a/src/game/WorldSession.h	Wed Oct 14 02:24:52 2009 -0700
+++ b/src/game/WorldSession.h	Thu Oct 15 03:47:46 2009 -0300
@@ -747,6 +747,7 @@
        bool HandleOnItemOpen(Item *pItem);
        bool HandleOnGoClick(GameObject *pGameObject);
        void HandleOnCreatureKill(Creature *pCreature);
+		void HandleEjectPasenger(WorldPacket &data);
    private:
        // private trade methods
        void moveItems(Item* myItems[], Item* hisItems[]);

 

Mais moi je cherche un patch pour MaNGOS Core 3.3.5 (12340) lol pas trinityCore

 

Ps: Dsl de faire un peut bug le kit du fofo :P

 

Source trinityCore

 

Link to comment
  • Answers 7
  • Created
  • Last Reply

Top Posters For This Question

7 answers to this question

Recommended Posts

  • 0

Bonjour,

 

J'ai trouvé un patch pour un core mangos mais bon il ne fonctionne pas.

 

Voici le patch:

diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 49c96f2..d48fef8 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -600,8 +600,15 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2)
    // 0x80
    if(flags & UPDATEFLAG_VEHICLE)                          // unused for now
    {
-        *data << uint32(((Vehicle*)this)->GetVehicleId());  // vehicle id
-        *data << float(0);                                  // facing adjustment
+		if(((Unit*)this)->GetVehicleGUID())
+		{
+			*data << uint32(((Vehicle*)this)->GetVehicleId());  // vehicle id
+			*data << float(0);                                  // facing adjustment
+		}else
+		{
+			*data << uint32(0); // vehicle id
+			*data << float(0);
+		}
    }

    // 0x200
diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp
index 1d9ce9a..2c7c452 100644
--- a/src/game/Opcodes.cpp
+++ b/src/game/Opcodes.cpp
@@ -1214,12 +1214,12 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
    /*0x4A1*/ { "SMSG_SERVER_INFO_RESPONSE",                    STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x4A2*/ { "CMSG_CHECK_LOGIN_CRITERIA",                    STATUS_NEVER,    &WorldSession::Handle_NULL                     },
    /*0x4A3*/ { "SMSG_SERVER_BUCK_DATA_START",                  STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
-    /*0x4A4*/ { "CMSG_QUERY_VEHICLE_STATUS",                    STATUS_NEVER,    &WorldSession::Handle_NULL                     },
+    /*0x4A4*/ { "CMSG_QUERY_VEHICLE_STATUS",                    STATUS_LOGGEDIN, &WorldSession::Handle_NULL                     },
    /*0x4A5*/ { "UMSG_UNKNOWN_1189",                            STATUS_NEVER,    &WorldSession::Handle_NULL                     },
    /*0x4A6*/ { "SMSG_UNKNOWN_1190",                            STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
-    /*0x4A7*/ { "SMSG_UNKNOWN_1191",                            STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
+    /*0x4A7*/ { "SMSG_PLAYER_VEHICLE_DATA",                     STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x4A8*/ { "CMSG_UNKNOWN_1192",                            STATUS_NEVER,    &WorldSession::Handle_NULL                     },
-    /*0x4A9*/ { "CMSG_EJECT_PASSENGER",                         STATUS_NEVER,    &WorldSession::Handle_NULL                     },
+    /*0x4A9*/ { "CMSG_EJECT_PASSENGER",                         STATUS_LOGGEDIN, &WorldSession::HandleEjectPasenger             },
    /*0x4AA*/ { "SMSG_PET_GUIDS",                               STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x4AB*/ { "SMSG_CLIENTCACHE_VERSION",                     STATUS_NEVER,    &WorldSession::Handle_ServerSide               },
    /*0x4AC*/ { "UMSG_UNKNOWN_1196",                            STATUS_NEVER,    &WorldSession::Handle_NULL                     },
diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h
index 537fea1..11c910a 100644
--- a/src/game/Opcodes.h
+++ b/src/game/Opcodes.h
@@ -1225,7 +1225,7 @@ enum Opcodes
    CMSG_QUERY_VEHICLE_STATUS                       = 0x4A4, // not found
    UMSG_UNKNOWN_1189                               = 0x4A5, // not found, old SMSG_PET_GUIDS
    SMSG_UNKNOWN_1190                               = 0x4A6, // smsg unk, "You can't do that yet"
-    SMSG_UNKNOWN_1191                               = 0x4A7, // smsg guid+uint32 (vehicle)
+    SMSG_PLAYER_VEHICLE_DATA                        = 0x4A7, // smsg guid+uint32 (vehicle)
    CMSG_UNKNOWN_1192                               = 0x4A8, // cmsg uint64
    CMSG_EJECT_PASSENGER                            = 0x4A9, // cmsg uint64
    SMSG_PET_GUIDS                                  = 0x4AA, // shifted+5
diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp
index e876e34..db857bc 100644
--- a/src/game/Transports.cpp
+++ b/src/game/Transports.cpp
@@ -472,6 +472,10 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)

bool Transport::AddPassenger(Player* passenger)
{
+	if(passenger->IsMounted())
+		passenger->Unmount();
+
+
    if (m_passengers.find(passenger) == m_passengers.end())
    {
        sLog.outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName());
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index dc763cf..4b83a7b 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -9913,6 +9913,28 @@ void Unit::Mount(uint32 mount, uint32 spellId)
            }
        }
    }
+
+	if(GetTypeId() == TYPEID_PLAYER && spellId != 0 )
+	{
+		if(VehicleEntry const *ve  = sVehicleStore.LookupEntry(spellId))
+		{
+			CreateVehicleKit(spellId);
+			GetVehicleKit()->Reset();
+
+			WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, GetPackGUID().size() +4);
+			data.appendPackGUID(GetGUID());
+			data << uint32(spellId);
+
+			data.Initialize(SMSG_PLAYER_VEHICLE_DATA, 0);
+			((Player*)this)->GetSession()->SendPacket( &data );
+
+
+
+		}
+
+
+	}
+
}

void Unit::Unmount()
@@ -9935,6 +9957,21 @@ void Unit::Unmount()
        else
            ((Player*)this)->ResummonPetTemporaryUnSummonedIfAny();
    }
+
+	if(GetTypeId() == TYPEID_PLAYER && isVehicle())
+	{
+		RemoveSpellsCausingAura(SPELL_AURA_CONTROL_VEHICLE);
+		GetVehicleKit()->Dismiss();
+		CreateVehicleKit(0);
+		RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+		WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, 8+4);
+		data.appendPackGUID(GetGUID());
+
+		data << uint32(0);
+		((Player*) this)->SendMessageToSet( &data, true );
+
+	}
+
}

void Unit::SetInCombatWith(Unit* enemy)
@@ -12982,7 +13019,18 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seat_id, bool force)
        pet->Remove(PET_SAVE_AS_CURRENT);

    if(GetTypeId() == TYPEID_PLAYER)
-        ((Player*)this)->SendEnterVehicle(v);
+	{
+		((Player*)this)->SendEnterVehicle(v);
+
+		WorldPacket data2 (SMSG_PLAYER_VEHICLE_DATA, vehicle->GetPackGUID().size() +4);
+		data2.append(vehicle->GetPackGUID());
+		data2 << uint32(vehicle->GetVehicleId());
+
+		((Player *)this)->GetSession()->SendPacket(&data2);
+
+
+	}
+	

    WorldPacket data(SMSG_MONSTER_MOVE_TRANSPORT, 60);
    data.append(GetPackGUID());
diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h
index dfe595f..db5d21e 100644
--- a/src/game/WorldSession.h
+++ b/src/game/WorldSession.h
@@ -733,6 +733,8 @@ class MANGOS_DLL_SPEC WorldSession
        void HandleEquipmentSetDelete(WorldPacket& recv_data);
        void HandleEquipmentSetUse(WorldPacket& recv_data);
        void HandleWorldStateUITimerUpdate(WorldPacket& recv_data);
+		void HandleEjectPasenger(WorldPacket &data);
+
    private:
        // private trade methods
        void moveItems(Item* myItems[], Item* hisItems[]);
diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp
index 837ba5c..e2774e2 100644
--- a/src/game/WorldSocket.cpp
+++ b/src/game/WorldSocket.cpp
@@ -42,6 +42,7 @@
#include "WorldSession.h"
#include "WorldSocketMgr.h"
#include "Log.h"
+#include "Vehicle.h"

#if defined( __GNUC__ )
#pragma pack(1)
@@ -1018,3 +1019,17 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
    packet << ping;
    return SendPacket (packet);
}
+
+void WorldSession::HandleEjectPasenger(WorldPacket &data)
+{
+	if(data.GetOpcode()==CMSG_EJECT_PASSENGER)
+	{
+		if(Vehicle* Vv= _player->GetVehicleKit())
+		{
+			uint64 guid;
+			data >> guid;
+			if(Player* Pl=ObjectAccessor::FindPlayer(guid))
+				Pl->ExitVehicle();
+		}
+	}
+}
\ No newline at end of file

 

A la compilation que des erreurs xD:

...
2>Opcodes.cpp
2>..\..\src\game\Opcodes.cpp(1222) : error C2039: 'HandleEjectPasenger' : n'est pas membre de 'WorldSession'
2>        c:\mangos\src\game\WorldSession.h(136) : voir la déclaration de 'WorldSession'
2>..\..\src\game\Opcodes.cpp(1222) : error C2065: 'HandleEjectPasenger' : identificateur non déclaré
2>Unit.cpp
2>..\..\src\game\WorldSocket.cpp(1026) : error C2039: 'HandleEjectPasenger' : n'est pas membre de 'WorldSession'
2>        c:\mangos\src\game\WorldSession.h(136) : voir la déclaration de 'WorldSession'
2>..\..\src\game\WorldSocket.cpp(1030) : error C2065: '_player' : identificateur non déclaré
2>..\..\src\game\WorldSocket.cpp(1030) : error C2227: la partie gauche de '->GetVehicleKit' doit pointer vers un type class/struct/union/générique
2>        le type est ''unknown-type''
2>..\..\src\game\Unit.cpp(10353) : error C3861: 'CreateVehicleKit' : identificateur introuvable
2>..\..\src\game\Unit.cpp(10354) : error C2227: la partie gauche de '->Reset' doit pointer vers un type class/struct/union/générique
2>        le type est ''unknown-type''
2>..\..\src\game\Unit.cpp(10354) : error C3861: 'GetVehicleKit' : identificateur introuvable
2>..\..\src\game\Unit.cpp(10393) : error C3861: 'isVehicle' : identificateur introuvable
2>..\..\src\game\Unit.cpp(10396) : error C2227: la partie gauche de '->Dismiss' doit pointer vers un type class/struct/union/générique
2>        le type est ''unknown-type''
2>..\..\src\game\Unit.cpp(10396) : error C3861: 'GetVehicleKit' : identificateur introuvable
2>..\..\src\game\Unit.cpp(10397) : error C3861: 'CreateVehicleKit' : identificateur introuvable
2>..\..\src\game\Unit.cpp(13678) : error C2248: 'ByteBuffer::append' : impossible d'accéder à private membre déclaré(e) dans la classe 'ByteBuffer'
...
...
========== Génération : 1 a réussi, 1 a échoué, 11 mis à jour, 0 a été ignoré ==========

 

Quelqu'un pourrait m'aider?

 

Cordialement

Link to comment
  • 0

Beh à chaque fichier indiqué j'enlève les phrases - et je rajoute les phrases +

Et pour savoir ou je met mes phrases +, je me repère avec les phrases existantes...

 

Mais j'ai bien fait attention en appliquant ce patch, je pense simplement qu'il y à plein d'erreurs dedans et j'aurais espéré que tu m'aiderait lol

 

Link to comment


  • Flux d'Activité

    1. 201

      Stump 2.42

    2. 201

      Stump 2.42

    3. 51

      Decay 2.51

    4. 51

      Decay 2.51

    5. 51

      Decay 2.51

    6. 51

      Decay 2.51

    7. 51

      Decay 2.51

    8. 51

      Decay 2.51

    9. 51

      Decay 2.51

  • Recently Browsing

    No registered users viewing this page.

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.