|
From: Chad M. <cmm...@us...> - 2005-06-05 01:02:01
|
Update of /cvsroot/seq/showeq/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24281/src Modified Files: Tag: pre_5_0_beta everquest.h interface.cpp spawnshell.cpp spawnshell.h Log Message: Added struct for OP_Illusion and added a spawnshell handler for it which updates gender and race on the spawn. Index: interface.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/interface.cpp,v retrieving revision 1.67.6.16 retrieving revision 1.67.6.17 diff -u -d -r1.67.6.16 -r1.67.6.17 --- interface.cpp 29 May 2005 15:17:29 -0000 1.67.6.16 +++ interface.cpp 5 Jun 2005 01:01:14 -0000 1.67.6.17 @@ -2008,6 +2008,9 @@ m_packet->connect2("OP_SpawnRename", SP_Zone, DIR_Server, "spawnRenameStruct", SZC_Match, m_spawnShell, SLOT(renameSpawn(const uint8_t*))); + m_packet->connect2("OP_Illusion", SP_Zone, DIR_Server|DIR_Client, + "spawnIllusionStruct", SZC_Match, + m_spawnShell, SLOT(illusionSpawn(const uint8_t*))); m_packet->connect2("OP_SpawnAppearance", SP_Zone, DIR_Server|DIR_Client, "spawnAppearanceStruct", SZC_Match, m_spawnShell, SLOT(updateSpawnAppearance(const uint8_t*))); @@ -4320,7 +4323,6 @@ uint32_t minExpLevel, uint32_t maxExpLevel, uint32_t tickExpLevel) { - uint32_t intoExp = totalExp - minExpLevel; uint32_t leftExp = maxExpLevel - totalExp; if (newExp) Index: spawnshell.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/spawnshell.cpp,v retrieving revision 1.42.6.8 retrieving revision 1.42.6.9 diff -u -d -r1.42.6.8 -r1.42.6.9 --- spawnshell.cpp 15 May 2005 16:06:25 -0000 1.42.6.8 +++ spawnshell.cpp 5 Jun 2005 01:01:15 -0000 1.42.6.9 @@ -688,6 +688,33 @@ } } +void SpawnShell::illusionSpawn(const uint8_t* data) +{ + const spawnIllusionStruct* illusion = (const spawnIllusionStruct*)data; +#ifdef SPAWNSHELL_DIAG + seqDebug("SpawnShell::illusionSpawn(id=%d, name=%s, new race=%d)", + illusion->spawnId, illusion->name, illusion->race); +#endif + + const Item* item = findID(tSpawn, illusion->spawnId); + + if (item != NULL) + { + Spawn* spawn = (Spawn*) item; + + // Update what we can + spawn->setGender(illusion->gender); + spawn->setRace(illusion->race); + + spawn->updateLastChanged(); + emit changeItem(spawn, tSpawnChangedALL); + } + else + { + seqWarn("SpawnShell: tried to illusion %s (id=%d) to race %d, but the mob didn't exist in the spawn list", illusion->name, illusion->spawnId, illusion->race); + } +} + void SpawnShell::updateSpawnAppearance(const uint8_t* data) { const spawnAppearanceStruct* app = (const spawnAppearanceStruct*)data; @@ -701,6 +728,7 @@ if (item != NULL) { Spawn* spawn = (Spawn*)item; + switch(app->type) { case 1: // level update Index: spawnshell.h =================================================================== RCS file: /cvsroot/seq/showeq/src/spawnshell.h,v retrieving revision 1.21.12.3 retrieving revision 1.21.12.4 diff -u -d -r1.21.12.3 -r1.21.12.4 --- spawnshell.h 7 Apr 2005 03:19:37 -0000 1.21.12.3 +++ spawnshell.h 5 Jun 2005 01:01:15 -0000 1.21.12.4 @@ -114,6 +114,7 @@ void updateSpawns(const uint8_t* updates); void updateSpawnInfo(const uint8_t* spawnupdate); void renameSpawn(const uint8_t* renameupdate); + void illusionSpawn(const uint8_t* illusionupdate); void updateSpawnAppearance(const uint8_t* appearanceupdate); void updateNpcHP(const uint8_t* hpupdate); void spawnWearingUpdate(const uint8_t* wearing); Index: everquest.h =================================================================== RCS file: /cvsroot/seq/showeq/src/everquest.h,v retrieving revision 1.74.6.26 retrieving revision 1.74.6.27 diff -u -d -r1.74.6.26 -r1.74.6.27 --- everquest.h 4 Jun 2005 17:30:02 -0000 1.74.6.26 +++ everquest.h 5 Jun 2005 01:01:14 -0000 1.74.6.27 @@ -1146,6 +1146,24 @@ /*196*/ uint32_t unknown196; //set to 1 }; +/* +** Illusion a spawn +** Length: 168 Octets +** OpCode: Illusion +*/ +struct spawnIllusionStruct +{ +/*0000*/ uint32_t spawnId; // Spawn id of the target +/*0004*/ char name[64]; // Name of the target +/*0068*/ uint32_t race; // New race +/*0072*/ uint8_t gender; // New gender (0=male, 1=female) +/*0073*/ uint8_t texture; // ??? +/*0074*/ uint8_t helm; // ??? +/*0075*/ uint8_t unknown0077; // ***Placeholder +/*0076*/ uint32_t face; // New face +/*0080*/ uint8_t unknown0082[88]; // ***Placeholder +}; + /* ** ShowEQ Specific Structures |