mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
Merge branch 'master' of git@github.com:mangos/mangos into procflag
This commit is contained in:
commit
bae58eb069
270 changed files with 23161 additions and 7761 deletions
77
ChangeLog
77
ChangeLog
|
|
@ -1,6 +1,6 @@
|
|||
MaNGOS 0.12 (??? ??? 2008)
|
||||
MaNGOS 0.13 (??? ??? 2009)
|
||||
|
||||
MaNGOS 0.12 - Codename "???" - adds further improvements to the
|
||||
MaNGOS 0.13 - adds further improvements to the
|
||||
server core as well as to the majority of game classes and the game content
|
||||
database.
|
||||
|
||||
|
|
@ -12,6 +12,79 @@ MaNGOS 0.12 (??? ??? 2008)
|
|||
* Fixed Bugs: ???
|
||||
* Total number of changes: ???
|
||||
|
||||
MaNGOS 0.12 (Dec 22 2008)
|
||||
|
||||
MaNGOS 0.12 - adds further improvements to the
|
||||
server core as well as to the majority of game classes and the game content
|
||||
database.
|
||||
|
||||
==== Game Features ====
|
||||
|
||||
* Added: Support for different difficult instances, proper instances reset and proper group/player binding to instances.
|
||||
* Added: Support for arena system.
|
||||
* Added: Support for declined names (with Cyrillic client).
|
||||
* Added: Support for auction pending mail and 1 hour delay in money delivery to owner.
|
||||
* Added: Support for possibility reject warlock's player summon by targeted player.
|
||||
* Added: Support for talent based pet auras.
|
||||
* Added: Support for auto-reward quests.
|
||||
* Added: Support for trap arming delay in combat state.
|
||||
* Added: Support for show enchantment item effect on login screen.
|
||||
* Added: Support for restoration buff in battlegrounds.
|
||||
* Added: Support for dependent spell disabling (instead removing) at talent reset until talent re-learning.
|
||||
* Added: Support for guild/arena team leaders delete protection.
|
||||
* Added: Support for areatrigger scripting.
|
||||
* Added: Support for honor rewards from quests.
|
||||
* Added: Support for realmd reconnect from login character list.
|
||||
* Added: Support for configurable assistance aggro delaying.
|
||||
* Improved: Better duels work.
|
||||
* Improved: Improvements in battleground system work including really instancing battlegrounds.
|
||||
* Improved: Better support game localization for players and GMs.
|
||||
* Improved: More server-side re-checks for client side primary checked data for prevent cheating.
|
||||
* Improved: Player can't dodge attack from behind.
|
||||
* Improved: Correctly animate eating/drinking in cases sitting at chairs/etc.
|
||||
* Improved: Better guardians related functionality work.
|
||||
* Improved: Expected instant logout in taxi flight at logout request.
|
||||
* Improved: Re-implement raid ready check code.
|
||||
* Improved: Select fishing bobber activating time in more standard way.
|
||||
* Improved: Better random/waypoint creature movement work including fly case.
|
||||
* Improved: Evade distance is now based on the distance from the position that the creature was at when it entered combat.
|
||||
* Improved: Implemented further support for contested guards.
|
||||
* Improved: Show available daily quests at map as blue marks.
|
||||
* Improved: Limit distance for listen say/yell text.
|
||||
* Improved: Removed dismount at login hack that now unneeded.
|
||||
* Improved: Better support for low character experience gain in group with high character.
|
||||
* Improved: Default behavior of pets for creatures changed to REACT_DEFENSIVE.
|
||||
* Improved: Better work with combo points on miss/parry/immune.
|
||||
* Improved: Allow have team dependent graveyards at entrance map for instances.
|
||||
* Improved: Allowed switching INVTYPE_HOLDABLE items during combat.
|
||||
* Improved: Make flying creatures fall on ground when killed.
|
||||
* Improved: More correct way of calculating fall damage by using fall distance and not fall time.
|
||||
* plus lots of fixes for auras, effects, spells, talents, and more.
|
||||
|
||||
==== Server Features ====
|
||||
|
||||
* Added: Support for load and use multiply DBC locales data at server.
|
||||
* Added: Store in `spell_chain` additional spell dependences from another spell chain for learning possibility checks.
|
||||
* Added: New chat command for reload settings from mangosd.conf file without server restart need.
|
||||
* Added: Set icon for realmd/mangosd binaries at Windows build.
|
||||
* Added: Start use Adaptive Communication Environment (ACE) framework v.5.6.6 in server network code.
|
||||
* Added: Migrate from SVN sourceforge.net to GIT github.com repository for project sources store.
|
||||
* Added: Script name indexing for creature, gameobject, item, areatrigger and instance script.
|
||||
* Added: The possibility to use custom process return values.
|
||||
* Improved: More DB tables loading at server startup and less unneeded DB access in server work time.
|
||||
* Improved: Console support for chat like commands features. Merge chat/console command list to single.
|
||||
* Improved: Implement possibility output detailed and DB error log messages from scripting code.
|
||||
* Improved: Better localization support for DB scripts and scripting library.
|
||||
* Improved: Referenced loot data moved to new table for better sharing like data from other loot tables.
|
||||
* Improved: Prevent overwriting realmd.conf and mangosd.conf on make install at Unix/Linux.
|
||||
* Improved: Update Visual Leak Detector lib to Version 1.9g (beta).
|
||||
* Improved: New revisions numbering and sql updates names scheme with tools support used after switch to GIT.
|
||||
* Improved: Use DBC data for creating initial character items.
|
||||
|
||||
==== Statistics ====
|
||||
* Fixed Bugs: many :)
|
||||
* Total number of changes: 731 (323 in git)
|
||||
|
||||
MaNGOS 0.11 (Jul 22 2008)
|
||||
|
||||
MaNGOS 0.11 - adds further improvements to the
|
||||
|
|
|
|||
9
NEWS
9
NEWS
|
|
@ -13,8 +13,15 @@ http://getmangos.com/community/
|
|||
Please submit bug reports at:
|
||||
http://mangos.lighthouseapp.com/
|
||||
|
||||
Version 0.12
|
||||
Version 0.13
|
||||
* Under discussion.
|
||||
* Upgrade to client version 3.0.3 (build 9183).
|
||||
|
||||
Version 0.12
|
||||
* Migrate from SVN to GIT.
|
||||
* Implemented arena system.
|
||||
* Start using Adaptive Communication Environment (ACE) framework v.5.6.6 in server network code.
|
||||
* Update Visual Leak Detector lib to Version 1.9g (beta).
|
||||
* Upgrade to client version 2.4.3 (build 8606).
|
||||
|
||||
Version 0.11
|
||||
|
|
|
|||
3
THANKS
3
THANKS
|
|
@ -21,6 +21,9 @@ similar to this one:
|
|||
community with a great server. We have not gained too much help from them,
|
||||
but we have recieved some.
|
||||
|
||||
Thanks to WCell team (especially Ralek) for reseach on realm reconnect sequence,
|
||||
item scaling stats algorithm, gameobject rotation issues.
|
||||
|
||||
The easiest policy with this file is to thank everyone who contributes to the
|
||||
project, without judging the value of the contribution.
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
## Prelude, basic settings for Autoconf
|
||||
# PACKAGE: mangos
|
||||
# VERSION: 0.12.0 (trunk)
|
||||
# VERSION: 0.13.0 (trunk)
|
||||
# BUG-REPORT-ADDRESS: mangos-devs@lists.sourceforge.net
|
||||
AC_INIT( [mangos], [0.12.0], [mangos-devs@lists.sourceforge.net])
|
||||
AC_INIT( [mangos], [0.13.0], [mangos-devs@lists.sourceforge.net])
|
||||
AC_CONFIG_SRCDIR([src/shared/Base.cpp])
|
||||
|
||||
## Prelude, basic settings for Automake
|
||||
|
|
|
|||
|
|
@ -16,21 +16,24 @@
|
|||
extern unsigned int iRes;
|
||||
extern ArchiveSet gOpenArchives;
|
||||
|
||||
bool ConvertADT(char*,char*);
|
||||
bool ConvertADT(char*, char*);
|
||||
|
||||
typedef struct{
|
||||
typedef struct
|
||||
{
|
||||
char name[64];
|
||||
unsigned int id;
|
||||
}map_id;
|
||||
uint32 id;
|
||||
} map_id;
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned int uint32;
|
||||
|
||||
map_id * map_ids;
|
||||
uint16 * areas;
|
||||
char output_path[128]=".";
|
||||
char input_path[128]=".";
|
||||
map_id *map_ids;
|
||||
uint16 *areas;
|
||||
uint16 *LiqType;
|
||||
char output_path[128] = ".";
|
||||
char input_path[128] = ".";
|
||||
uint32 maxAreaId = 0;
|
||||
|
||||
enum Extract
|
||||
{
|
||||
|
|
@ -66,46 +69,45 @@ bool FileExists( const char* FileName )
|
|||
|
||||
void Usage(char* prg)
|
||||
{
|
||||
printf("Usage:\n%s -[var] [value]\n-i set input path\n-o set output path\n-r set resolution\n-e extract only MAP(1)/DBC(2) - standard: both(3)\nExample: %s -r 256 -i \"c:\\games\\game\"",
|
||||
prg,prg);
|
||||
printf("Usage:\n%s -[var] [value]\n-i set input path\n-o set output path\n-r set resolution\n-e extract only MAP(1)/DBC(2) - standard: both(3)\nExample: %s -r 256 -i \"c:\\games\\game\"", prg, prg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void HandleArgs(int argc, char * arg[])
|
||||
{
|
||||
for(int c=1;c<argc;c++)
|
||||
for(int c = 1; c < argc; ++c)
|
||||
{
|
||||
//i - input path
|
||||
//o - output path
|
||||
//r - resolution, array of (r * r) heights will be created
|
||||
//e - extract only MAP(1)/DBC(2) - standard both(3)
|
||||
// i - input path
|
||||
// o - output path
|
||||
// r - resolution, array of (r * r) heights will be created
|
||||
// e - extract only MAP(1)/DBC(2) - standard both(3)
|
||||
if(arg[c][0] != '-')
|
||||
Usage(arg[0]);
|
||||
|
||||
switch(arg[c][1])
|
||||
{
|
||||
case 'i':
|
||||
if(c+1<argc)//all ok
|
||||
strcpy(input_path,arg[(c++) +1]);
|
||||
if(c + 1 < argc) // all ok
|
||||
strcpy(input_path, arg[(c++) + 1]);
|
||||
else
|
||||
Usage(arg[0]);
|
||||
break;
|
||||
case 'o':
|
||||
if(c+1<argc)//all ok
|
||||
strcpy(output_path,arg[(c++) +1]);
|
||||
if(c + 1 < argc) // all ok
|
||||
strcpy(output_path, arg[(c++) + 1]);
|
||||
else
|
||||
Usage(arg[0]);
|
||||
break;
|
||||
case 'r':
|
||||
if(c+1<argc)//all ok
|
||||
iRes=atoi(arg[(c++) +1]);
|
||||
if(c + 1 < argc) // all ok
|
||||
iRes=atoi(arg[(c++) + 1]);
|
||||
else
|
||||
Usage(arg[0]);
|
||||
break;
|
||||
case 'e':
|
||||
if(c+1<argc)//all ok
|
||||
if(c + 1 < argc) // all ok
|
||||
{
|
||||
extract=atoi(arg[(c++) +1]);
|
||||
extract=atoi(arg[(c++) + 1]);
|
||||
if(!(extract > 0 && extract < 4))
|
||||
Usage(arg[0]);
|
||||
}
|
||||
|
|
@ -122,12 +124,12 @@ uint32 ReadMapDBC()
|
|||
DBCFile dbc("DBFilesClient\\Map.dbc");
|
||||
dbc.open();
|
||||
|
||||
uint32 map_count=dbc.getRecordCount();
|
||||
map_ids=new map_id[map_count];
|
||||
for(unsigned int x=0;x<map_count;x++)
|
||||
size_t map_count = dbc.getRecordCount();
|
||||
map_ids = new map_id[map_count];
|
||||
for(uint32 x = 0; x < map_count; ++x)
|
||||
{
|
||||
map_ids[x].id=dbc.getRecord(x).getUInt(0);
|
||||
strcpy(map_ids[x].name,dbc.getRecord(x).getString(1));
|
||||
map_ids[x].id = dbc.getRecord(x).getUInt(0);
|
||||
strcpy(map_ids[x].name, dbc.getRecord(x).getString(1));
|
||||
}
|
||||
printf("Done! (%u maps loaded)\n", map_count);
|
||||
return map_count;
|
||||
|
|
@ -135,20 +137,39 @@ uint32 ReadMapDBC()
|
|||
|
||||
void ReadAreaTableDBC()
|
||||
{
|
||||
printf("Read AreaTable.dbc file... ");
|
||||
printf("Read AreaTable.dbc file...");
|
||||
DBCFile dbc("DBFilesClient\\AreaTable.dbc");
|
||||
dbc.open();
|
||||
|
||||
unsigned int area_count=dbc.getRecordCount();
|
||||
uint32 maxid = dbc.getMaxId();
|
||||
areas=new uint16[maxid + 1];
|
||||
memset(areas, 0xff, sizeof(areas));
|
||||
for(unsigned int x=0; x<area_count;++x)
|
||||
size_t area_count = dbc.getRecordCount();
|
||||
size_t maxid = dbc.getMaxId();
|
||||
areas = new uint16[maxid + 1];
|
||||
memset(areas, 0xff, (maxid + 1) * sizeof(uint16));
|
||||
|
||||
for(uint32 x = 0; x < area_count; ++x)
|
||||
areas[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3);
|
||||
|
||||
maxAreaId = dbc.getMaxId();
|
||||
|
||||
printf("Done! (%u areas loaded)\n", area_count);
|
||||
}
|
||||
|
||||
void ReadLiquidTypeTableDBC()
|
||||
{
|
||||
printf("Read LiquidType.dbc file...");
|
||||
DBCFile dbc("DBFilesClient\\LiquidType.dbc");
|
||||
dbc.open();
|
||||
size_t LiqType_count = dbc.getRecordCount();
|
||||
size_t LiqType_maxid = dbc.getMaxId();
|
||||
LiqType = new uint16[LiqType_maxid + 1];
|
||||
memset(LiqType, 0xff, (LiqType_maxid + 1) * sizeof(uint16));
|
||||
|
||||
for(uint32 x = 0; x < LiqType_count; ++x)
|
||||
LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3);
|
||||
|
||||
printf("Done! (%u LiqTypes loaded)\n", LiqType_count);
|
||||
}
|
||||
|
||||
void ExtractMapsFromMpq()
|
||||
{
|
||||
char mpq_filename[1024];
|
||||
|
|
@ -159,27 +180,28 @@ void ExtractMapsFromMpq()
|
|||
uint32 map_count = ReadMapDBC();
|
||||
|
||||
ReadAreaTableDBC();
|
||||
ReadLiquidTypeTableDBC();
|
||||
|
||||
unsigned int total=map_count*ADT_RES*ADT_RES;
|
||||
unsigned int done=0;
|
||||
unsigned int total = map_count * ADT_RES * ADT_RES;
|
||||
unsigned int done = 0;
|
||||
|
||||
std::string path = output_path;
|
||||
path += "/maps/";
|
||||
CreateDir(path);
|
||||
|
||||
for(unsigned int x = 0; x < ADT_RES; ++x)
|
||||
for(uint32 x = 0; x < ADT_RES; ++x)
|
||||
{
|
||||
for(unsigned int y = 0; y < ADT_RES; ++y)
|
||||
for(uint32 y = 0; y < ADT_RES; ++y)
|
||||
{
|
||||
for(unsigned int z = 0; z < map_count; ++z)
|
||||
for(uint32 z = 0; z < map_count; ++z)
|
||||
{
|
||||
sprintf(mpq_filename,"World\\Maps\\%s\\%s_%u_%u.adt",map_ids[z].name,map_ids[z].name,x,y);
|
||||
sprintf(output_filename,"%s/maps/%03u%02u%02u.map",output_path,map_ids[z].id,y,x);
|
||||
ConvertADT(mpq_filename,output_filename);
|
||||
sprintf(mpq_filename, "World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y);
|
||||
sprintf(output_filename, "%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x);
|
||||
ConvertADT(mpq_filename, output_filename);
|
||||
done++;
|
||||
}
|
||||
//draw progess bar
|
||||
printf("Processing........................%d%%\r",(100*done)/total);
|
||||
// draw progress bar
|
||||
printf("Processing........................%d%%\r", (100 * done) / total);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +244,7 @@ void ExtractDBCFiles(int locale, bool basicLocale)
|
|||
string filename = path;
|
||||
filename += (iter->c_str() + strlen("DBFilesClient\\"));
|
||||
|
||||
FILE *output=fopen(filename.c_str(), "wb");
|
||||
FILE *output = fopen(filename.c_str(), "wb");
|
||||
if(!output)
|
||||
{
|
||||
printf("Can't create the output file '%s'\n", filename.c_str());
|
||||
|
|
@ -261,7 +283,9 @@ void LoadCommonMPQFiles()
|
|||
{
|
||||
char filename[512];
|
||||
|
||||
sprintf(filename,"%s/Data/common.MPQ", input_path);
|
||||
sprintf(filename,"%s/Data/common-2.MPQ", input_path);
|
||||
new MPQArchive(filename);
|
||||
sprintf(filename,"%s/Data/lichking.MPQ", input_path);
|
||||
new MPQArchive(filename);
|
||||
sprintf(filename,"%s/Data/expansion.MPQ", input_path);
|
||||
new MPQArchive(filename);
|
||||
|
|
@ -272,7 +296,7 @@ void LoadCommonMPQFiles()
|
|||
if(i > 1)
|
||||
sprintf(ext, "-%i", i);
|
||||
|
||||
sprintf(filename,"%s/Data/patch%s.MPQ", input_path, ext);
|
||||
sprintf(filename, "%s/Data/patch%s.MPQ", input_path, ext);
|
||||
if(FileExists(filename))
|
||||
new MPQArchive(filename);
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -15,16 +15,15 @@
|
|||
#include "adt.h"
|
||||
#include "mpq_libmpq.h"
|
||||
|
||||
//#include <windows.h>
|
||||
unsigned int iRes=256;
|
||||
extern uint16*areas;
|
||||
uint32 iRes = 256;
|
||||
extern uint16 *areas;
|
||||
extern uint16 *LiqType;
|
||||
extern uint32 maxAreaId;
|
||||
|
||||
vec wmoc;
|
||||
|
||||
Cell * cell;
|
||||
uint32 wmo_count;
|
||||
Cell *cell;
|
||||
mcell *mcells;
|
||||
|
||||
int holetab_h[4] = {0x1111, 0x2222, 0x4444, 0x8888};
|
||||
int holetab_v[4] = {0x000F, 0x00F0, 0x0F00, 0xF000};
|
||||
|
||||
|
|
@ -35,168 +34,154 @@ bool LoadADT(char* filename)
|
|||
|
||||
if(mf.isEof())
|
||||
{
|
||||
//printf("No such file.\n");
|
||||
//printf("No such file %s\n", filename);
|
||||
return false;
|
||||
}
|
||||
mcells=new mcell;
|
||||
|
||||
wmoc.x =65*TILESIZE;
|
||||
wmoc.z =65*TILESIZE;
|
||||
MapLiqFlag = new uint8[256];
|
||||
for(uint32 j = 0; j < 256; ++j)
|
||||
MapLiqFlag[j] = 0; // no water
|
||||
|
||||
MapLiqHeight = new float[16384];
|
||||
for(uint32 j = 0; j < 16384; ++j)
|
||||
MapLiqHeight[j] = -999999; // no water
|
||||
|
||||
mcells = new mcell;
|
||||
|
||||
wmoc.x = 65 * TILESIZE;
|
||||
wmoc.z = 65 * TILESIZE;
|
||||
|
||||
size_t mcnk_offsets[256], mcnk_sizes[256];
|
||||
|
||||
wmo_count=0;
|
||||
bool found=false;
|
||||
//uint32 fs=mf.getSize()-3;
|
||||
//while (mf.getPos()<fs)
|
||||
chunk_num = 0;
|
||||
k = 0;
|
||||
m = 0;
|
||||
while (!mf.isEof())
|
||||
{
|
||||
uint32 fourcc;
|
||||
mf.read(&fourcc,4);
|
||||
mf.read(&fourcc, 4);
|
||||
mf.read(&size, 4);
|
||||
|
||||
size_t nextpos = mf.getPos() + size;
|
||||
switch(fourcc)
|
||||
{
|
||||
case 0x4d43494e: // MCIN
|
||||
{
|
||||
//printf("Found chunks info\n");
|
||||
// mapchunk offsets/sizes
|
||||
for (int i=0; i<256; i++)
|
||||
{
|
||||
mf.read(&mcnk_offsets[i],4);
|
||||
mf.read(&mcnk_sizes[i],4);
|
||||
mf.seekRelative(8);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x4d4f4446: // MODF
|
||||
{
|
||||
/*
|
||||
if(size)
|
||||
{
|
||||
//printf("\nwmo count %d\n",size/64);
|
||||
wmo_count =size/64;
|
||||
for (int i=0; i<wmo_count; i++)
|
||||
{
|
||||
int id;
|
||||
mf.read(&id, 4);
|
||||
WMO *wmo = (WMO*)wmomanager.items[wmomanager.get(wmos[id])];
|
||||
WMOInstance inst(wmo, mf);
|
||||
wmois.push_back(inst);
|
||||
}
|
||||
}*/
|
||||
break;
|
||||
}
|
||||
case 0x4d574d4f: // MWMO
|
||||
{
|
||||
/*
|
||||
if (size)
|
||||
{
|
||||
char *buf = new char[size];
|
||||
mf.read(buf, size);
|
||||
char *p=buf;
|
||||
while (p<buf+size)
|
||||
{
|
||||
std::string path(p);
|
||||
p+=strlen(p)+1;
|
||||
fixname(path);
|
||||
|
||||
wmomanager.add(path);
|
||||
wmos.push_back(path);
|
||||
}
|
||||
delete[] buf;
|
||||
}*/
|
||||
break;
|
||||
}
|
||||
case 0x4d564552: // MVER
|
||||
case 0x4d484452: // MHDR header
|
||||
case 0x4d434e4b: // MCNK
|
||||
case 0x4d544558: // MTEX textures (strings)
|
||||
case 0x4d4d4458: // MMDX m2 models (strings)
|
||||
case 0x4d4d4944: // MMID offsets for strings in MMDX
|
||||
case 0x4d574944: // MWID offsets for strings in MWMO
|
||||
case 0x4d444446: // MDDF
|
||||
case 0x4d46424f: // MFBO new in BC
|
||||
case 0x4d48324f: // MH2O new in WotLK
|
||||
case 0x4D545846: // MTXF new in WotLK
|
||||
break;
|
||||
default:
|
||||
//if(fourcc==0x4d484452) // MHDR header
|
||||
//if(fourcc==0x4d564552) // MVER
|
||||
if(fourcc == 0x4d43494e) // MCIN
|
||||
{
|
||||
for (uint32 i = 0; i < 256; ++i)
|
||||
{
|
||||
// mf.seekRelative(-3);
|
||||
printf("Unhandled map chunk: %u\n",fourcc);
|
||||
break;
|
||||
mf.read(&mcnk_offsets[i], 4);
|
||||
mf.read(&mcnk_sizes[i], 4);
|
||||
mf.seekRelative(8);
|
||||
}
|
||||
}
|
||||
//if(fourcc == 0x4d544558) // MTEX textures (strings)
|
||||
//if(fourcc == 0x4d4d4458) // MMDX m2 models (strings)
|
||||
//if(fourcc == 0x4d4d4944) // MMID offsets for strings in MMDX
|
||||
//if(fourcc == 0x4d574d4f) // MWMO
|
||||
//if(fourcc == 0x4d574944) // MWID offsets for strings in MWMO
|
||||
//if(fourcc == 0x4d444446) // MDDF
|
||||
//if(fourcc == 0x4d4f4446) // MODF
|
||||
if(fourcc == 0x4d48324f) // MH2O new in WotLK
|
||||
{
|
||||
// çäåñü íàäî çàïîìíèòü áàçîâóþ ïîçèöèþ â ôàéëå òê âñå ñìåùåíèÿ áóäóò îò íåãî
|
||||
uint32 base_pos = mf.getPos();
|
||||
uint32 header_pos = 0;
|
||||
MH2O_offsData *LiqOffsData = new MH2O_offsData;
|
||||
MH2O_Data1 *LiqChunkData1 = new MH2O_Data1;
|
||||
float *ChunkLiqHeight = new float[81];
|
||||
for(chunk_num = 0; chunk_num < 256; ++chunk_num)
|
||||
{
|
||||
mf.read(LiqOffsData, 0x0C);
|
||||
header_pos = mf.getPos();
|
||||
if(LiqOffsData->offsData1 != 0) // åñëè äàííûå â Data1 î âîäå åñòü, òî èõ íàäî êîíâåðòèðîâàòü
|
||||
{
|
||||
// ïåðåõîäèì ïî ñìåùåíèþ èç offsData1 ÎÒ ÍÀ×ÀËÀ êóñêà
|
||||
mf.seek(base_pos + LiqOffsData->offsData1);
|
||||
mf.read(LiqChunkData1, 0x18); // ñ÷èòûâàåì ñàìè äàííûå â ñòðóêòóðó òèïà MH2O_Data1
|
||||
// çàíîñèì äàííûå ôëàãà äëÿ êóñêà
|
||||
if(LiqType[LiqChunkData1->LiquidTypeId] == 0xffff)
|
||||
printf("\nCan't find Liquid type for map %s\nchunk %d\n", filename, chunk_num);
|
||||
else if(LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_WATER || LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_OCEAN)
|
||||
MapLiqFlag[chunk_num] |= 1; // water/ocean
|
||||
else if(LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_MAGMA || LiqType[LiqChunkData1->LiquidTypeId] == LIQUID_TYPE_SLIME)
|
||||
MapLiqFlag[chunk_num] |= 2; // magma/slime
|
||||
// ïðåäâàðèòåëüíî çàïîëíÿåì âåñü êóñîê äàííûìè - íåò âîäû
|
||||
for(int j = 0; j < 81; ++j)
|
||||
{
|
||||
ChunkLiqHeight[j] = -999999; // no liquid/water
|
||||
}
|
||||
// òåïåðü âû÷èñëÿåì òå ÷òî ñ âîäîé è ïåðåçàïèñûâàåì èõ â êóñêå
|
||||
for(int b = 0; b <= LiqChunkData1->height; ++b)
|
||||
{
|
||||
for(int c = LiqChunkData1->xOffset; c <= (LiqChunkData1->xOffset + LiqChunkData1->width); ++c)
|
||||
{
|
||||
int n = (9 * (LiqChunkData1->yOffset + b)) + c;
|
||||
ChunkLiqHeight[n] = LiqChunkData1->heightLevel1;
|
||||
}
|
||||
}
|
||||
mf.seek(header_pos); // è íå çàáûòü âåðíóòüñÿ íà èñõîäíóþ ïîçèöèþ èìåííî Â ÕÈÄÅÐÅ
|
||||
}
|
||||
else // åñëè äàííûõ â Data1 íåò, òî íàäî çàïîëíèòü âåñü êóñîê, íî äàííûìè - íåò âîäû
|
||||
{
|
||||
for(int j = 0; j < 81; ++j)
|
||||
ChunkLiqHeight[j] = -999999; // no liquid/water
|
||||
}
|
||||
|
||||
if(!(chunk_num % 16))
|
||||
m = 1024 * (chunk_num / 16); // ñìåùåíèå ïî ðÿäàì êóñêîâ ñ ïåðåêðûòèåì = 1024
|
||||
k = m + (chunk_num % 16) * 8; // óñòàíàâëèâàåìñÿ íà íà÷àëüíûé èíäåêñ äëÿ çàïîëíåíèÿ ðÿäà
|
||||
// çàíîñèì äàííûå êóñêà â ìàññèâ äëÿ êàðòû, ñ ïåðåêðûòèåì è îáðåçàíèåì êóñêîâ òê äàííûõ 81
|
||||
// ýòî àíàëîã ñòàðîãî îáðåçàíèÿ ãðàíè÷íûõ ïðàâûõ-áîêîâûõ è íèæíèõ äàííûõ
|
||||
for(int p = 0; p < 72; p += 9) // íèæíèå 8 íå çàíîñèì òê îíè äóáëèðóåòñÿ ñëåä êóñêîì
|
||||
{
|
||||
for(int s = 0; s < 8; ++s) // 9 çíà÷åíèå â ñòðîêå íå çàíîñèì òê îíî äóáëèðóåòñÿ ñëåä êóñêîì, à â ïðàâûõ-áîêîâûõ îáðåçàåòñÿ äëÿ 128õ128
|
||||
{
|
||||
MapLiqHeight[k] = ChunkLiqHeight[p + s];
|
||||
++k;
|
||||
}
|
||||
k = k + 120;
|
||||
}
|
||||
}
|
||||
delete LiqOffsData;
|
||||
delete LiqChunkData1;
|
||||
delete []ChunkLiqHeight;
|
||||
|
||||
}
|
||||
//case 0x4d434e4b: // MCNK
|
||||
//case 0x4d46424f: // MFBO new in BC
|
||||
//case 0x4d545846: // MTXF new in WotLK
|
||||
mf.seek(nextpos);
|
||||
}
|
||||
|
||||
//printf("Loading chunks info\n");
|
||||
// read individual map chunks
|
||||
for (int j=0; j<16; j++)
|
||||
for (int i=0; i<16; i++)
|
||||
{
|
||||
mf.seek((int)mcnk_offsets[j*16+i]);
|
||||
LoadMapChunk(mf,&(mcells->ch[i][j]));
|
||||
}
|
||||
|
||||
/*
|
||||
for(uint32 t=0;t<wmo_count ;t++)
|
||||
chunk_num = 0;
|
||||
k = 0;
|
||||
m = 0;
|
||||
for (int j = 0; j < 16; ++j)
|
||||
{
|
||||
wmois[t].draw();
|
||||
}*/
|
||||
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
mf.seek((int)mcnk_offsets[j * 16 + i]);
|
||||
LoadMapChunk(mf, &(mcells->ch[i][j]));
|
||||
++chunk_num;
|
||||
}
|
||||
}
|
||||
mf.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
struct MapChunkHeader {
|
||||
uint32 flags;
|
||||
uint32 ix;
|
||||
uint32 iy;
|
||||
uint32 nLayers;
|
||||
uint32 nDoodadRefs;
|
||||
uint32 ofsHeight;
|
||||
uint32 ofsNormal;
|
||||
uint32 ofsLayer;
|
||||
uint32 ofsRefs;
|
||||
uint32 ofsAlpha;
|
||||
uint32 sizeAlpha;
|
||||
uint32 ofsShadow;
|
||||
uint32 sizeShadow;
|
||||
uint32 areaid;
|
||||
uint32 nMapObjRefs;
|
||||
uint32 holes;
|
||||
uint16 s1;
|
||||
uint16 s2;
|
||||
uint32 d1;
|
||||
uint32 d2;
|
||||
uint32 d3;
|
||||
uint32 predTex;
|
||||
uint32 nEffectDoodad;
|
||||
uint32 ofsSndEmitters;
|
||||
uint32 nSndEmitters;
|
||||
uint32 ofsLiquid;
|
||||
uint32 sizeLiquid;
|
||||
float zpos;
|
||||
float xpos;
|
||||
float ypos;
|
||||
uint32 textureId;
|
||||
uint32 props;
|
||||
uint32 effectId;
|
||||
};
|
||||
|
||||
bool isHole(int holes, int i, int j)
|
||||
{
|
||||
int testi = i/2;
|
||||
int testj = j/4;
|
||||
if(testi>3) testi = 3;
|
||||
if(testj>3) testj = 3;
|
||||
return (holes & holetab_h[testi] & holetab_v[testj])!=0;
|
||||
int testi = i / 2;
|
||||
int testj = j / 4;
|
||||
if(testi > 3) testi = 3;
|
||||
if(testj > 3) testj = 3;
|
||||
return (holes & holetab_h[testi] & holetab_v[testj]) != 0;
|
||||
}
|
||||
|
||||
inline
|
||||
void LoadMapChunk(MPQFile & mf, chunk*_chunk)
|
||||
inline void LoadMapChunk(MPQFile &mf, chunk *_chunk)
|
||||
{
|
||||
float h;
|
||||
uint32 fourcc;
|
||||
|
|
@ -207,294 +192,262 @@ void LoadMapChunk(MPQFile & mf, chunk*_chunk)
|
|||
mf.read(&size, 4);
|
||||
|
||||
size_t lastpos = mf.getPos() + size;
|
||||
mf.read(&header, 0x80);
|
||||
_chunk->area_id =header.areaid ;
|
||||
_chunk->flag =0;
|
||||
mf.read(&header, 0x80); // what if header size got changed?
|
||||
_chunk->area_id = header.areaid;
|
||||
|
||||
float xbase = header.xpos;
|
||||
float ybase = header.ypos;
|
||||
float zbase = header.zpos;
|
||||
zbase = TILESIZE*32-zbase;
|
||||
xbase = TILESIZE*32-xbase;
|
||||
if(wmoc.x >xbase)wmoc.x =xbase;
|
||||
if(wmoc.z >zbase)wmoc.z =zbase;
|
||||
zbase = TILESIZE * 32 - zbase;
|
||||
xbase = TILESIZE * 32 - xbase;
|
||||
if(wmoc.x > xbase) wmoc.x = xbase;
|
||||
if(wmoc.z > zbase) wmoc.z = zbase;
|
||||
int chunkflags = header.flags;
|
||||
float zmin=999999999.0f;
|
||||
float zmax=-999999999.0f;
|
||||
//must be there, bl!zz uses some crazy format
|
||||
int nTextures;
|
||||
//printf("LMC: flags %X\n", chunkflags);
|
||||
float zmin = 999999999.0f;
|
||||
float zmax = -999999999.0f;
|
||||
// must be there, bl!zz uses some crazy format
|
||||
while (mf.getPos() < lastpos)
|
||||
{
|
||||
mf.read(&fourcc,4);
|
||||
mf.read(&fourcc, 4);
|
||||
mf.read(&size, 4);
|
||||
//if(size!=580)
|
||||
// printf("\n sz=%d",size);
|
||||
size_t nextpos = mf.getPos() + size;
|
||||
if(fourcc==0x4d435654) // MCVT
|
||||
size_t nextpos = mf.getPos() + size;
|
||||
if(fourcc == 0x4d435654) // MCVT
|
||||
{
|
||||
for (int j=0; j<17; j++)
|
||||
for (int i=0; i<((j%2)?8:9); i++)
|
||||
for (int j = 0; j < 17; ++j)
|
||||
{
|
||||
for (int i = 0; i < ((j % 2) ? 8 : 9); ++i)
|
||||
{
|
||||
mf.read(&h,4);
|
||||
float z=h+ybase;
|
||||
if (j%2)
|
||||
mf.read(&h, 4);
|
||||
float z = h + ybase;
|
||||
if (j % 2)
|
||||
{
|
||||
if(isHole(header.holes,i,j))
|
||||
_chunk->v8[i][j/2] = -1000;
|
||||
if(isHole(header.holes, i, j))
|
||||
_chunk->v8[i][j / 2] = -1000;
|
||||
else
|
||||
_chunk->v8[i][j/2] = z;
|
||||
_chunk->v8[i][j / 2] = z;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isHole(header.holes,i,j))
|
||||
_chunk->v9[i][j/2] = -1000;
|
||||
if(isHole(header.holes, i, j))
|
||||
_chunk->v9[i][j / 2] = -1000;
|
||||
else
|
||||
_chunk->v9[i][j/2] = z;
|
||||
_chunk->v9[i][j / 2] = z;
|
||||
}
|
||||
|
||||
if(z>zmax)zmax=z;
|
||||
//if(z<zmin)zmin=z;
|
||||
if(z > zmax) zmax = z;
|
||||
//if(z < zmin) zmin = z;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(fourcc==0x4d434e52) // MCNR
|
||||
else if(fourcc == 0x4d434e52) // MCNR
|
||||
{
|
||||
nextpos = mf.getPos() + 0x1C0; // size fix
|
||||
nextpos = mf.getPos() + 0x1C0; // size fix
|
||||
}
|
||||
else if(fourcc==0x4d434c51) // MCLQ
|
||||
else if(fourcc == 0x4d434c51) // íå áóäåì ó÷èòûâàòü åñëè óæå áûëè äàííûå â MH2O, ïåðåñòðàõîâêà :) // MCLQ
|
||||
{
|
||||
// liquid / water level
|
||||
//bool haswater;
|
||||
char fcc1[5];
|
||||
mf.read(fcc1,4);
|
||||
mf.read(fcc1, 4);
|
||||
flipcc(fcc1);
|
||||
fcc1[4]=0;
|
||||
fcc1[4] = 0;
|
||||
float *ChunkLiqHeight = new float[81];
|
||||
|
||||
if (!strcmp(fcc1,"MCSE"))
|
||||
if (!strcmp(fcc1, "MCSE"))
|
||||
{
|
||||
for(int i=0;i<9;i++)
|
||||
for(int j=0;j<9;j++)
|
||||
_chunk->waterlevel[i][j]=-999999; // no liquid/water
|
||||
for(int j = 0; j < 81; ++j)
|
||||
{
|
||||
ChunkLiqHeight[j] = -999999; // no liquid/water
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float maxheight;
|
||||
mf.read(&maxheight, 4);
|
||||
for(int j = 0; j < 81; ++j)
|
||||
{
|
||||
LiqData liq;
|
||||
mf.read(&liq, 8);
|
||||
|
||||
for(int j=0;j<9;j++)
|
||||
for(int i=0;i<9;i++)
|
||||
{
|
||||
mf.read(&h, 4);
|
||||
mf.read(&h, 4);
|
||||
if(h > maxheight)
|
||||
_chunk->waterlevel[i][j]=-999999;
|
||||
else
|
||||
_chunk->waterlevel[i][j]=h;
|
||||
}
|
||||
if(liq.height > maxheight)
|
||||
ChunkLiqHeight[j] = -999999;
|
||||
else
|
||||
ChunkLiqHeight[j] = h;
|
||||
}
|
||||
|
||||
if(chunkflags & 4 || chunkflags & 8)
|
||||
_chunk->flag |=1;
|
||||
MapLiqFlag[chunk_num] |= 1; // water
|
||||
if(chunkflags & 16)
|
||||
_chunk->flag |=2;
|
||||
MapLiqFlag[chunk_num] |= 2; // magma/slime
|
||||
}
|
||||
// çàïîëíåì òàê æå êàê â MH2O
|
||||
if(!(chunk_num % 16))
|
||||
m = 1024 * (chunk_num / 16);
|
||||
k = m + (chunk_num % 16) * 8;
|
||||
|
||||
for(int p = 0; p < 72; p += 9)
|
||||
{
|
||||
for(int s = 0; s < 8; ++s)
|
||||
{
|
||||
MapLiqHeight[k] = ChunkLiqHeight[p + s];
|
||||
++k;
|
||||
}
|
||||
k = k + 120;
|
||||
}
|
||||
delete []ChunkLiqHeight;
|
||||
break;
|
||||
}
|
||||
else if (fourcc==0x4d434c59) // MCLY
|
||||
{
|
||||
// texture info
|
||||
nTextures = (int)size;
|
||||
}
|
||||
else if (fourcc==0x4d43414c) // MCAL
|
||||
{
|
||||
if (nTextures<=0)
|
||||
continue;
|
||||
}
|
||||
|
||||
mf.seek(nextpos);
|
||||
}
|
||||
}
|
||||
|
||||
double solve (vec *v,vec *p)
|
||||
{
|
||||
double a = v[0].y *(v[1].z - v[2].z) + v[1].y *(v[2].z - v[0].z) + v[2].y *(v[0].z - v[1].z);
|
||||
double b = v[0].z *(v[1].x - v[2].x) + v[1].z *(v[2].x - v[0].x) + v[2].z *(v[0].x - v[1].x);
|
||||
double c = v[0].x *(v[1].y - v[2].y) + v[1].x *(v[2].y - v[0].y) + v[2].x *(v[0].y - v[1].y);
|
||||
double d = v[0].x *(v[1].y*v[2].z - v[2].y*v[1].z) + v[1].x* (v[2].y*v[0].z - v[0].y*v[2].z) + v[2].x* (v[0].y*v[1].z - v[1].y*v[0].z);
|
||||
//-d
|
||||
double a = v[0].y * (v[1].z - v[2].z) + v[1].y * (v[2].z - v[0].z) + v[2].y * (v[0].z - v[1].z);
|
||||
double b = v[0].z * (v[1].x - v[2].x) + v[1].z * (v[2].x - v[0].x) + v[2].z * (v[0].x - v[1].x);
|
||||
double c = v[0].x * (v[1].y - v[2].y) + v[1].x * (v[2].y - v[0].y) + v[2].x * (v[0].y - v[1].y);
|
||||
double d = v[0].x * (v[1].y * v[2].z - v[2].y * v[1].z) + v[1].x * (v[2].y * v[0].z - v[0].y * v[2].z) + v[2].x * (v[0].y * v[1].z - v[1].y * v[0].z);
|
||||
// -d
|
||||
|
||||
//plane equation ax+by+cz+d=0
|
||||
// plane equation ax+by+cz+d=0
|
||||
return ((a*p->x+c*p->z-d)/b);
|
||||
}
|
||||
|
||||
inline
|
||||
double GetZ(double x,double z)
|
||||
inline double GetZ(double x, double z)
|
||||
{
|
||||
vec v[3];
|
||||
vec p;
|
||||
|
||||
//bool inWMO=false;
|
||||
|
||||
//if(!inWMO)
|
||||
{
|
||||
//find out quadrant
|
||||
int xc=(int)(x/UNITSIZE);
|
||||
int zc=(int)(z/UNITSIZE);
|
||||
if(xc>127)xc=127;
|
||||
if(zc>127)zc=127;
|
||||
// find out quadrant
|
||||
int xc = (int)(x / UNITSIZE);
|
||||
int zc = (int)(z / UNITSIZE);
|
||||
if(xc > 127) xc = 127;
|
||||
if(zc > 127) zc = 127;
|
||||
|
||||
double lx=x-xc*UNITSIZE;
|
||||
double lz=z-zc*UNITSIZE;
|
||||
p.x=lx;
|
||||
p.z=lz;
|
||||
double lx = x - xc * UNITSIZE;
|
||||
double lz = z - zc * UNITSIZE;
|
||||
p.x = lx;
|
||||
p.z = lz;
|
||||
|
||||
v[0].x=UNITSIZE/2;
|
||||
v[0].y =cell->v8[xc][zc];
|
||||
v[0].z=UNITSIZE/2;
|
||||
v[0].x = UNITSIZE / 2;
|
||||
v[0].y = cell->v8[xc][zc];
|
||||
v[0].z = UNITSIZE / 2;
|
||||
|
||||
if(lx>lz)
|
||||
if(lx > lz)
|
||||
{
|
||||
v[1].x=UNITSIZE;
|
||||
v[1].y =cell->v9[xc+1][zc];
|
||||
v[1].z=0;
|
||||
v[1].x = UNITSIZE;
|
||||
v[1].y = cell->v9[xc + 1][zc];
|
||||
v[1].z = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
v[1].x=0.0;
|
||||
v[1].y =cell->v9[xc][zc+1];
|
||||
v[1].z=UNITSIZE;
|
||||
v[1].x = 0.0f;
|
||||
v[1].y = cell->v9[xc][zc + 1];
|
||||
v[1].z = UNITSIZE;
|
||||
}
|
||||
|
||||
if(lz>UNITSIZE-lx)
|
||||
if(lz > UNITSIZE - lx)
|
||||
{
|
||||
v[2].x=UNITSIZE;
|
||||
v[2].y =cell->v9[xc+1][zc+1];
|
||||
v[2].z=UNITSIZE;
|
||||
v[2].x = UNITSIZE;
|
||||
v[2].y = cell->v9[xc + 1][zc + 1];
|
||||
v[2].z = UNITSIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
v[2].x=0;
|
||||
v[2].y=cell->v9[xc][zc];
|
||||
v[2].z=0;
|
||||
v[2].x = 0.0f;
|
||||
v[2].y = cell->v9[xc][zc];
|
||||
v[2].z = 0.0f;
|
||||
}
|
||||
|
||||
return -solve(v,&p);
|
||||
return -solve(v, &p);
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
void TransformWaterData()
|
||||
inline void TransformData()
|
||||
{
|
||||
cell= new Cell;
|
||||
cell = new Cell;
|
||||
|
||||
for(int x=0;x<128;x++)
|
||||
for(int y=0;y<128;y++)
|
||||
cell->v9[x][y] = mcells->ch[x/8][y/8].waterlevel[x%8][y%8];
|
||||
|
||||
//and the last 1
|
||||
cell->v9[128][128] = mcells->ch[15][15].waterlevel[8][8];
|
||||
}
|
||||
|
||||
inline
|
||||
void TransformData()
|
||||
{
|
||||
cell= new Cell;
|
||||
|
||||
for(int x=0;x<128;x++)
|
||||
for(uint32 x = 0; x < 128; ++x)
|
||||
{
|
||||
for(int y=0;y<128;y++)
|
||||
for(uint32 y = 0; y < 128; ++y)
|
||||
{
|
||||
cell->v8[x][y] = (float)mcells->ch[x/8][y/8].v8[x%8][y%8];
|
||||
cell->v9[x][y] = (float)mcells->ch[x/8][y/8].v9[x%8][y%8];
|
||||
cell->v8[x][y] = (float)mcells->ch[x / 8][y / 8].v8[x % 8][y % 8];
|
||||
cell->v9[x][y] = (float)mcells->ch[x / 8][y / 8].v9[x % 8][y % 8];
|
||||
}
|
||||
|
||||
//extra 1 point on bounds
|
||||
cell->v9[x][128] = (float)mcells->ch[x/8][15].v9[x%8][8];
|
||||
//x==y
|
||||
cell->v9[128][x] = (float)mcells->ch[15][x/8].v9[8][x%8];
|
||||
// extra 1 point on bounds
|
||||
cell->v9[x][128] = (float)mcells->ch[x / 8][15].v9[x % 8][8];
|
||||
// x == y
|
||||
cell->v9[128][x] = (float)mcells->ch[15][x / 8].v9[8][x % 8];
|
||||
|
||||
}
|
||||
|
||||
//and the last 1
|
||||
// and the last 1
|
||||
cell->v9[128][128] = (float)mcells->ch[15][15].v9[8][8];
|
||||
|
||||
delete mcells;
|
||||
}
|
||||
|
||||
const char MAP_MAGIC[] = "MAP_2.00";
|
||||
const char MAP_MAGIC[] = "MAP_2.01";
|
||||
|
||||
bool ConvertADT(char * filename,char * filename2)
|
||||
bool ConvertADT(char *filename, char *filename2)
|
||||
{
|
||||
//if(!strstr(filename,"oth_32_48"))return false;
|
||||
if(!LoadADT(filename))
|
||||
return false;
|
||||
|
||||
FILE *output=fopen(filename2,"wb");
|
||||
FILE *output=fopen(filename2, "wb");
|
||||
if(!output)
|
||||
{
|
||||
printf("Can't create the output file '%s'\n",filename2);
|
||||
printf("Can't create the output file '%s'\n", filename2);
|
||||
delete [] MapLiqHeight;
|
||||
delete [] MapLiqFlag;
|
||||
return false;
|
||||
}
|
||||
|
||||
// write magic header
|
||||
fwrite(MAP_MAGIC,1,8,output);
|
||||
fwrite(MAP_MAGIC, 1, 8, output);
|
||||
|
||||
for(unsigned int x=0;x<16;x++)
|
||||
for(uint32 x = 0; x < 16; ++x)
|
||||
{
|
||||
for(unsigned int y=0;y<16;y++)
|
||||
for(uint32 y = 0; y < 16; ++y)
|
||||
{
|
||||
if(mcells->ch[y][x].area_id && mcells->ch[y][x].area_id < 0x102D)
|
||||
if(mcells->ch[y][x].area_id && mcells->ch[y][x].area_id <= maxAreaId)
|
||||
{
|
||||
if(areas[mcells->ch[y][x].area_id]==0xffff)
|
||||
printf("\nCan't find area flag for areaid %u.\n",mcells->ch[y][x].area_id);
|
||||
if(areas[mcells->ch[y][x].area_id] == 0xffff)
|
||||
printf("\nCan't find area flag for areaid %u.\n", mcells->ch[y][x].area_id);
|
||||
|
||||
fwrite(&areas[mcells->ch[y][x].area_id],1,2,output);
|
||||
fwrite(&areas[mcells->ch[y][x].area_id], 1, 2, output);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint16 flag=0xffff;
|
||||
fwrite(&flag,1,2,output);
|
||||
uint16 flag = 0xffff;
|
||||
fwrite(&flag, 1, 2, output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(unsigned int x=0;x<16;x++)
|
||||
for(unsigned int y=0;y<16;y++)
|
||||
fwrite(&mcells->ch[y][x].flag,1,1,output);
|
||||
fwrite(MapLiqFlag, 1, 256, output);
|
||||
delete [] MapLiqFlag;
|
||||
|
||||
TransformWaterData();
|
||||
fwrite(MapLiqHeight, sizeof(float), 16384, output);
|
||||
delete [] MapLiqHeight;
|
||||
|
||||
for(unsigned int x=0;x<128;x++)
|
||||
for(unsigned int y=0;y<128;y++)
|
||||
fwrite(&cell->v9[y][x],1,sizeof(float),output);
|
||||
|
||||
delete cell;
|
||||
TransformData();
|
||||
|
||||
for(unsigned int x=0;x<iRes;x++)
|
||||
for(unsigned int y=0;y<iRes;y++)
|
||||
for(uint32 x = 0; x < iRes; ++x)
|
||||
{
|
||||
float z=(float)GetZ(
|
||||
(((double)(y))*TILESIZE)/((double)(iRes-1)),
|
||||
(((double)(x))*TILESIZE)/((double)(iRes-1)));
|
||||
for(uint32 y = 0; y < iRes; ++y)
|
||||
{
|
||||
float z = (float)GetZ(
|
||||
(((double)(y)) * TILESIZE) / ((double)(iRes - 1)),
|
||||
(((double)(x)) * TILESIZE) / ((double)(iRes - 1)));
|
||||
|
||||
fwrite(&z,1,sizeof(z),output);
|
||||
fwrite(&z, 1, sizeof(z), output);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(output);
|
||||
delete cell;
|
||||
/*
|
||||
for (std::vector<std::string>::iterator it = wmos.begin(); it != wmos.end(); ++it)
|
||||
wmomanager.delbyname(*it);
|
||||
|
||||
wmos.clear();
|
||||
wmois.clear();
|
||||
|
||||
for (std::vector<model>::iterator it = wmomodel.begin(); it != wmomodel.end(); ++it)
|
||||
{
|
||||
it->tr.clear();
|
||||
|
||||
}
|
||||
//printf("\n %d \n",in);
|
||||
wmomodel.clear();
|
||||
//polygons.clear();*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,45 +9,120 @@ typedef unsigned char uint8;
|
|||
typedef unsigned short uint16;
|
||||
typedef unsigned int uint32;
|
||||
class Liquid;
|
||||
typedef struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
}svec;
|
||||
|
||||
typedef struct {
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
}vec;
|
||||
|
||||
typedef struct{
|
||||
vec v[3];
|
||||
}triangle;
|
||||
|
||||
typedef struct{
|
||||
float v9[16*8+1][16*8+1];
|
||||
float v8[16*8][16*8];
|
||||
}Cell;
|
||||
|
||||
typedef struct{
|
||||
double v9[9][9];
|
||||
double v8[8][8];
|
||||
uint16 area_id;
|
||||
//Liquid *lq;
|
||||
float waterlevel[9][9];
|
||||
uint8 flag;
|
||||
}chunk;
|
||||
|
||||
class WMO;
|
||||
class WMOManager;
|
||||
void fixname(std::string &name);
|
||||
typedef struct
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
} svec;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
chunk ch[16][16];
|
||||
}mcell;
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
} vec;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec v[3];
|
||||
} triangle;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float v9[16 * 8 + 1][16 * 8 + 1];
|
||||
float v8[16 * 8][16 * 8];
|
||||
} Cell;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
double v9[9][9];
|
||||
double v8[8][8];
|
||||
uint16 area_id;
|
||||
} chunk;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
chunk ch[16][16];
|
||||
} mcell;
|
||||
|
||||
struct MapChunkHeader
|
||||
{
|
||||
uint32 flags;
|
||||
uint32 ix;
|
||||
uint32 iy;
|
||||
uint32 nLayers;
|
||||
uint32 nDoodadRefs;
|
||||
uint32 ofsHeight;
|
||||
uint32 ofsNormal;
|
||||
uint32 ofsLayer;
|
||||
uint32 ofsRefs;
|
||||
uint32 ofsAlpha;
|
||||
uint32 sizeAlpha;
|
||||
uint32 ofsShadow;
|
||||
uint32 sizeShadow;
|
||||
uint32 areaid;
|
||||
uint32 nMapObjRefs;
|
||||
uint32 holes;
|
||||
uint16 s1;
|
||||
uint16 s2;
|
||||
uint32 d1;
|
||||
uint32 d2;
|
||||
uint32 d3;
|
||||
uint32 predTex;
|
||||
uint32 nEffectDoodad;
|
||||
uint32 ofsSndEmitters;
|
||||
uint32 nSndEmitters;
|
||||
uint32 ofsLiquid; // not use in WotLK
|
||||
uint32 sizeLiquid; // not use in WotLK
|
||||
float zpos;
|
||||
float xpos;
|
||||
float ypos;
|
||||
uint32 textureId; // new offsColorValues in WotLK
|
||||
uint32 props;
|
||||
uint32 effectId;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32 offsData1;
|
||||
uint32 used;
|
||||
uint32 offsData2;
|
||||
} MH2O_offsData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16 LiquidTypeId;
|
||||
uint16 type;
|
||||
float heightLevel1;
|
||||
float heightLevel2;
|
||||
uint8 xOffset;
|
||||
uint8 yOffset;
|
||||
uint8 width;
|
||||
uint8 height;
|
||||
uint32 ofsData2a;
|
||||
uint32 ofsData2b;
|
||||
} MH2O_Data1;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16 unk1;
|
||||
uint16 unk2;
|
||||
float height;
|
||||
} LiqData;
|
||||
|
||||
enum LiquidType
|
||||
{
|
||||
LIQUID_TYPE_WATER = 0,
|
||||
LIQUID_TYPE_OCEAN = 1,
|
||||
LIQUID_TYPE_MAGMA = 2,
|
||||
LIQUID_TYPE_SLIME = 3
|
||||
};
|
||||
|
||||
class MPQFile;
|
||||
void LoadMapChunk(MPQFile &,chunk*);
|
||||
bool LoadWMO(char* filename);
|
||||
|
||||
float *MapLiqHeight;
|
||||
uint8 *MapLiqFlag;
|
||||
uint32 k, m, chunk_num;
|
||||
void LoadMapChunk(MPQFile &, chunk*);
|
||||
#endif
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -1,11 +1,7 @@
|
|||
//#include "common.h"
|
||||
#include "model.h"
|
||||
//#include "world.h"
|
||||
#include <cassert>
|
||||
#include <algorithm>
|
||||
|
||||
//int globalTime = 0;
|
||||
|
||||
Model::Model(std::string &filename) : filename(filename)
|
||||
{
|
||||
}
|
||||
|
|
@ -24,121 +20,31 @@ bool Model::open()
|
|||
}
|
||||
|
||||
memcpy(&header, f.getBuffer(), sizeof(ModelHeader));
|
||||
if(header.nBoundingTriangles > 0) {
|
||||
|
||||
#if 0
|
||||
animated = isAnimated(f);
|
||||
if(animated)
|
||||
if(header.nBoundingTriangles > 0)
|
||||
{
|
||||
f.seek(0);
|
||||
f.seekRelative(header.ofsBoundingVertices);
|
||||
vertices = new Vec3D[header.nBoundingVertices];
|
||||
f.read(vertices,header.nBoundingVertices*12);
|
||||
for (uint32 i=0; i<header.nBoundingVertices; i++)
|
||||
{
|
||||
f.close();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
trans = 1.0f;
|
||||
origVertices = (ModelVertex*)(f.getBuffer() + header.ofsVertices);
|
||||
|
||||
vertices = new Vec3D[header.nVertices];
|
||||
normals = new Vec3D[header.nVertices];
|
||||
|
||||
for (size_t i=0; i<header.nVertices; i++)
|
||||
{
|
||||
origVertices[i].pos = fixCoordSystem(origVertices[i].pos);
|
||||
origVertices[i].normal = fixCoordSystem(origVertices[i].normal);
|
||||
vertices[i] = origVertices[i].pos;
|
||||
normals[i] = origVertices[i].normal.normalize();
|
||||
}
|
||||
|
||||
ModelView *view = (ModelView*)(f.getBuffer() + header.ofsViews);
|
||||
|
||||
uint16 *indexLookup = (uint16*)(f.getBuffer() + view->ofsIndex);
|
||||
uint16 *triangles = (uint16*)(f.getBuffer() + view->ofsTris);
|
||||
|
||||
nIndices = view->nTris;
|
||||
indices = new uint16[nIndices];
|
||||
for (size_t i = 0; i<nIndices; i++)
|
||||
{
|
||||
indices[i] = indexLookup[triangles[i]];
|
||||
vertices[i] = fixCoordSystem(vertices[i]);
|
||||
}
|
||||
f.seek(0);
|
||||
f.seekRelative(header.ofsBoundingTriangles);
|
||||
indices = new uint16[header.nBoundingTriangles];
|
||||
f.read(indices,header.nBoundingTriangles*2);
|
||||
f.close();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
//printf("not included %s\n", filename.c_str());
|
||||
f.close();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
bool Model::isAnimated(MPQFile &f)
|
||||
{
|
||||
// see if we have any animated bones
|
||||
ModelBoneDef *bo = (ModelBoneDef*)(f.getBuffer() + header.ofsBones);
|
||||
|
||||
animGeometry = false;
|
||||
animBones = false;
|
||||
ind = false;
|
||||
|
||||
ModelVertex *verts = (ModelVertex*)(f.getBuffer() + header.ofsVertices);
|
||||
for (size_t i=0; i<header.nVertices && !animGeometry; i++) {
|
||||
for (size_t b=0; b<4; b++) {
|
||||
if (verts[i].weights[b]>0) {
|
||||
ModelBoneDef &bb = bo[verts[i].bones[b]];
|
||||
if (bb.translation.type || bb.rotation.type || bb.scaling.type || (bb.flags&8)) {
|
||||
if (bb.flags&8) {
|
||||
// if we have billboarding, the model will need per-instance animation
|
||||
ind = true;
|
||||
}
|
||||
animGeometry = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (animGeometry) animBones = true;
|
||||
else {
|
||||
for (size_t i=0; i<header.nBones; i++) {
|
||||
ModelBoneDef &bb = bo[i];
|
||||
if (bb.translation.type || bb.rotation.type || bb.scaling.type) {
|
||||
animBones = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
animTextures = header.nTexAnims > 0;
|
||||
|
||||
bool animMisc = header.nCameras>0 || // why waste time, pretty much all models with cameras need animation
|
||||
header.nLights>0 || // same here
|
||||
header.nParticleEmitters>0 ||
|
||||
header.nRibbonEmitters>0;
|
||||
|
||||
if (animMisc) animBones = true;
|
||||
|
||||
// animated colors
|
||||
if (header.nColors) {
|
||||
ModelColorDef *cols = (ModelColorDef*)(f.getBuffer() + header.ofsColors);
|
||||
for (size_t i=0; i<header.nColors; i++) {
|
||||
if (cols[i].color.type!=0 || cols[i].opacity.type!=0) {
|
||||
animMisc = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// animated opacity
|
||||
if (header.nTransparency && !animMisc) {
|
||||
ModelTransDef *trs = (ModelTransDef*)(f.getBuffer() + header.ofsTransparency);
|
||||
for (size_t i=0; i<header.nTransparency; i++) {
|
||||
if (trs[i].trans.type!=0) {
|
||||
animMisc = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// guess not...
|
||||
return animGeometry || animTextures || animMisc;
|
||||
}
|
||||
|
||||
bool Model::ConvertToVMAPModel(char * outfilename)
|
||||
{
|
||||
|
|
@ -151,7 +57,8 @@ bool Model::ConvertToVMAPModel(char * outfilename)
|
|||
return false;
|
||||
}
|
||||
fwrite("VMAP002",8,1,output);
|
||||
int nVertices = header.nVertices;
|
||||
uint32 nVertices = 0;
|
||||
nVertices = header.nBoundingVertices;
|
||||
fwrite(&nVertices, sizeof(int), 1, output);
|
||||
uint32 nofgroups = 1;
|
||||
fwrite(&nofgroups,sizeof(uint32), 1, output);
|
||||
|
|
@ -162,15 +69,16 @@ bool Model::ConvertToVMAPModel(char * outfilename)
|
|||
wsize = sizeof(branches) + sizeof(uint32) * branches;
|
||||
fwrite(&wsize, sizeof(int), 1, output);
|
||||
fwrite(&branches,sizeof(branches), 1, output);
|
||||
uint32 nIdexes = (uint32) nIndices;
|
||||
fwrite(&nIndices,sizeof(uint32), 1, output);
|
||||
uint32 nIndexes = 0;
|
||||
nIndexes = header.nBoundingTriangles;
|
||||
fwrite(&nIndexes,sizeof(uint32), 1, output);
|
||||
fwrite("INDX",4, 1, output);
|
||||
wsize = sizeof(uint32) + sizeof(unsigned short) * nIdexes;
|
||||
wsize = sizeof(uint32) + sizeof(unsigned short) * nIndexes;
|
||||
fwrite(&wsize, sizeof(int), 1, output);
|
||||
fwrite(&nIdexes, sizeof(uint32), 1, output);
|
||||
if(nIdexes >0)
|
||||
fwrite(&nIndexes, sizeof(uint32), 1, output);
|
||||
if(nIndexes >0)
|
||||
{
|
||||
fwrite(indices, sizeof(unsigned short), nIdexes, output);
|
||||
fwrite(indices, sizeof(unsigned short), nIndexes, output);
|
||||
}
|
||||
fwrite("VERT",4, 1, output);
|
||||
wsize = sizeof(int) + sizeof(float) * 3 * nVertices;
|
||||
|
|
@ -178,7 +86,7 @@ bool Model::ConvertToVMAPModel(char * outfilename)
|
|||
fwrite(&nVertices, sizeof(int), 1, output);
|
||||
if(nVertices >0)
|
||||
{
|
||||
for(int vpos=0; vpos <nVertices; ++vpos)
|
||||
for(uint32 vpos=0; vpos <nVertices; ++vpos)
|
||||
{
|
||||
float sy = vertices[vpos].y;
|
||||
vertices[vpos].y = vertices[vpos].z;
|
||||
|
|
@ -189,7 +97,6 @@ bool Model::ConvertToVMAPModel(char * outfilename)
|
|||
|
||||
delete[] vertices;
|
||||
delete[] indices;
|
||||
delete[] normals;
|
||||
|
||||
fclose(output);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "vec3d.h"
|
||||
#include "mpq.h"
|
||||
#include "modelheaders.h"
|
||||
//#include "quaternion.h"
|
||||
#include <vector>
|
||||
|
||||
class Model;
|
||||
|
|
@ -18,18 +17,14 @@ Vec3D fixCoordSystem(Vec3D v);
|
|||
class Model
|
||||
{
|
||||
public:
|
||||
|
||||
ModelHeader header;
|
||||
ModelAnimation *anims;
|
||||
int *globalSequences;
|
||||
|
||||
public:
|
||||
bool animGeometry,animTextures,animBones;
|
||||
bool animated;
|
||||
|
||||
bool isAnimated(MPQFile &f);
|
||||
ModelVertex *origVertices;
|
||||
Vec3D *vertices, *normals;
|
||||
uint16 *indices;
|
||||
uint32 offsBB_vertices, offsBB_indices;
|
||||
Vec3D *BB_vertices, *vertices;
|
||||
uint16 *BB_indices, *indices;
|
||||
size_t nIndices;
|
||||
|
||||
bool open();
|
||||
|
|
@ -38,12 +33,6 @@ public:
|
|||
public:
|
||||
|
||||
bool ok;
|
||||
bool ind;
|
||||
|
||||
float rad;
|
||||
float trans;
|
||||
bool animcalc;
|
||||
int anim, animtime;
|
||||
|
||||
Model(std::string &filename);
|
||||
~Model();
|
||||
|
|
@ -59,15 +48,9 @@ public:
|
|||
Model *model;
|
||||
|
||||
int id;
|
||||
|
||||
Vec3D pos, rot;
|
||||
unsigned int d1, scale;
|
||||
|
||||
float frot,w,sc;
|
||||
|
||||
int light;
|
||||
Vec3D ldir;
|
||||
Vec3D lcol;
|
||||
float w,sc;
|
||||
|
||||
ModelInstance() {}
|
||||
ModelInstance(MPQFile &f,const char* ModelInstName,const char*MapName, FILE *pDirfile);
|
||||
|
|
|
|||
|
|
@ -15,289 +15,67 @@ struct ModelHeader {
|
|||
uint8 version[4];
|
||||
uint32 nameLength;
|
||||
uint32 nameOfs;
|
||||
uint32 type;
|
||||
|
||||
uint32 type;
|
||||
uint32 nGlobalSequences;
|
||||
uint32 ofsGlobalSequences;
|
||||
uint32 nAnimations;
|
||||
uint32 ofsAnimations;
|
||||
uint32 nC;
|
||||
uint32 ofsC;
|
||||
uint32 nD;
|
||||
uint32 ofsD;
|
||||
uint32 nBones;
|
||||
uint32 ofsBones;
|
||||
uint32 nF;
|
||||
uint32 ofsF;
|
||||
|
||||
uint32 nAnimationLookup;
|
||||
uint32 ofsAnimationLookup;
|
||||
uint32 nBones;
|
||||
uint32 ofsBones;
|
||||
uint32 nKeyBoneLookup;
|
||||
uint32 ofsKeyBoneLookup;
|
||||
uint32 nVertices;
|
||||
uint32 ofsVertices;
|
||||
uint32 nViews;
|
||||
uint32 ofsViews;
|
||||
|
||||
uint32 nColors;
|
||||
uint32 ofsColors;
|
||||
|
||||
uint32 nTextures;
|
||||
uint32 ofsTextures;
|
||||
|
||||
uint32 nTransparency; // H
|
||||
uint32 nTransparency;
|
||||
uint32 ofsTransparency;
|
||||
uint32 nI; // always unused ?
|
||||
uint32 ofsI;
|
||||
uint32 nTexAnims; // J
|
||||
uint32 ofsTexAnims;
|
||||
uint32 nK;
|
||||
uint32 ofsK;
|
||||
|
||||
uint32 nTexFlags;
|
||||
uint32 ofsTexFlags;
|
||||
uint32 nY;
|
||||
uint32 ofsY;
|
||||
|
||||
uint32 nTexLookup;
|
||||
uint32 ofsTexLookup;
|
||||
|
||||
uint32 nTexUnitLookup; // L
|
||||
uint32 ofsTexUnitLookup;
|
||||
uint32 nTransparencyLookup; // M
|
||||
uint32 ofsTransparencyLookup;
|
||||
uint32 nTexAnimLookup;
|
||||
uint32 ofsTexAnimLookup;
|
||||
|
||||
float floats[14];
|
||||
|
||||
uint32 nBoundingTriangles;
|
||||
uint32 ofsBoundingTriangles;
|
||||
uint32 nBoundingVertices;
|
||||
uint32 ofsBoundingVertices;
|
||||
uint32 nBoundingNormals;
|
||||
uint32 ofsBoundingNormals;
|
||||
|
||||
uint32 nO;
|
||||
uint32 ofsO;
|
||||
uint32 nP;
|
||||
uint32 ofsP;
|
||||
uint32 nQ;
|
||||
uint32 ofsQ;
|
||||
uint32 nLights; // R
|
||||
uint32 ofsLights;
|
||||
uint32 nCameras; // S
|
||||
uint32 ofsCameras;
|
||||
uint32 nT;
|
||||
uint32 ofsT;
|
||||
uint32 nRibbonEmitters; // U
|
||||
uint32 ofsRibbonEmitters;
|
||||
uint32 nParticleEmitters; // V
|
||||
uint32 ofsParticleEmitters;
|
||||
|
||||
uint32 nTextureanimations;
|
||||
uint32 ofsTextureanimations;
|
||||
uint32 nTexReplace;
|
||||
uint32 ofsTexReplace;
|
||||
uint32 nRenderFlags;
|
||||
uint32 ofsRenderFlags;
|
||||
uint32 nBoneLookupTable;
|
||||
uint32 ofsBoneLookupTable;
|
||||
uint32 nTexLookup;
|
||||
uint32 ofsTexLookup;
|
||||
uint32 nTexUnits;
|
||||
uint32 ofsTexUnits;
|
||||
uint32 nTransLookup;
|
||||
uint32 ofsTransLookup;
|
||||
uint32 nTexAnimLookup;
|
||||
uint32 ofsTexAnimLookup;
|
||||
float floats[14];
|
||||
uint32 nBoundingTriangles;
|
||||
uint32 ofsBoundingTriangles;
|
||||
uint32 nBoundingVertices;
|
||||
uint32 ofsBoundingVertices;
|
||||
uint32 nBoundingNormals;
|
||||
uint32 ofsBoundingNormals;
|
||||
uint32 nAttachments;
|
||||
uint32 ofsAttachments;
|
||||
uint32 nAttachLookup;
|
||||
uint32 ofsAttachLookup;
|
||||
uint32 nAttachments_2;
|
||||
uint32 ofsAttachments_2;
|
||||
uint32 nLights;
|
||||
uint32 ofsLights;
|
||||
uint32 nCameras;
|
||||
uint32 ofsCameras;
|
||||
uint32 nCameraLookup;
|
||||
uint32 ofsCameraLookup;
|
||||
uint32 nRibbonEmitters;
|
||||
uint32 ofsRibbonEmitters;
|
||||
uint32 nParticleEmitters;
|
||||
uint32 ofsParticleEmitters;
|
||||
};
|
||||
|
||||
// block B - animations
|
||||
struct ModelAnimation {
|
||||
uint32 animID;
|
||||
uint32 timeStart;
|
||||
uint32 timeEnd;
|
||||
|
||||
float moveSpeed;
|
||||
|
||||
uint32 loopType;
|
||||
uint32 flags;
|
||||
uint32 d1;
|
||||
uint32 d2;
|
||||
uint32 playSpeed; // note: this can't be play speed because it's 0 for some models
|
||||
|
||||
Vec3D boxA, boxB;
|
||||
float rad;
|
||||
|
||||
int16 s[2];
|
||||
};
|
||||
|
||||
|
||||
// sub-block in block E - animation data
|
||||
struct AnimationBlock {
|
||||
int16 type; // interpolation type (0=none, 1=linear, 2=hermite)
|
||||
int16 seq; // global sequence id or -1
|
||||
uint32 nRanges;
|
||||
uint32 ofsRanges;
|
||||
uint32 nTimes;
|
||||
uint32 ofsTimes;
|
||||
uint32 nKeys;
|
||||
uint32 ofsKeys;
|
||||
};
|
||||
|
||||
// block E - bones
|
||||
struct ModelBoneDef {
|
||||
int32 animid;
|
||||
int32 flags;
|
||||
int16 parent; // parent bone index
|
||||
int16 geoid;
|
||||
// new int added to the bone definitions. Added in WoW 2.0
|
||||
int32 unknown;
|
||||
AnimationBlock translation;
|
||||
AnimationBlock rotation;
|
||||
AnimationBlock scaling;
|
||||
Vec3D pivot;
|
||||
};
|
||||
|
||||
struct ModelTexAnimDef {
|
||||
AnimationBlock trans, rot, scale;
|
||||
};
|
||||
|
||||
struct ModelVertex {
|
||||
Vec3D pos;
|
||||
uint8 weights[4];
|
||||
uint8 bones[4];
|
||||
Vec3D normal;
|
||||
Vec2D texcoords;
|
||||
int unk1, unk2; // always 0,0 so this is probably unused
|
||||
};
|
||||
|
||||
struct ModelView {
|
||||
uint32 nIndex, ofsIndex; // Vertices in this model (index into vertices[])
|
||||
uint32 nTris, ofsTris; // indices
|
||||
uint32 nProps, ofsProps; // additional vtx properties
|
||||
uint32 nSub, ofsSub; // materials/renderops/submeshes
|
||||
uint32 nTex, ofsTex; // material properties/textures
|
||||
int32 lod; // LOD bias?
|
||||
};
|
||||
|
||||
|
||||
/// One material + render operation
|
||||
struct ModelGeoset {
|
||||
uint16 d1; // mesh part id?
|
||||
uint16 d2; // ?
|
||||
uint16 vstart; // first vertex
|
||||
uint16 vcount; // num vertices
|
||||
uint16 istart; // first index
|
||||
uint16 icount; // num indices
|
||||
uint16 d3; // number of bone indices
|
||||
uint16 d4; // offset into bone index list
|
||||
uint16 d5; // ?
|
||||
uint16 d6; // root bone?
|
||||
Vec3D v;
|
||||
float unknown[4]; // Added in WoW 2.0?
|
||||
};
|
||||
|
||||
/// A texture unit (sub of material)
|
||||
struct ModelTexUnit{
|
||||
// probably the texture units
|
||||
// size always >=number of materials it seems
|
||||
uint16 flags; // Flags
|
||||
uint16 order; // ?
|
||||
uint16 op; // Material this texture is part of (index into mat)
|
||||
uint16 op2; // Always same as above?
|
||||
int16 colorIndex; // color or -1
|
||||
uint16 flagsIndex; // more flags...
|
||||
uint16 texunit; // Texture unit (0 or 1)
|
||||
uint16 d4; // ? (seems to be always 1)
|
||||
uint16 textureid; // Texture id (index into global texture list)
|
||||
uint16 texunit2; // copy of texture unit value?
|
||||
uint16 transid; // transparency id (index into transparency list)
|
||||
uint16 texanimid; // texture animation id
|
||||
};
|
||||
|
||||
// block X - render flags
|
||||
struct ModelRenderFlags {
|
||||
uint16 flags;
|
||||
uint16 blend;
|
||||
};
|
||||
|
||||
// block G - color defs
|
||||
struct ModelColorDef {
|
||||
AnimationBlock color;
|
||||
AnimationBlock opacity;
|
||||
};
|
||||
|
||||
// block H - transp defs
|
||||
struct ModelTransDef {
|
||||
AnimationBlock trans;
|
||||
};
|
||||
|
||||
struct ModelTextureDef {
|
||||
uint32 type;
|
||||
uint32 flags;
|
||||
uint32 nameLen;
|
||||
uint32 nameOfs;
|
||||
};
|
||||
|
||||
struct ModelLightDef {
|
||||
int16 type;
|
||||
int16 bone;
|
||||
Vec3D pos;
|
||||
AnimationBlock ambColor;
|
||||
AnimationBlock ambIntensity;
|
||||
AnimationBlock color;
|
||||
AnimationBlock intensity;
|
||||
AnimationBlock attStart;
|
||||
AnimationBlock attEnd;
|
||||
AnimationBlock unk1;
|
||||
};
|
||||
|
||||
struct ModelCameraDef {
|
||||
int32 id;
|
||||
float fov, farclip, nearclip;
|
||||
AnimationBlock transPos;
|
||||
Vec3D pos;
|
||||
AnimationBlock transTarget;
|
||||
Vec3D target;
|
||||
AnimationBlock rot;
|
||||
};
|
||||
|
||||
|
||||
struct ModelParticleParams {
|
||||
float mid;
|
||||
uint32 colors[3];
|
||||
float sizes[3];
|
||||
int16 d[10];
|
||||
float unk[3];
|
||||
float scales[3];
|
||||
float slowdown;
|
||||
float rotation;
|
||||
float f2[16];
|
||||
};
|
||||
|
||||
struct ModelParticleEmitterDef {
|
||||
int32 id;
|
||||
int32 flags;
|
||||
Vec3D pos;
|
||||
int16 bone;
|
||||
int16 texture;
|
||||
int32 nZero1;
|
||||
int32 ofsZero1;
|
||||
int32 nZero2;
|
||||
int32 ofsZero2;
|
||||
int16 blend;
|
||||
int16 type;
|
||||
int16 s1;
|
||||
int16 s2;
|
||||
int16 cols;
|
||||
int16 rows;
|
||||
AnimationBlock params[10];
|
||||
ModelParticleParams p;
|
||||
AnimationBlock unk;
|
||||
};
|
||||
|
||||
|
||||
struct ModelRibbonEmitterDef {
|
||||
int32 id;
|
||||
int32 bone;
|
||||
Vec3D pos;
|
||||
int32 nTextures;
|
||||
int32 ofsTextures;
|
||||
int32 nUnknown;
|
||||
int32 ofsUnknown;
|
||||
AnimationBlock color;
|
||||
AnimationBlock opacity;
|
||||
AnimationBlock above;
|
||||
AnimationBlock below;
|
||||
float res, length, unk;
|
||||
int16 s1, s2;
|
||||
AnimationBlock unk1;
|
||||
AnimationBlock unk2;
|
||||
};
|
||||
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -421,6 +421,10 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames) {
|
|||
|
||||
// open expansion and common files
|
||||
printf("Opening data files from data directory.\n");
|
||||
sprintf(path, "%slichking.mpq", input_path);
|
||||
pArchiveNames.push_back(path);
|
||||
sprintf(path, "%scommon-2.mpq", input_path);
|
||||
pArchiveNames.push_back(path);
|
||||
sprintf(path, "%sexpansion.mpq", input_path);
|
||||
pArchiveNames.push_back(path);
|
||||
sprintf(path, "%scommon.mpq", input_path);
|
||||
|
|
@ -432,6 +436,8 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames) {
|
|||
for (std::vector<std::string>::iterator i = locales.begin(); i != locales.end(); i++)
|
||||
{
|
||||
printf("Locale: %s\n", i->c_str());
|
||||
sprintf(path, "%s%s\\lichking-locale-%s.mpq", input_path, i->c_str(), i->c_str());
|
||||
pArchiveNames.push_back(path);
|
||||
sprintf(path, "%s%s\\expansion-locale-%s.mpq", input_path, i->c_str(), i->c_str());
|
||||
pArchiveNames.push_back(path);
|
||||
sprintf(path, "%s%s\\locale-%s.mpq", input_path, i->c_str(), i->c_str());
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
DROP TABLE IF EXISTS `character_db_version`;
|
||||
CREATE TABLE `character_db_version` (
|
||||
`required_2008_12_03_01_character_guild_member` bit(1) default NULL
|
||||
`required_2008_12_22_19_characters_item_instance` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||
|
||||
--
|
||||
|
|
@ -35,6 +35,28 @@ INSERT INTO `character_db_version` VALUES
|
|||
/*!40000 ALTER TABLE `character_db_version` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `account_data`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `account_data`;
|
||||
CREATE TABLE `account_data` (
|
||||
`account` int(11) unsigned NOT NULL default '0',
|
||||
`type` int(11) unsigned NOT NULL default '0',
|
||||
`time` bigint(11) unsigned NOT NULL default '0',
|
||||
`data` longtext NOT NULL,
|
||||
PRIMARY KEY (`account`,`type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `account_data`
|
||||
--
|
||||
|
||||
LOCK TABLES `account_data` WRITE;
|
||||
/*!40000 ALTER TABLE `account_data` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `account_data` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `arena_team`
|
||||
--
|
||||
|
|
@ -73,7 +95,8 @@ CREATE TABLE `arena_team_member` (
|
|||
`played_week` int(10) unsigned NOT NULL default '0',
|
||||
`wons_week` int(10) unsigned NOT NULL default '0',
|
||||
`played_season` int(10) unsigned NOT NULL default '0',
|
||||
`wons_season` int(10) unsigned NOT NULL default '0'
|
||||
`wons_season` int(10) unsigned NOT NULL default '0',
|
||||
`personal_rating` int(10) UNSIGNED NOT NULL DEFAULT '0'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
|
|
@ -201,6 +224,7 @@ CREATE TABLE `characters` (
|
|||
`zone` int(11) unsigned NOT NULL default '0',
|
||||
`death_expire_time` bigint(20) unsigned NOT NULL default '0',
|
||||
`taxi_path` text,
|
||||
`arena_pending_points` int(10) UNSIGNED NOT NULL default '0',
|
||||
PRIMARY KEY (`guid`),
|
||||
KEY `idx_account` (`account`),
|
||||
KEY `idx_online` (`online`),
|
||||
|
|
@ -216,6 +240,49 @@ LOCK TABLES `characters` WRITE;
|
|||
/*!40000 ALTER TABLE `characters` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `character_achievement`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `character_achievement`;
|
||||
CREATE TABLE `character_achievement` (
|
||||
`guid` int(11) NOT NULL,
|
||||
`achievement` int(11) NOT NULL,
|
||||
`date` int(11) NOT NULL,
|
||||
PRIMARY KEY (`guid`,`achievement`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `character_achievement`
|
||||
--
|
||||
|
||||
LOCK TABLES `character_achievement` WRITE;
|
||||
/*!40000 ALTER TABLE `character_achievement` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `character_achievement` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `character_achievement_progress`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `character_achievement_progress`;
|
||||
CREATE TABLE `character_achievement_progress` (
|
||||
`guid` int(11) NOT NULL,
|
||||
`criteria` int(11) NOT NULL,
|
||||
`counter` int(11) NOT NULL,
|
||||
`date` int(11) NOT NULL,
|
||||
PRIMARY KEY (`guid`,`criteria`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `character_achievement_progress`
|
||||
--
|
||||
|
||||
LOCK TABLES `character_achievement_progress` WRITE;
|
||||
/*!40000 ALTER TABLE `character_achievement_progress` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `character_achievement_progress` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `character_action`
|
||||
--
|
||||
|
|
@ -398,9 +465,7 @@ CREATE TABLE `character_pet` (
|
|||
`level` int(11) unsigned NOT NULL default '1',
|
||||
`exp` int(11) unsigned NOT NULL default '0',
|
||||
`Reactstate` tinyint(1) unsigned NOT NULL default '0',
|
||||
`loyaltypoints` int(11) NOT NULL default '0',
|
||||
`loyalty` int(11) unsigned NOT NULL default '0',
|
||||
`trainpoint` int(11) NOT NULL default '0',
|
||||
`talentpoints` int(11) unsigned NOT NULL default '0',
|
||||
`name` varchar(100) default 'Pet',
|
||||
`renamed` tinyint(1) unsigned NOT NULL default '0',
|
||||
`slot` int(11) unsigned NOT NULL default '0',
|
||||
|
|
@ -1222,6 +1287,7 @@ CREATE TABLE `petition_sign` (
|
|||
`type` int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`petitionguid`,`playerguid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Guild System';
|
||||
|
||||
--
|
||||
-- Dumping data for table `petition_sign`
|
||||
--
|
||||
|
|
@ -1232,6 +1298,26 @@ LOCK TABLES `petition_sign` WRITE;
|
|||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
--
|
||||
-- Table structure for table `saved_variables`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `saved_variables`;
|
||||
CREATE TABLE `saved_variables` (
|
||||
`NextArenaPointDistributionTime` bigint(40) UNSIGNED NOT NULL DEFAULT '0'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Variable Saves';
|
||||
|
||||
--
|
||||
-- Dumping data for table `saved_variables`
|
||||
--
|
||||
|
||||
LOCK TABLES `saved_variables` WRITE;
|
||||
/*!40000 ALTER TABLE `saved_variables` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `saved_variables` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
|
|
|
|||
3691
sql/mangos.sql
3691
sql/mangos.sql
File diff suppressed because it is too large
Load diff
|
|
@ -2,20 +2,20 @@ ALTER TABLE db_version CHANGE COLUMN required_2008_11_11_01_mangos_db_script_str
|
|||
|
||||
ALTER TABLE event_scripts
|
||||
DROP datatext,
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
|
||||
ALTER TABLE gameobject_scripts
|
||||
DROP datatext,
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
|
||||
ALTER TABLE quest_end_scripts
|
||||
DROP datatext,
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
|
||||
ALTER TABLE quest_start_scripts
|
||||
DROP datatext,
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
|
||||
ALTER TABLE spell_scripts
|
||||
DROP datatext,
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_11_11_02_mangos_scripts required_2008_11_14_01_mangos_scripts bit;
|
||||
|
||||
ALTER TABLE event_scripts
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
|
||||
ALTER TABLE gameobject_scripts
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
|
||||
ALTER TABLE quest_end_scripts
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
|
||||
ALTER TABLE quest_start_scripts
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
|
||||
ALTER TABLE spell_scripts
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
CHANGE COLUMN dataint dataint int(11) NOT NULL default '0' AFTER datalong2;
|
||||
|
|
|
|||
8
sql/updates/2008_12_15_01_character_arenas.sql
Normal file
8
sql/updates/2008_12_15_01_character_arenas.sql
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE character_db_version CHANGE COLUMN required_2008_12_03_01_character_guild_member required_2008_12_15_01_character_arenas bit;
|
||||
|
||||
CREATE TABLE `saved_variables` (
|
||||
`NextArenaPointDistributionTime` bigint(40) UNSIGNED NOT NULL DEFAULT '0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Variable Saves';
|
||||
|
||||
ALTER TABLE `arena_team_member` ADD COLUMN `personal_rating` int(10) UNSIGNED NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `characters` ADD COLUMN `arena_pending_points` int(10) UNSIGNED NOT NULL default '0';
|
||||
28
sql/updates/2008_12_15_01_mangos_arenas.sql
Normal file
28
sql/updates/2008_12_15_01_mangos_arenas.sql
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_11_29_02_mangos_spell_elixir required_2008_12_15_01_mangos_arenas bit;
|
||||
|
||||
DELETE FROM `command` WHERE `name` = "flusharenapoints";
|
||||
INSERT INTO `command` (`name`, `security`, `help`) VALUES
|
||||
('flusharenapoints','3','Syntax: .flusharenapoints\r\n\r\nUse it to distribute arena points based on arena team ratings, and start a new week.');
|
||||
|
||||
DELETE FROM mangos_string WHERE entry BETWEEN 1122 AND 1138;
|
||||
|
||||
INSERT INTO mangos_string (entry, content_default) VALUES
|
||||
(1122,'Your group is too large for this battleground. Please regroup to join.'),
|
||||
(1123,'Your group is too large for this arena. Please regroup to join.'),
|
||||
(1124,'Your group has members not in your arena team. Please regroup to join.'),
|
||||
(1125,'Your group does not have enough players to join this match.'),
|
||||
(1126,'The Gold Team wins!'),
|
||||
(1127,'The Green Team wins!'),
|
||||
(1128, 'There aren\'t enough players in this battleground. It will end soon unless some more players join to balance the fight.'),
|
||||
(1129, 'Your group has an offline member. Please remove him before joining.'),
|
||||
(1130, 'Your group has players from the opposing faction. You can\'t join the battleground as a group.'),
|
||||
(1131, 'Your group has players from different battleground brakets. You can\'t join as group.'),
|
||||
(1132, 'Someone in your party is already in this battleground queue. (S)he must leave it before joining as group.'),
|
||||
(1133, 'Someone in your party is Deserter. You can\'t join as group.'),
|
||||
(1134, 'Someone in your party is already in three battleground queues. You cannot join as group.'),
|
||||
(1135, 'You cannot teleport to a battleground or arena map.'),
|
||||
(1136, 'You cannot summon players to a battleground or arena map.'),
|
||||
(1137, 'You must be in GM mode to teleport to a player in a battleground.'),
|
||||
(1138, 'You cannot teleport to a battleground from another battleground. Please leave the current battleground first.');
|
||||
|
||||
DELETE FROM mangos_string WHERE entry = 714 OR entry = 716;
|
||||
14
sql/updates/2008_12_22_01_mangos_creature_equip_template.sql
Normal file
14
sql/updates/2008_12_22_01_mangos_creature_equip_template.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_12_15_01_mangos_arenas required_2008_12_22_01_mangos_creature_equip_template bit;
|
||||
|
||||
TRUNCATE creature_equip_template;
|
||||
|
||||
alter table `creature_equip_template`
|
||||
drop column `equipinfo1`,
|
||||
drop column `equipinfo2`,
|
||||
drop column `equipinfo3`,
|
||||
drop column `equipslot1`,
|
||||
drop column `equipslot2`,
|
||||
drop column `equipslot3`,
|
||||
change `equipmodel1` `equipentry1` mediumint(8) UNSIGNED default '0' NOT NULL,
|
||||
change `equipmodel2` `equipentry2` mediumint(8) UNSIGNED default '0' NOT NULL,
|
||||
change `equipmodel3` `equipentry3` mediumint(8) UNSIGNED default '0' NOT NULL;
|
||||
7
sql/updates/2008_12_22_02_characters_character_pet.sql
Normal file
7
sql/updates/2008_12_22_02_characters_character_pet.sql
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
ALTER TABLE character_db_version CHANGE COLUMN required_2008_12_15_01_character_arenas required_2008_12_22_02_characters_character_pet bit;
|
||||
|
||||
alter table `character_pet`
|
||||
drop column `trainpoint`,
|
||||
drop column `loyaltypoints`,
|
||||
drop column `loyalty`,
|
||||
add `talentpoints` int(11) UNSIGNED default '0' NOT NULL after `Reactstate`;
|
||||
7
sql/updates/2008_12_22_03_mangos_item_template.sql
Normal file
7
sql/updates/2008_12_22_03_mangos_item_template.sql
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_12_22_01_mangos_creature_equip_template required_2008_12_22_03_mangos_item_template bit;
|
||||
|
||||
alter table `item_template`
|
||||
add column `ScalingStatDistribution` smallint(6) DEFAULT '0' NOT NULL after `stat_value10`,
|
||||
add column `ScalingStatValue` smallint(6) DEFAULT '0' NOT NULL after `ScalingStatDistribution`,
|
||||
add column `ItemLimitCategory` smallint(6) DEFAULT '0' NOT NULL after `ArmorDamageModifier`,
|
||||
change `Duration` `Duration` int(11) NOT NULL default '0' COMMENT 'Duration in seconds. Negative value means realtime, postive value ingame time' after ArmorDamageModifier;
|
||||
4
sql/updates/2008_12_22_04_mangos_item_template.sql
Normal file
4
sql/updates/2008_12_22_04_mangos_item_template.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_12_22_03_mangos_item_template required_2008_12_22_04_mangos_item_template bit;
|
||||
|
||||
alter table `item_template`
|
||||
add column `StatsCount` tinyint(3) UNSIGNED DEFAULT '0' NOT NULL after `ContainerSlots`;
|
||||
9
sql/updates/2008_12_22_05_characters_account_data.sql
Normal file
9
sql/updates/2008_12_22_05_characters_account_data.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
ALTER TABLE character_db_version CHANGE COLUMN required_2008_12_22_02_characters_character_pet required_2008_12_22_05_characters_account_data bit;
|
||||
|
||||
CREATE TABLE `account_data` (
|
||||
`account` int(11) unsigned NOT NULL default '0',
|
||||
`type` int(11) unsigned NOT NULL default '0',
|
||||
`time` bigint(11) unsigned NOT NULL default '0',
|
||||
`data` longtext NOT NULL,
|
||||
PRIMARY KEY (`account`,`type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
ALTER TABLE character_db_version CHANGE COLUMN required_2008_12_22_05_characters_account_data required_2008_12_22_06_characters_character_achievement bit;
|
||||
|
||||
DROP TABLE IF EXISTS `character_achievement`;
|
||||
CREATE TABLE `character_achievement` (
|
||||
`guid` int(11) NOT NULL,
|
||||
`achievement` int(11) NOT NULL,
|
||||
`date` int(11) NOT NULL,
|
||||
PRIMARY KEY (`guid`,`achievement`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
DROP TABLE IF EXISTS `character_achievement_progress`;
|
||||
CREATE TABLE `character_achievement_progress` (
|
||||
`guid` int(11) NOT NULL,
|
||||
`criteria` int(11) NOT NULL,
|
||||
`counter` int(11) NOT NULL,
|
||||
`date` int(11) NOT NULL,
|
||||
PRIMARY KEY (`guid`,`criteria`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
5
sql/updates/2008_12_22_07_mangos_quest_template.sql
Normal file
5
sql/updates/2008_12_22_07_mangos_quest_template.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_12_22_04_mangos_item_template required_2008_12_22_07_mangos_quest_template bit;
|
||||
|
||||
alter table `quest_template`
|
||||
add column `PlayersSlain` tinyint(3) UNSIGNED DEFAULT '0' NOT NULL after `CharTitleId`,
|
||||
add column `BonusTalents` tinyint(3) UNSIGNED DEFAULT '0' NOT NULL after `PlayersSlain`;
|
||||
15
sql/updates/2008_12_22_08_mangos_milling_loot_template.sql
Normal file
15
sql/updates/2008_12_22_08_mangos_milling_loot_template.sql
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_12_22_07_mangos_quest_template required_2008_12_22_08_mangos_milling_loot_template bit;
|
||||
|
||||
DROP TABLE IF EXISTS `milling_loot_template`;
|
||||
CREATE TABLE `milling_loot_template` (
|
||||
`entry` mediumint(8) unsigned NOT NULL default '0',
|
||||
`item` mediumint(8) unsigned NOT NULL default '0',
|
||||
`ChanceOrQuestChance` float NOT NULL default '100',
|
||||
`groupid` tinyint(3) unsigned NOT NULL default '0',
|
||||
`mincountOrRef` mediumint(9) NOT NULL default '1',
|
||||
`maxcount` tinyint(3) unsigned NOT NULL default '1',
|
||||
`lootcondition` tinyint(3) unsigned NOT NULL default '0',
|
||||
`condition_value1` mediumint(8) unsigned NOT NULL default '0',
|
||||
`condition_value2` mediumint(8) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`entry`,`item`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System';
|
||||
14
sql/updates/2008_12_22_09_mangos_spell_affect.sql
Normal file
14
sql/updates/2008_12_22_09_mangos_spell_affect.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_12_22_08_mangos_milling_loot_template required_2008_12_22_09_mangos_spell_affect bit;
|
||||
|
||||
--
|
||||
-- Table structure for table `spell_affect`
|
||||
--
|
||||
DROP TABLE IF EXISTS `spell_affect`;
|
||||
CREATE TABLE `spell_affect` (
|
||||
`entry` smallint(5) unsigned NOT NULL default '0',
|
||||
`effectId` tinyint(3) unsigned NOT NULL default '0',
|
||||
`SpellClassMask0` int(5) unsigned NOT NULL default '0',
|
||||
`SpellClassMask1` int(5) unsigned NOT NULL default '0',
|
||||
`SpellClassMask2` int(5) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`entry`,`effectId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
5
sql/updates/2008_12_22_10_mangos_string.sql
Normal file
5
sql/updates/2008_12_22_10_mangos_string.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_12_22_09_mangos_spell_affect required_2008_12_22_10_mangos_string bit;
|
||||
|
||||
INSERT INTO `mangos_string` VALUES
|
||||
(345,'Forced customize for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||
(346,'Forced customize for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
183
sql/updates/2008_12_22_11_mangos_player_classlevelstats.sql
Normal file
183
sql/updates/2008_12_22_11_mangos_player_classlevelstats.sql
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_2008_12_22_10_mangos_string required_2008_12_22_11_mangos_player_classlevelstats bit;
|
||||
|
||||
DELETE FROM `player_classlevelstats` WHERE class = 6 OR level > 70;
|
||||
INSERT INTO `player_classlevelstats` VALUES
|
||||
(1,71,4720,0),
|
||||
(1,72,5013,0),
|
||||
(1,73,5325,0),
|
||||
(1,74,5656,0),
|
||||
(1,75,6008,0),
|
||||
(1,76,6381,0),
|
||||
(1,77,6778,0),
|
||||
(1,78,7198,0),
|
||||
(1,79,7646,0),
|
||||
(1,80,8121,0),
|
||||
|
||||
(2,71,3629,3097),
|
||||
(2,72,3900,3241),
|
||||
(2,73,4191,3385),
|
||||
(2,74,4503,3529),
|
||||
(2,75,4839,3673),
|
||||
(2,76,5200,3817),
|
||||
(2,77,5588,3962),
|
||||
(2,78,6005,4106),
|
||||
(2,79,6453,4250),
|
||||
(2,80,6934,4394),
|
||||
|
||||
(3,71,3834,3549),
|
||||
(3,72,4120,3716),
|
||||
(3,73,4427,3882),
|
||||
(3,74,4757,4048),
|
||||
(3,75,5112,4215),
|
||||
(3,76,5493,4381),
|
||||
(3,77,5903,4547),
|
||||
(3,78,6343,4713),
|
||||
(3,79,6816,4880),
|
||||
(3,80,7324,5046),
|
||||
|
||||
(4,71,3980,0),
|
||||
(4,72,4277,0),
|
||||
(4,73,4596,0),
|
||||
(4,74,4939,0),
|
||||
(4,75,5307,0),
|
||||
(4,76,5703,0),
|
||||
(4,77,6128,0),
|
||||
(4,78,6585,0),
|
||||
(4,79,7076,0),
|
||||
(4,80,7604,0),
|
||||
|
||||
(5,71,3644,2744),
|
||||
(5,72,3916,2868),
|
||||
(5,73,4208,2993),
|
||||
(5,74,4522,3117),
|
||||
(5,75,4859,3242),
|
||||
(5,76,5221,3366),
|
||||
(5,77,5610,3490),
|
||||
(5,78,6028,3615),
|
||||
(5,79,6477,3739),
|
||||
(5,80,6960,3863),
|
||||
|
||||
(6,1,22,0),
|
||||
(6,2,27,0),
|
||||
(6,3,32,0),
|
||||
(6,4,37,0),
|
||||
(6,5,42,0),
|
||||
(6,6,47,0),
|
||||
(6,7,52,0),
|
||||
(6,8,58,0),
|
||||
(6,9,64,0),
|
||||
(6,10,70,0),
|
||||
(6,11,77,0),
|
||||
(6,12,84,0),
|
||||
(6,13,92,0),
|
||||
(6,14,100,0),
|
||||
(6,15,117,0),
|
||||
(6,16,127,0),
|
||||
(6,17,138,0),
|
||||
(6,18,150,0),
|
||||
(6,19,163,0),
|
||||
(6,20,177,0),
|
||||
(6,21,192,0),
|
||||
(6,22,208,0),
|
||||
(6,23,225,0),
|
||||
(6,24,239,0),
|
||||
(6,25,258,0),
|
||||
(6,26,278,0),
|
||||
(6,27,299,0),
|
||||
(6,28,321,0),
|
||||
(6,29,344,0),
|
||||
(6,30,368,0),
|
||||
(6,31,393,0),
|
||||
(6,32,419,0),
|
||||
(6,33,446,0),
|
||||
(6,34,474,0),
|
||||
(6,35,503,0),
|
||||
(6,36,533,0),
|
||||
(6,37,564,0),
|
||||
(6,38,596,0),
|
||||
(6,39,629,0),
|
||||
(6,40,698,0),
|
||||
(6,41,698,0),
|
||||
(6,42,734,0),
|
||||
(6,43,771,0),
|
||||
(6,44,809,0),
|
||||
(6,45,849,0),
|
||||
(6,46,891,0),
|
||||
(6,47,935,0),
|
||||
(6,48,981,0),
|
||||
(6,49,1029,0),
|
||||
(6,50,1079,0),
|
||||
(6,51,1131,0),
|
||||
(6,52,1185,0),
|
||||
(6,53,1241,0),
|
||||
(6,54,1299,0),
|
||||
(6,55,1359,0),
|
||||
(6,56,1421,0),
|
||||
(6,57,1485,0),
|
||||
(6,58,1551,0),
|
||||
(6,59,1619,0),
|
||||
(6,60,1689,0),
|
||||
(6,61,1902,0),
|
||||
(6,62,2129,0),
|
||||
(6,63,2357,0),
|
||||
(6,64,2612,0),
|
||||
(6,65,2883,0),
|
||||
(6,66,3169,0),
|
||||
(6,67,3455,0),
|
||||
(6,68,3774,0),
|
||||
(6,69,4109,0),
|
||||
(6,70,4444,0),
|
||||
(6,71,4720,0),
|
||||
(6,72,5013,0),
|
||||
(6,73,5325,0),
|
||||
(6,74,5656,0),
|
||||
(6,75,6008,0),
|
||||
(6,76,6381,0),
|
||||
(6,77,6778,0),
|
||||
(6,78,7199,0),
|
||||
(6,79,7646,0),
|
||||
(6,80,8121,0),
|
||||
|
||||
(7,71,3395,3102),
|
||||
(7,72,3648,3246),
|
||||
(7,73,3920,3389),
|
||||
(7,74,4212,3533),
|
||||
(7,75,4526,3677),
|
||||
(7,76,4863,3821),
|
||||
(7,77,5226,3965),
|
||||
(7,78,5616,4108),
|
||||
(7,79,6035,4252),
|
||||
(7,80,6485,4396),
|
||||
|
||||
(8,71,3646,2343),
|
||||
(8,72,3918,2446),
|
||||
(8,73,4210,2549),
|
||||
(8,74,4524,2652),
|
||||
(8,75,4861,2754),
|
||||
(8,76,5223,2857),
|
||||
(8,77,5612,2960),
|
||||
(8,78,6030,3063),
|
||||
(8,79,6480,3165),
|
||||
(8,80,6963,3268),
|
||||
|
||||
(9,71,3750,2739),
|
||||
(9,72,4025,2863),
|
||||
(9,73,4330,2987),
|
||||
(9,74,4646,3111),
|
||||
(9,75,4997,3235),
|
||||
(9,76,5373,3360),
|
||||
(9,77,5774,3483),
|
||||
(9,78,6207,3608),
|
||||
(9,79,6667,3732),
|
||||
(9,80,7136,3856),
|
||||
|
||||
(11,71,3883,2482),
|
||||
(11,72,4172,2595),
|
||||
(11,73,4483,2708),
|
||||
(11,74,4817,2820),
|
||||
(11,75,5176,2933),
|
||||
(11,76,5562,3045),
|
||||
(11,77,5977,3158),
|
||||
(11,78,6423,3270),
|
||||
(11,79,6902,3383),
|
||||
(11,80,7417,3496);
|
||||
5025
sql/updates/2008_12_22_12_mangos_player_levelstats.sql
Normal file
5025
sql/updates/2008_12_22_12_mangos_player_levelstats.sql
Normal file
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue