Added vehicle*.dbc

This commit is contained in:
tomrus88 2008-11-26 19:47:07 +03:00
parent af6acab8f8
commit 943963df7e
8 changed files with 51 additions and 23 deletions

View file

@ -18659,6 +18659,14 @@ void Player::InitGlyphsForLevel()
void Player::EnterVehicle(Vehicle *vehicle)
{
VehicleEntry const *ve = sVehicleStore.LookupEntry(vehicle->GetVehicleId());
if(!ve)
return;
VehicleSeatEntry const *veSeat = sVehicleSeatStore.LookupEntry(ve->m_seatID[0]);
if(!veSeat)
return;
vehicle->SetCharmerGUID(GetGUID());
vehicle->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
vehicle->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN5);
@ -18684,9 +18692,9 @@ void Player::EnterVehicle(Vehicle *vehicle)
data << vehicle->GetOrientation(); // o
// transport part, TODO: load/calculate seat offsets
data << uint64(vehicle->GetGUID()); // transport guid
data << float(0); // transport offsetX
data << float(0); // transport offsetY
data << float(3); // transport offsetZ
data << float(veSeat->m_attachmentOffsetX); // transport offsetX
data << float(veSeat->m_attachmentOffsetY); // transport offsetY
data << float(veSeat->m_attachmentOffsetZ); // transport offsetZ
data << float(0); // transport orientation
data << uint32(getMSTime()); // transport time
data << uint8(0); // seat
@ -18694,9 +18702,6 @@ void Player::EnterVehicle(Vehicle *vehicle)
data << uint32(0); // fall time
GetSession()->SendPacket(&data);
vehicle->SetSpeed(MOVE_RUN, vehicle->GetCreatureInfo()->speed, true);
vehicle->SetSpeed(MOVE_FLIGHT, vehicle->GetCreatureInfo()->speed, true);
data.Initialize(SMSG_PET_SPELLS, 8+4+4+4+4*10+1+1);
data << uint64(vehicle->GetGUID());
data << uint32(0x00000000);

View file

@ -167,7 +167,7 @@ enum UnitBytes2_Flags
UNIT_BYTE2_FLAG_UNK1 = 0x02,
UNIT_BYTE2_FLAG_FFA_PVP = 0x04,
UNIT_BYTE2_FLAG_SANCTUARY = 0x08,
UNIT_BYTE2_FLAG_AURAS = 0x10, // show positive auras as positive, and allow its dispel
UNIT_BYTE2_FLAG_UNK4 = 0x10,
UNIT_BYTE2_FLAG_UNK5 = 0x20,
UNIT_BYTE2_FLAG_UNK6 = 0x40,
UNIT_BYTE2_FLAG_UNK7 = 0x80
@ -1149,7 +1149,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
AuraList const& GetSingleCastAuras() const { return m_scAuras; }
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY];
// Threat related methodes
// Threat related methods
bool CanHaveThreatList() const;
void AddThreat(Unit* pVictim, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellEntry const *threatSpell = NULL);
float ApplyTotalThreatModifier(float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL);

View file

@ -82,8 +82,6 @@ bool Vehicle::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 vehicleId, u
SetVehicleId(vehicleId);
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
//SetUInt32Value(UNIT_FIELD_BYTES_1, 0x02000001);
//SetUInt32Value(UNIT_FIELD_BYTES_2, 0x00000001);
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
CreatureInfo const *ci = GetCreatureInfo();

View file

@ -534,7 +534,15 @@ bool ChatHandler::HandleSpawnVehicle(const char* args)
uint32 entry = (uint32)atoi(e);
uint32 id = (uint32)atoi(i);
// TODO: check entry, id...
CreatureInfo const *ci = objmgr.GetCreatureTemplate(entry);
if(!ci)
return false;
VehicleEntry const *ve = sVehicleStore.LookupEntry(id);
if(!ve)
return false;
Vehicle *v = new Vehicle;
Map *map = m_session->GetPlayer()->GetMap();

View file

