Update of /cvsroot/seq/showeq/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28119/src Modified Files: everquest.h interface.cpp mapicon.cpp messageshell.cpp netstream.cpp netstream.h player.cpp player.h races.h spawn.cpp spawn.h spawnlistcommon.cpp spawnshell.cpp spawnshell.h staticspells.h typenames.h weapons29.h weapons2a.h weapons2b.h zones.h Log Message: Updated for Serpents Spine: - New Movement Packet opcode + handler - Regenerated staticspells.h - Updated zones.h, typenames.h, races.h - Fixed structs/added padding - Added some new weapon names - Support for up to level 75 - New con tables - New con color for gray (looks poor - too much like a spawn point) Index: player.h =================================================================== RCS file: /cvsroot/seq/showeq/src/player.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- player.h 27 Feb 2006 23:16:47 -0000 1.24 +++ player.h 30 Sep 2006 21:18:25 -0000 1.25 @@ -25,14 +25,15 @@ enum ColorLevel { - tGreenSpawn = 0, - tCyanSpawn = 1, - tBlueSpawn = 2, - tEvenSpawn = 3, - tYellowSpawn = 4, - tRedSpawn = 5, - tUnknownSpawn = 6, - tMaxColorLevels = 7 + tGraySpawn = 0, + tGreenSpawn = 1, + tCyanSpawn = 2, + tBlueSpawn = 3, + tEvenSpawn = 4, + tYellowSpawn = 5, + tRedSpawn = 6, + tUnknownSpawn = 7, + tMaxColorLevels = 8 }; //---------------------------------------------------------------------- Index: messageshell.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/messageshell.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- messageshell.cpp 27 Feb 2006 23:16:47 -0000 1.6 +++ messageshell.cpp 30 Sep 2006 21:18:25 -0000 1.7 @@ -865,12 +865,6 @@ if (!deity.isEmpty()) msg += QString(" [") + deity + "]"; - if (con->maxHp || con->curHp) - { - lvl.sprintf(" (%i/%i HP)", con->curHp, con->maxHp); - msg += lvl; - } - msg += QString(" is: ") + print_faction(con->faction) + " (" + QString::number(con->faction) + ")!"; Index: staticspells.h =================================================================== RCS file: /cvsroot/seq/showeq/src/staticspells.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- staticspells.h 27 Feb 2006 23:16:47 -0000 1.4 +++ staticspells.h 30 Sep 2006 21:18:26 -0000 1.5 @@ -1518,7 +1518,7 @@ /* 0x05e2 - 1506 */ { "Scouring Wind" }, /* 0x05e3 - 1507 */ { "Blessing of the Theurgist" }, /* 0x05e4 - 1508 */ { "Asystole" }, -/* 0x05e5 - 1509 */ { "Leach" }, +/* 0x05e5 - 1509 */ { "Leech" }, /* 0x05e6 - 1510 */ { "Shadow Compact" }, /* 0x05e7 - 1511 */ { "Scent of Dusk" }, /* 0x05e8 - 1512 */ { "Scent of Shadow" }, @@ -1732,7 +1732,7 @@ /* 0x06b8 - 1720 */ { "Eye of Tallon" }, /* 0x06b9 - 1721 */ { "Unswerving Hammer of Faith" }, [...3143 lines suppressed...] +/* 0x2d79 - 11641 */ { "Gathering of Spirits" }, +/* 0x2d7a - 11642 */ { "Ancestral Favor" }, +/* 0x2d7b - 11643 */ { "Ancestral Favor" }, +/* 0x2d7c - 11644 */ { "Ancestral Favor" }, +/* 0x2d7d - 11645 */ { "Vengeance of Vergalid" }, +/* 0x2d7e - 11646 */ { "Oblivion" }, +/* 0x2d7f - 11647 */ { "Oblivion Blast" }, +/* 0x2d80 - 11648 */ { "Guardian Blade" }, +/* 0x2d81 - 11649 */ { "Frozen Tears" }, +/* 0x2d82 - 11650 */ { "Razor Strike" }, +/* 0x2d83 - 11651 */ { "Mark of Valdeholm" }, +/* 0x2d84 - 11652 */ { "Mark of Frostcrypt" }, +/* 0x2d85 - 11653 */ { "Mark of Vergalid" }, // -// Max SpellId: 0x2342 = 9026 -// Number of Spells: 8506 -// Empty Entries: 520 +// Max SpellId: 0x2d86 = 11654 +// Number of Spells: 10925 +// Empty Entries: 729 Index: netstream.h =================================================================== RCS file: /cvsroot/seq/showeq/src/netstream.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- netstream.h 13 Sep 2005 15:23:12 -0000 1.2 +++ netstream.h 30 Sep 2006 21:18:25 -0000 1.3 @@ -40,6 +40,31 @@ const uint8_t* m_pos; }; +/** + * A network stream that manages data by the bit. This is useful for + * unpacking non-byte-aligned data. + */ +class BitStream +{ +public: + BitStream(const uint8_t* data, size_t length); + ~BitStream(); + + const uint8_t* data() { return m_data; } + size_t length() { return m_totalBits >> 3; } + void reset(); + bool end() { return (m_currentBit >= m_totalBits); } + + bool readBit(); + uint32_t readUInt(size_t bitCount); + int32_t readInt(size_t bitCount); + +protected: + const uint8_t* m_data; + size_t m_totalBits; + size_t m_currentBit; +}; + #endif // _NETSTREAM_H_ Index: weapons2a.h =================================================================== RCS file: /cvsroot/seq/showeq/src/weapons2a.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- weapons2a.h 13 Sep 2005 15:23:14 -0000 1.2 +++ weapons2a.h 30 Sep 2006 21:18:26 -0000 1.3 @@ -61,7 +61,7 @@ "Forge", // 0x34 "BrewBarrel", // 0x35 NULL, // 0x36 - NULL, // 0x37 + "BlueBottle", // 0x37 NULL, // 0x38 NULL, // 0x39 NULL, // 0x3a @@ -117,9 +117,9 @@ NULL, // 0x6c NULL, // 0x6d NULL, // 0x6e - NULL, // 0x6f - NULL, // 0x70 - NULL, // 0x71 + "Forge", // 0x6f + "Forge", // 0x70 + "Oven", // 0x71 NULL, // 0x72 NULL, // 0x73 NULL, // 0x74 @@ -172,8 +172,8 @@ NULL, // 0xa3 NULL, // 0xa4 NULL, // 0xa5 - NULL, // 0xa6 - NULL, // 0xa7 + "Sabre", // 0xa6 + "Sabre", // 0xa7 NULL, // 0xa8 NULL, // 0xa9 NULL, // 0xaa Index: player.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/player.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- player.cpp 16 Jun 2006 13:36:35 -0000 1.51 +++ player.cpp 30 Sep 2006 21:18:25 -0000 1.52 @@ -30,6 +30,7 @@ static const char* conColorBasePrefNames[] = { + "GrayBase", "GreenBase", "CyanBase", "BlueBase", @@ -74,6 +75,10 @@ // set the name to the default name Spawn::setName(m_defaultName); + m_conColorBases[tGraySpawn] = + pSEQPrefs->getPrefColor(conColorBasePrefNames[tGraySpawn], + "Player", + QColor(140, 140, 140)); m_conColorBases[tGreenSpawn] = pSEQPrefs->getPrefColor(conColorBasePrefNames[tGreenSpawn], "Player", @@ -1048,150 +1053,132 @@ void Player::fillConTable() { -// keep around for historical giggles -// -// to make changes here, simply alter greenRange and cyanRange -// -// Levels Green Cyan Red -// 1-7 -4 n/a +3 -// 8-? -5 -4 +3 -// 11-? -6 -5 +3 -// 13-22 -7 -5 +3 -// 23-24 -10? -7? +3 -// 25-34 -13 -10 +3 -// 35-40 -14? -10? +3 -// 41-42 -15? -11? +3 -// 43-44 -16? -12? +3 -// 45-48 -17? -13? +3 -// 49-51 -18 -14? +3 -// 52-54 -19? -15? +3 -// 55-57 -20? -16? +3 -// 58-60 -21 -16 +3 -// 61 -13 -17 +3 - + int grayRange = 0; int greenRange = 0; - int cyanRange = 0; - if (level() < 8) - { // 1 - 7 - greenRange = -4; - cyanRange = -8; + if (level() < 9) + { // 1 - 8 + grayRange = -4; + greenRange = -8; } else if (level() < 13) - { // 8 - 12 + { // 9 - 12 + grayRange = -6; + greenRange = -4; + } + else if (level() < 17) + { // 13-16 + grayRange = -7; greenRange = -5; - cyanRange = -4; } - else if (level() < 23) - { // - greenRange = -8; - cyanRange = -6; + else if (level() < 21) + { // 17-20 + grayRange = -8; + greenRange = -6; } - else if (level() < 27) - { // - greenRange = -10; - cyanRange = -8; + else if (level() < 25) + { // 21-24 + grayRange = -9; + greenRange = -7; } else if (level() < 29) - { // - greenRange = -11; - cyanRange = -8; + { // 25-28 + grayRange = -10; + greenRange = -8; } - else if (level() < 34) - { // - greenRange = -12; - cyanRange = -9; + else if (level() < 33) + { // 29-32 + grayRange = -11; + greenRange = -9; } else if (level() < 37) - { // - greenRange = -13; - cyanRange = -10; + { // 33-36 + grayRange = -13; + greenRange = -10; } else if (level() < 41) { // 37 - 40 - greenRange = -14; - cyanRange = -11; + grayRange = -14; + greenRange = -11; } else if (level() < 45) { // 41 - 44 - greenRange = -16; - cyanRange = -12; + grayRange = -16; + greenRange = -12; } else if (level() < 49) { // 45 - 48 - greenRange = -17; - cyanRange = -13; + grayRange = -17; + greenRange = -13; } else if (level() < 53) { // 49 - 52 - greenRange = -18; - cyanRange = -14; - } - else if (level() < 55) - { // 52 - 54 - greenRange = -19; - cyanRange = -15; + grayRange = -18; + greenRange = -14; } else if (level() < 57) - { // 55 - 56 - greenRange = -20; - cyanRange = -15; + { // 53 - 56 + grayRange = -20; + greenRange = -15; } - else if (level() < 71) - { //57 - 70 - greenRange = -21; - cyanRange = -16; + else + { // 57+ + grayRange = -21; + greenRange = -16; } uint8_t spawnLevel = 1; uint8_t scale; - uint8_t greenBase = m_conColorBases[tGreenSpawn].green(); - uint8_t greenScale = 255 - greenBase; - for (; spawnLevel <= (greenRange + level()); spawnLevel++) - { // this loop handles all GREEN cons - if (spawnLevel <= (greenRange + level() - 5)) - m_conTable[spawnLevel] = m_conColorBases[tGreenSpawn]; - else - { - scale = greenScale/(greenRange + level() - spawnLevel + 1); - m_conTable[spawnLevel] = QColor(m_conColorBases[tGreenSpawn].red(), - (greenBase + scale), - m_conColorBases[tGreenSpawn].blue()); - } + // Gray spawns. No gradient. + for (; spawnLevel <= grayRange + level(); spawnLevel++) + { + m_conTable[spawnLevel] = m_conColorBases[tGraySpawn]; } - for (; spawnLevel <= cyanRange + level(); spawnLevel++) - { // light blue cons, no need to gradient a small range + // Green spawns. No gradient since green is small. + for (; spawnLevel <= greenRange + level(); spawnLevel++) + { + m_conTable[spawnLevel] = m_conColorBases[tGreenSpawn]; + } + + // Light blue spawns. Again, no gradient. Light blue is + // blue, but under 5 levels below, so for levels where there is + // no light blue, this is negative. + for (; spawnLevel < level() - 5; spawnLevel++) + { m_conTable[spawnLevel] = m_conColorBases[tCyanSpawn]; } - uint8_t blueBase = m_conColorBases[tBlueSpawn].blue(); - uint8_t blueScale = 255 - blueBase; + // Blue spawns. Just 5 levels in here. So again, no gradient. for (; spawnLevel < level(); spawnLevel++) - { // blue cons here - scale = blueScale/(level() - spawnLevel); - m_conTable[spawnLevel] = QColor(m_conColorBases[tBlueSpawn].red(), - m_conColorBases[tBlueSpawn].green(), - (blueBase + scale)); + { + m_conTable[spawnLevel] = m_conColorBases[tBlueSpawn]; } - m_conTable[spawnLevel++] = m_conColorBases[tEvenSpawn]; // even con - m_conTable[spawnLevel++] = m_conColorBases[tYellowSpawn]; // yellow con - m_conTable[spawnLevel++] = QColor(m_conColorBases[tYellowSpawn].red(), - m_conColorBases[tYellowSpawn].green() - 30, - m_conColorBases[tYellowSpawn].blue()); // yellow con + // Even is our level, natch. + m_conTable[spawnLevel++] = m_conColorBases[tEvenSpawn]; + + // 3 levels of yellow. + for (; spawnLevel < level() + 4; spawnLevel++) + { + m_conTable[spawnLevel++] = m_conColorBases[tYellowSpawn]; + } + // Finally, red spawns. Gradient this. uint8_t redBase = m_conColorBases[tRedSpawn].red(); uint8_t redScale = 255 - redBase; + for (; spawnLevel < maxSpawnLevel; spawnLevel++) - { // red cons - if (spawnLevel > level() + 13) + { + if (spawnLevel > level() + 9) + { m_conTable[spawnLevel] = m_conColorBases[tRedSpawn]; + } else { - scale = redScale/(spawnLevel - level() - 2); - m_conTable[spawnLevel] = QColor((redBase + scale), + scale = redScale*(spawnLevel - level() - 4) / 6; + m_conTable[spawnLevel] = QColor((255 - scale), m_conColorBases[tRedSpawn].green(), m_conColorBases[tRedSpawn].blue()); } Index: spawn.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/spawn.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- spawn.cpp 13 Sep 2005 15:23:13 -0000 1.33 +++ spawn.cpp 30 Sep 2006 21:18:25 -0000 1.34 @@ -43,6 +43,8 @@ const int animationCoefficientFixPt = fixPtToFixed<int, float>(animationCoefficient, qFormat); +const EquipStruct SlotEmpty = { 0, 0, 0 }; + //---------------------------------------------------------------------- // Handy utility functions // static @@ -263,7 +265,7 @@ setTypeflag(0); setGM(0); for (int i = 0; i < tNumWearSlots; i++) - setEquipment(i, 0); + setEquipment(i, SlotEmpty); // just clear the considred flag since data would be outdated setConsidered(false); @@ -313,7 +315,7 @@ setGuildID(0xffff); setGuildTag(NULL); for (int i = 0; i < tNumWearSlots; i++) - setEquipment(i, 0); + setEquipment(i, SlotEmpty); setTypeflag(0); setGM(0); setConsidered(false); @@ -367,7 +369,7 @@ setLevel(s.level()); for (int i = 0; i <= tLastCoreWearSlot; i++) setEquipment(i, s.equipment(i)); - setEquipment(tUnknown1, 0); + setEquipment(tUnknown1, SlotEmpty); setTypeflag(s.typeflag()); setGM(s.gm()); setNPC(s.NPC()); @@ -411,7 +413,7 @@ setLevel(s->level); for (int i = 0; i <= tLastCoreWearSlot; i++) setEquipment(i, s->equipment[i]); - setEquipment(tUnknown1, 0); + setEquipment(tUnknown1, SlotEmpty); setTypeflag(s->bodytype); setGM(s->gm); @@ -424,8 +426,8 @@ setAnimation(s->animation); - // only non corpses and things with animation != 66 move - if (!isCorpse() && (s->animation != 66)) + // only non corpses move + if (!isCorpse()) { setDeltas(s->deltaX >> 2, s->deltaY >> 2, s->deltaZ >> 2); setHeading(s->heading, s->deltaHeading); @@ -498,7 +500,7 @@ // only change unknown equipment for (i = 0; i <= tLastCoreWearSlot; i++) - if (equipment(i) == 0) + if (equipment(i).itemId == SlotEmpty.itemId) setEquipment(i, s->equipment[i]); // only change unknown or no light @@ -605,11 +607,11 @@ QString Spawn::equipmentStr(uint8_t wearingSlot) const { if (wearingSlot <= tLastMaterial) - return print_material(equipment(wearingSlot)); + return print_material(equipment(wearingSlot).itemId); else if (wearingSlot <= tLastWeapon) - return print_item(equipment(wearingSlot)); + return print_item(equipment(wearingSlot).itemId); else if (wearingSlot < tNumWearSlots) - return print_material(equipment(wearingSlot)); + return print_material(equipment(wearingSlot).itemId); else return ""; } @@ -824,22 +826,22 @@ // Worn stuff for (i = tFirstMaterial; i <= tLastMaterial ; i++) - if (equipment(i)) - temp += QString(locs[i]) + ":" + print_material(equipment(i)) + " "; + if (equipment(i).itemId != SlotEmpty.itemId) + temp += QString(locs[i]) + ":" + print_material(equipment(i).itemId) + " "; // Worn weapons for (i = tFirstWeapon; i <= tLastWeapon; i++) - if (equipment(i)) - temp += QString(locs[i]) + ":" + + print_item(equipment(i)) + " "; + if (equipment(i).itemId != SlotEmpty.itemId) + temp += QString(locs[i]) + ":" + + print_item(equipment(i).itemId) + " "; // Worn stuff -- Current best quess is that this may be material? i = tUnknown1; - if (equipment(i)) - temp += QString(locs[i]) + ":" + print_material(equipment(i)) + " "; + if (equipment(i).itemId != SlotEmpty.itemId) + temp += QString(locs[i]) + ":" + print_material(equipment(i).itemId) + " "; #if 1 // print also as slot U1 (Unknown1) until we're positive - if (equipment(i)) - temp += QString("U1:U") + QString::number(equipment(i), 16) + " "; + if (equipment(i).itemId != SlotEmpty.itemId) + temp += QString("U1:U") + QString::number(equipment(i).itemId, 16) + " "; #endif return temp; Index: races.h =================================================================== RCS file: /cvsroot/seq/showeq/src/races.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- races.h 27 Feb 2006 23:16:47 -0000 1.16 +++ races.h 30 Sep 2006 21:18:25 -0000 1.17 @@ -526,4 +526,34 @@ "Nightmare/Unicorn", // 517 "Horse", // 518 "Nightmare/Unicorn", // 519 + "Bixie", // 520 + "Centaur", // 521 + "Drakkin", // 522 + "Giant", // 523 + "Gnoll", // 524 + "Griffin", // 525 + "Giant Shade", // 526 + "Harpy", // 527 + "Mammoth", // 528 + "Satyr", // 529 + "Dragon", // 530 + "Dragon", // 531 + "Dyn'Leth", // 532 + "Boat", // 533 + "Weapon Rack", // 534 + "Armor Rack", // 535 + "Honey Pot", // 536 + "Jum Jum Bucket", // 537 + "Plant", // 538 + "Plant", // 539 + "Plant", // 540 + "Toolbox", // 541 + "Wine Cask", // 542 + "Stone Jug", // 543 + "Elven Boat", // 544 + "Gnomish Boat", // 545 + "Undead Boat", // 546 + "Goo", // 547 + "Goo", // 548 + "Goo", // 549 #endif Index: spawn.h =================================================================== RCS file: /cvsroot/seq/showeq/src/spawn.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- spawn.h 13 Sep 2005 15:23:13 -0000 1.20 +++ spawn.h 30 Sep 2006 21:18:25 -0000 1.21 @@ -233,7 +233,7 @@ int16_t deityTeam() const { return m_deityTeam; } int16_t raceTeam() const { return m_raceTeam; } bool considered() const { return m_considered; } - uint16_t equipment(uint8_t wearingSlot) const + EquipStruct equipment(uint8_t wearingSlot) const { return m_equipment[wearingSlot]; } QString equipmentStr(uint8_t wearingSlot) const; uint8_t typeflag() const { return m_typeflag; } @@ -317,8 +317,8 @@ void setGuildID(uint16_t GuildID) { m_guildID = GuildID; } void setGuildTag(QString GuildTag) { m_guildTag = GuildTag; } void setLevel(uint8_t level) { m_level = level; } - void setEquipment(uint8_t wearSlot, uint16_t itemID) - { if (wearSlot < tNumWearSlots) { m_equipment[wearSlot] = itemID; } } + void setEquipment(uint8_t wearSlot, EquipStruct item) + { if (wearSlot < tNumWearSlots) { m_equipment[wearSlot] = item; } } void setNPC(uint8_t NPC) { m_NPC = NPC; } void setTypeflag(uint8_t typeflag) { m_typeflag = typeflag; } void setGM(uint8_t gm) { m_gm = gm; } @@ -353,7 +353,7 @@ uint16_t m_guildID; uint16_t m_deity; int16_t m_deityTeam; - uint16_t m_equipment[tNumWearSlots]; + EquipStruct m_equipment[tNumWearSlots]; uint16_t m_race; int16_t m_raceTeam; uint8_t m_level; Index: weapons29.h =================================================================== RCS file: /cvsroot/seq/showeq/src/weapons29.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- weapons29.h 28 Oct 2005 06:25:46 -0000 1.3 +++ weapons29.h 30 Sep 2006 21:18:26 -0000 1.4 @@ -155,8 +155,8 @@ NULL, // 0x92 NULL, // 0x93 NULL, // 0x94 - NULL, // 0x95 - NULL, // 0x96 + "Book", // 0x95 + "Book", // 0x96 NULL, // 0x97 NULL, // 0x98 NULL, // 0x99 Index: mapicon.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/mapicon.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mapicon.cpp 17 Sep 2005 01:47:55 -0000 1.3 +++ mapicon.cpp 30 Sep 2006 21:18:25 -0000 1.4 @@ -701,7 +701,7 @@ true, false, false, true); m_mapIcons[tIconTypeSpawnPoint] .setImage(QBrush(SolidPattern), QPen(darkGray, 1, SolidLine, cap, join), - tIconStylePlus, tIconSizeSmall, + tIconStylePlus, tIconSizeRegular, true, true, false, false); m_mapIcons[tIconTypeSpawnPointSelected] .setHighlight(QBrush(NoBrush), QPen(blue, 1, SolidLine, cap, join), @@ -1273,6 +1273,7 @@ return Qt::magenta; case 66: case 67: + case 100: return Qt::darkMagenta; default: break; Index: typenames.h =================================================================== RCS file: /cvsroot/seq/showeq/src/typenames.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- typenames.h 13 Sep 2005 15:23:14 -0000 1.5 +++ typenames.h 30 Sep 2006 21:18:26 -0000 1.6 @@ -75,5 +75,37 @@ "Timer", // 66 "EventTrigger", // 67 NULL, // 68 + NULL, // 69 + NULL, // 70 + NULL, // 71 + NULL, // 72 + NULL, // 73 + NULL, // 74 + NULL, // 75 + NULL, // 76 + NULL, // 77 + NULL, // 78 + NULL, // 79 + NULL, // 80 + NULL, // 81 + NULL, // 82 + NULL, // 83 + NULL, // 84 + NULL, // 85 + NULL, // 86 + NULL, // 87 + NULL, // 88 + NULL, // 89 + NULL, // 90 + NULL, // 91 + NULL, // 92 + NULL, // 93 + NULL, // 94 + NULL, // 95 + NULL, // 96 + NULL, // 97 + NULL, // 968 + NULL, // 99 + "None", // 100 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ Index: weapons2b.h =================================================================== RCS file: /cvsroot/seq/showeq/src/weapons2b.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- weapons2b.h 13 Sep 2005 15:23:14 -0000 1.2 +++ weapons2b.h 30 Sep 2006 21:18:26 -0000 1.3 @@ -54,15 +54,15 @@ NULL, // 0x2d NULL, // 0x2e NULL, // 0x2f - NULL, // 0x30 + "Plant", // 0x30 NULL, // 0x31 - NULL, // 0x32 - NULL, // 0x33 - NULL, // 0x34 + "Bone", // 0x32 + "Books", // 0x33 + "Leaf", // 0x34 NULL, // 0x35 NULL, // 0x36 NULL, // 0x37 - NULL, // 0x38 + "Rock", // 0x38 NULL, // 0x39 NULL, // 0x3a NULL, // 0x3b @@ -71,7 +71,7 @@ NULL, // 0x3e NULL, // 0x3f NULL, // 0x40 - NULL, // 0x41 + "Books", // 0x41 NULL, // 0x42 NULL, // 0x43 NULL, // 0x44 Index: spawnshell.h =================================================================== RCS file: /cvsroot/seq/showeq/src/spawnshell.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- spawnshell.h 10 Dec 2005 23:27:15 -0000 1.23 +++ spawnshell.h 30 Sep 2006 21:18:25 -0000 1.24 @@ -106,6 +106,7 @@ void newSpawn(const uint8_t* spawn); void newSpawn(const spawnStruct& s); void playerUpdate(const uint8_t*pupdate, size_t, uint8_t); + void npcMoveUpdate(const uint8_t*npcupdate, size_t, uint8_t); void updateSpawn(uint16_t id, int16_t x, int16_t y, int16_t z, int16_t xVel, int16_t yVel, int16_t zVel, Index: netstream.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/netstream.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- netstream.cpp 13 Sep 2005 15:23:12 -0000 1.2 +++ netstream.cpp 30 Sep 2006 21:18:25 -0000 1.3 @@ -157,5 +157,98 @@ return QString(); } +BitStream::BitStream(const uint8_t* data, size_t length) + : m_data(data) +{ + // Length in bits. + m_totalBits = length * 8; + + reset(); +} + +BitStream::~BitStream() +{ +} + +void BitStream::reset() +{ + m_currentBit = 0; +} + +uint32_t BitStream::readUInt(size_t bitCount) +{ + // Make sure we have the bits first. + if (m_currentBit + bitCount > m_totalBits) + { + return 0; + } + + const uint8_t* currentByte = m_data + (m_currentBit >> 3); + uint32_t out = 0; + + // Partial bytes in the lead and end. Full bytes in the middle. + size_t leadPartialBitCount = 8 - (m_currentBit % 8); + size_t middleByteCount; + size_t tailPartialBitCount; + + if (leadPartialBitCount == 8) + { + // Lead partial is a byte. So just put it in the middle. + leadPartialBitCount = 0; + } + + if (leadPartialBitCount > bitCount) + { + // All the bits we need are in the lead partial. Note that when + // the lead partial is byte aligned, this won't process it. Instead + // it will be handled by the tailPartialBitCount. + out = *currentByte & ((1 << leadPartialBitCount) - 1); + m_currentBit += bitCount; + return out >> (leadPartialBitCount - bitCount); + } + else + { + // Spanning multiple bytes. leadPartialBitCount is correct. + // Calculate middle and tail. + middleByteCount = (bitCount - leadPartialBitCount) / 8; + tailPartialBitCount = + bitCount - (leadPartialBitCount + middleByteCount*8); + } + + if (leadPartialBitCount > 0) + { + // Pull in partial from the lead byte + out |= *currentByte & ((1 << leadPartialBitCount) - 1); + currentByte++; + } + + // Middle + for (size_t i=0; i<middleByteCount; i++) + { + out = (out << 8) | *currentByte; + currentByte++; + } + + // And the end. + if (tailPartialBitCount > 0) + { + out = (out << tailPartialBitCount) | + (*currentByte >> (8 - tailPartialBitCount)); + } + + // Update the current bit + m_currentBit += bitCount; + + return out; +} + +int32_t BitStream::readInt(size_t bitCount) +{ + // Sign + uint32_t sign = readUInt(1); + uint32_t retval = readUInt(bitCount - 1); + + return retval * (sign ? -1 : 1); +} Index: spawnlistcommon.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/spawnlistcommon.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- spawnlistcommon.cpp 13 Sep 2005 15:23:13 -0000 1.7 +++ spawnlistcommon.cpp 30 Sep 2006 21:18:25 -0000 1.8 @@ -387,6 +387,7 @@ return; case 66: case 67: + case 100: m_textColor = Qt::darkMagenta; return; } Index: interface.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/interface.cpp,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- interface.cpp 2 Mar 2006 01:03:14 -0000 1.75 +++ interface.cpp 30 Sep 2006 21:18:24 -0000 1.76 @@ -1004,9 +1004,11 @@ // Con Color base menu QPopupMenu* conColorBaseMenu = new QPopupMenu; + x = conColorBaseMenu->insertItem("Gray Spawn Base..."); + conColorBaseMenu->setItemParameter(x, tGraySpawn); x = conColorBaseMenu->insertItem("Green Spawn Base..."); conColorBaseMenu->setItemParameter(x, tGreenSpawn); - x = conColorBaseMenu->insertItem("Cyan Spawn Base..."); + x = conColorBaseMenu->insertItem("Light Blue Spawn Base..."); conColorBaseMenu->setItemParameter(x, tCyanSpawn); x = conColorBaseMenu->insertItem("Blue Spawn Base..."); conColorBaseMenu->setItemParameter(x, tBlueSpawn); @@ -1120,7 +1122,7 @@ // Character -> Level m_charLevelMenu = new QPopupMenu; m_charMenu->insertItem("Choose &Level", m_charLevelMenu); - m_levelSpinBox = new QSpinBox(1, 70, 1, this, "m_levelSpinBox"); + m_levelSpinBox = new QSpinBox(1, 75, 1, this, "m_levelSpinBox"); m_charLevelMenu->insertItem( m_levelSpinBox ); m_levelSpinBox->setWrapping( true ); m_levelSpinBox->setButtonSymbols(QSpinBox::PlusMinus); @@ -2021,6 +2023,9 @@ m_packet->connect2("OP_Consider", SP_Zone, DIR_Server|DIR_Client, "considerStruct", SZC_Match, m_spawnShell, SLOT(consMessage(const uint8_t*, size_t, uint8_t))); + m_packet->connect2("OP_NpcMoveUpdate", SP_Zone, DIR_Server, + "uint8_t", SZC_None, + m_spawnShell, SLOT(npcMoveUpdate(const uint8_t*, size_t, uint8_t))); m_packet->connect2("OP_ClientUpdate", SP_Zone, DIR_Server, "playerSpawnPosStruct", SZC_Match, m_spawnShell, SLOT(playerUpdate(const uint8_t*, size_t, uint8_t))); Index: spawnshell.cpp =================================================================== RCS file: /cvsroot/seq/showeq/src/spawnshell.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- spawnshell.cpp 16 Jun 2006 13:36:35 -0000 1.47 +++ spawnshell.cpp 30 Sep 2006 21:18:25 -0000 1.48 @@ -22,6 +22,7 @@ #include "guild.h" #include "packetcommon.h" #include "diagnosticmessages.h" +#include "netstream.h" #include <qfile.h> #include <qdatastream.h> @@ -642,6 +643,113 @@ } } +void SpawnShell::npcMoveUpdate(const uint8_t* data, size_t len, uint8_t dir) +{ +/* + * Wire format: + * 2 bytes - spawnId + * 6 bit - fieldSpecifier bitmask + * 19 bit ... [truncated message content] |