@ -132,6 +132,8 @@ TaxiPathNodesByPath sTaxiPathNodesByPath;
static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt);
DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt);
DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt);
DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt);
DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreaEntryfmt);
DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsEntryfmt);
@ -437,6 +439,8 @@ void LoadDBCStores(std::string dataPath)
sTaxiPathNodeStore.Clear();
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTotemCategoryStore, dbcPath,"TotemCategory.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleStore, dbcPath,"Vehicle.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleSeatStore, dbcPath,"VehicleSeat.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldMapAreaStore, dbcPath,"WorldMapArea.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldSafeLocsStore, dbcPath,"WorldSafeLocs.dbc");

View file

@ -200,6 +200,8 @@ extern TaxiMask sTaxiNodesMask;
extern TaxiPathSetBySource sTaxiPathSetBySource;
extern TaxiPathNodesByPath sTaxiPathNodesByPath;
extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
extern DBCStorage <VehicleEntry> sVehicleStore;
extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
//extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;

View file

@ -84,5 +84,7 @@ const char TaxiNodesEntryfmt[]="nifffxxxxxxxxxxxxxxxxxii";
const char TaxiPathEntryfmt[]="niii";
const char TaxiPathNodeEntryfmt[]="diiifffiixx";
const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii";
const char VehicleEntryfmt[]="niffffiiiiiiiiffffiiiiiifffffffffffssssfifi";
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiii";
const char WorldMapAreaEntryfmt[]="xinxffffix";
const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx";

View file

@ -275,10 +275,12 @@ namespace VMAP
{
dirFileName = getDirFileName(pMapId);
}
size_t len = pBasePath.length() + dirFileName.length();
char *filenameBuffer = new char[len+1];
sprintf(filenameBuffer, "%s%s", pBasePath.c_str(), dirFileName.c_str());
FILE* df = fopen(filenameBuffer, "rb");
//size_t len = pBasePath.length() + dirFileName.length();
//char *filenameBuffer = new char[len+1];
//sprintf(filenameBuffer, "%s%s", pBasePath.c_str(), dirFileName.c_str());
std::string fb = pBasePath + dirFileName;
//FILE* df = fopen(filenameBuffer, "rb");
FILE* df = fopen(fb.c_str(), "rb");
if(df)
{
char lineBuffer[FILENAMEBUFFER_SIZE];
@ -288,8 +290,12 @@ namespace VMAP
chomp(name);
if(name.length() >1)
{
sprintf(filenameBuffer, "%s%s", pBasePath.c_str(), name.c_str());
FILE* df2 = fopen(filenameBuffer, "rb");
//size_t len2 = pBasePath.length() + name.length();
//char *filenameBuffer2 = new char[len2+1];
//sprintf(filenameBuffer2, "%s%s", pBasePath.c_str(), name.c_str());
std::string fb2 = pBasePath + name;
//FILE* df2 = fopen(filenameBuffer2, "rb");
FILE* df2 = fopen(fb2.c_str(), "rb");
if(df2)
{
char magic[8];
@ -298,11 +304,12 @@ namespace VMAP
result = true;
fclose(df2);
}
//delete[] filenameBuffer2;
}
}
fclose(df);
}
delete[] filenameBuffer;
//delete[] filenameBuffer;
return result;
}
@ -659,14 +666,16 @@ namespace VMAP
bool MapTree::loadMap(const std::string& pDirFileName, unsigned int pMapTileIdent)
{
bool result = true;
size_t len = iBasePath.length() + pDirFileName.length();
char *filenameBuffer = new char[len+1];
//size_t len = iBasePath.length() + pDirFileName.length();
//char *filenameBuffer = new char[len+1];
if(!hasDirFile(pDirFileName))
{
FilesInDir filesInDir;
result = false;
sprintf(filenameBuffer, "%s%s", iBasePath.c_str(), pDirFileName.c_str());
FILE* df = fopen(filenameBuffer, "rb");
std::string fb = iBasePath + pDirFileName;
//sprintf(filenameBuffer, "%s%s", iBasePath.c_str(), pDirFileName.c_str());
//FILE* df = fopen(filenameBuffer, "rb");
FILE* df = fopen(fb.c_str(), "rb");
if(df)
{
char lineBuffer[FILENAMEBUFFER_SIZE];
@ -726,7 +735,7 @@ namespace VMAP
filesInDir.incRefCount();
}
}
delete [] filenameBuffer;
//delete [] filenameBuffer;
return (result);
}