its done the item blue stats that change with every expansion or added content are now store in the db and will display correctly between clients (once its committed)
it is written to be consistent between major expansions/updates ie right now dov, coe, tov and KA, so if DBG decided to change or add a Blue state tommorrow it will go with the KA stats here is a master list of what you should use in your item_stats DB ,
the first column is the type 6 subtype you will use in your item_stats table which is consistant with what already there(should be) this is internal to eq2emu and will not have to ever change, some will be added but not deleted
column2 is the internal eq2emu name (the part after ITEM_STAT_ should match eq2live internal name(from census)
column3 is the expansion/client specific type/subtpe this is what we send to the client so that they are display on items correctly
column4 is the Display name used in the client
you will notice that many of column 3 are 6999, this is just an indicator that this stat is not used in a particular client anymore and will keep it from being displayed in that particular client
any question please ask, the changes to make this happen now are listed at bottom
Code: Select all
0 ITEM_STAT_HPREGEN 600 Health Regeneration
1 ITEM_STAT_MANAREGEN 601 Power Regeneration
2 ITEM_STAT_HPREGENPPT 602 Out-of-Combat Health Generation
3 ITEM_STAT_MPREGENPPT 603 Out-of-Combat Power Regeneration
4 ITEM_STAT_COMBATHPREGENPPT 604 In-Combat Health Generation
5 ITEM_STAT_COMBATMPREGENPPT 605 In-Combat Power Generation
6 ITEM_STAT_MAXHP 606 Max Health
7 ITEM_STAT_MAXHPPERC 607 % Max Health
8 ITEM_STAT_MAXHPPERCFINAL 608 % Max Health
9 ITEM_STAT_SPEED 609 Out of Combat Run Speed
10 ITEM_STAT_SLOW 610 Slow
11 ITEM_STAT_MOUNTSPEED 611 Ground Mount Speed
12 ITEM_STAT_MOUNTAIRSPEED 612 Mount Air Speed
13 ITEM_STAT_LEAPSPEED 613 Leap Climb Rate
14 ITEM_STAT_LEAPTIME 614 Leap Time
15 ITEM_STAT_GLIDEEFFICIENCY 615 Glide Efficiency
16 ITEM_STAT_OFFENSIVESPEED 616 In Combat Run Speed
17 ITEM_STAT_ATTACKSPEED 617 Attack Speed
18 ITEM_STAT_SPELLWEAPONATTACKSPEED 6999 Spell Weapon Attack Speed
19 ITEM_STAT_MAXMANA 618 Max Power
20 ITEM_STAT_MAXMANAPERC 619 % Max Power
21 ITEM_STAT_MAXATTPERC 620 All Attributes
22 ITEM_STAT_BLURVISION 621 Blurs Vision
23 ITEM_STAT_MAGICLEVELIMMUNITY 622 Magic Level Immunity
24 ITEM_STAT_HATEGAINMOD 623 Hate Gain
25 ITEM_STAT_COMBATEXPMOD 624 Combat XP Gain
26 ITEM_STAT_TRADESKILLEXPMOD 625 Tradskill XP Gain
27 ITEM_STAT_ACHIEVEMENTEXPMOD 626 AA XP Gain
124 ITEM_STAT_STATUSEARNED 627 Status Earned
28 ITEM_STAT_SIZEMOD 628 Size
29 ITEM_STAT_DPS 629 Damage Per Second
30 ITEM_STAT_SPELLWEAPONDPS 6999 Spell Weapon Damage Per Second
31 ITEM_STAT_STEALTH 630 Stealth
32 ITEM_STAT_INVIS 631 Invisibility
33 ITEM_STAT_SEESTEALTH 632 See Stealth
34 ITEM_STAT_SEEINVIS 633 See Invisible
35 ITEM_STAT_EFFECTIVELEVELMOD 634 Effective Level
36 ITEM_STAT_RIPOSTECHANCE 635 Extra Reposte Chance
37 ITEM_STAT_PARRYCHANCE 636 Extra Parry Chance
38 ITEM_STAT_DODGECHANCE 637 Extra Dodge Change
39 ITEM_STAT_AEAUTOATTACKCHANCE 638 AE Autoattack Chance
40 ITEM_STAT_SPELLWEAPONAEAUTOATTACKCHANCE 6999 Spell Weapon AE Autoattack Chance
41 ITEM_STAT_DOUBLEATTACKCHANCE 639 Multi Attack Chance
42 ITEM_STAT_PVPDOUBLEATTACKCHANCE 6999 PvP Multi Attack Chance
43 ITEM_STAT_SPELLWEAPONAEAUTOATTACKCHANCE 6999 Spell Weapon Multi Attack Chance
44 ITEM_STAT_PVPSPELLWEAPONDOUBLEATTACKCHANCE 6999 Pvp Spell Weapon Multi Attack Chance
45 ITEM_STAT_SPELLDOUBLEATTACKCHANCE 640 Double Cast Chance
122 ITEM_STAT_ABILITYDOUBLECASTCHANCE 641 Ability Doublecast Chance
46 ITEM_STAT_PVPSPELLDOUBLEATTACKCHANCE 6999 Pvp Doublecast Chance
47 ITEM_STAT_FLURRY 642 Flurry Chance
48 ITEM_STAT_SPELLWEAPONFLURRY 6999 Spell Weapon Flurry Chance
49 ITEM_STAT_MELEEDAMAGEMULTIPLIER 643 Melee Damage Multiplier
50 ITEM_STAT_EXTRAHARVESTCHANCE 644 Bountiful Harvest
51 ITEM_STAT_EXTRASHIELDBLOCKCHANCE 645 Block Chance
52 ITEM_STAT_ITEMHPREGENPPT 646 In-Combat Health Regeneration
53 ITEM_STAT_ITEMPPREGENPPT 647 In-Combat Power Regeneration
54 ITEM_STAT_MELEECRITCHANCE 648 Crit Chance
55 ITEM_STAT_CRITAVOIDANCE 649 Crit Avoidance
56 ITEM_STAT_BENEFICIALCRITCHANCE 650 Beneficial Crit Chance
57 ITEM_STAT_CRITBONUS 651 Crit Bonus
58 ITEM_STAT_PVPCRITBONUS 6999 PvP Crit Bonus
59 ITEM_STAT_BASEMODIFIER 652 Potency
60 ITEM_STAT_PVPBASEMODIFIER 6999 PvP Potency
61 ITEM_STAT_UNCONSCIOUSHPMOD 653 Unconcious Health
62 ITEM_STAT_SPELLTIMEREUSEPCT 654 Ability Reuse Speed
63 ITEM_STAT_SPELLTIMERECOVERYPCT 655 Ability Recovery Speed
64 ITEM_STAT_SPELLTIMECASTPCT 656 Ability Casting Speed
65 ITEM_STAT_SPELLTIMEREUSESPELLONLY 657 Spell Reuse Speed
66 ITEM_STAT_MELEEWEAPONRANGE 658 Melee Weapon Range Increase
67 ITEM_STAT_RANGEDWEAPONRANGE 659 Rnanged Weapon Range Increase
68 ITEM_STAT_FALLINGDAMAGEREDUCTION 660 Falling Damage Reduction
69 ITEM_STAT_RIPOSTEDAMAGE 661 Riposte Damage
70 ITEM_STAT_MINIMUMDEFLECTIONCHANCE 662 Minimum Block Chance
71 ITEM_STAT_MOVEMENTWEAVE 663 Movement Weave
72 ITEM_STAT_COMBATHPREGEN 664 Combat HP Regen
73 ITEM_STAT_COMBATMANAREGEN 665 Combat Mana Regen
74 ITEM_STAT_CONTESTSPEEDBOOST 666 Contest Only Speed
75 ITEM_STAT_TRACKINGAVOIDANCE 667 Tracking avoidance
76 ITEM_STAT_STEALTHINVISSPEEDMOD 668 Movement Bonus while Stealthed or Invisible
77 ITEM_STAT_LOOT_COIN 669 Loot Coin
78 ITEM_STAT_ARMORMITIGATIONINCREASE 670 Mitigation Increase
79 ITEM_STAT_AMMOCONSERVATION 671 Ammo Conservation
80 ITEM_STAT_STRIKETHROUGH 672 Strikethrough
81 ITEM_STAT_STATUSBONUS 673 Status Bonus
82 ITEM_STAT_ACCURACY 674 Accuracy
83 ITEM_STAT_COUNTERSTRIKE 675 Counter Strike
84 ITEM_STAT_SHIELDBASH 676 Shield Bash
85 ITEM_STAT_WEAPONDAMAGEBONUS 677 Weapon Damage Bonus
102 ITEM_STAT_SPELLWEAPONDAMAGEBONUS 6999
86 ITEM_STAT_WEAPONDAMAGEBONUSMELEEONLY 678 Weapon Damage Bonus Melee Only
87 ITEM_STAT_ADDITIONALRIPOSTECHANCE 679 Additional chance to Riposte
88 ITEM_STAT_CRITICALMITIGATION 6999
89 ITEM_STAT_PVPTOUGHNESS 681 Toughness
90 ITEM_STAT_PVPLETHALITY 682 Lethality
91 ITEM_STAT_STAMINABONUS 683 Stamina Bonus
92 ITEM_STAT_WISDOMMITBONUS 684 Wisdom Mitigation Bonus
93 ITEM_STAT_HEALRECEIVE 685 Applied Heals
94 ITEM_STAT_HEALRECEIVEPERC 686 % Applied Heals
95 ITEM_STAT_PVPCRITICALMITIGATION 687 PvP Critical Mitigation
96 ITEM_STAT_BASEAVOIDANCEBONUS 688 Base Avoidance Bonus
97 ITEM_STAT_INCOMBATSAVAGERYREGEN 689 In-Combat Savagery Regen
98 ITEM_STAT_OUTOFCOMBATSAVAGERYREGEN 690 Out-of-Combat Savagery Regen
99 ITEM_STAT_SAVAGERYREGEN 691 Savagery Regen
100 ITEM_STAT_SAVAGERYGAINMOD 692 Savagery Gain Mod
101 ITEM_STAT_MAXSAVAGERYLEVEL 693 Max Savagery Level
103 ITEM_STAT_INCOMBATDISSONANCEREGEN 694 In-Combat Dissonance Regen
104 ITEM_STAT_OUTOFCOMBATDISSONANCEREGEN 695 Out -of-Combat Dissonance Regen
105 ITEM_STAT_DISSONANCEREGEN 696 Dissonance Regen
106 ITEM_STAT_DISSONANCEGAINMOD 697 Dissonance Gain Mod
107 ITEM_STAT_AEAUTOATTACKAVOID 698 AE Auto Attack Avoid Chance
108 ITEM_STAT_AGNOSTICDAMAGEBONUS 699 Agnostic Damage Bonus
109 ITEM_STAT_AGNOSTICHEALBONUS 6100 Agnostic Heal Bonus
110 ITEM_STAT_TITHEGAIN 6101 Tithe Gain
111 ITEM_STAT_FERVER 6102 Ferver
112 ITEM_STAT_RESOLVE 6103 Resolve
113 ITEM_STAT_COMBATMITIGATION 6104 Combat Mitigation
114 ITEM_STAT_ABILITYMITIGATION 6105 Ability Mitigation
115 ITEM_STAT_MULTIATTACKAVOIDANCE 6106 Multi Attack Avoidance
116 ITEM_STAT_DOUBLECASTAVOIDANCE 6107 Doublecast Avoidance
117 ITEM_STAT_ABILITYDOUBLECASTAVOIDANCE 6108 Ability Doublecast Avoidance
118 ITEM_STAT_DAMAGEPERSECONDMITIGATION 6109 Damage Per Second Mitigation
119 ITEM_STAT_FERVERMITIGATION 6110 Ferver Mitigation
120 ITEM_STAT_FLURRYAVOIDANCE 6111 Flurry Avoidance
121 ITEM_STAT_WEAPONDAMAGEBONUSMITIGATION 6111 Weapon Damage Bonus Mitigation
123 ITEM_STAT_ABILITYMODIFIERMITIGATATION 6112 Ability Modifier Mitigation
Want it now
add this table to your world db
itemstats.zip
update world.h with
Code: Select all
int32 LoadItemBlueStats();
sint16 GetItemStatTOVValue(sint16 subtype);
sint16 GetItemStatDOVValue(sint16 subtype);
sint16 GetItemStatCOEValue(sint16 subtype);
sint16 GetItemStatKAValue(sint16 subtype);
sint16 GetItemStatTESTValue(sint16 subtype);
update world.cpp with
Code: Select all
sint16 World::GetItemStatTOVValue(sint16 subtype) {
return (tov_itemstat_conversion[subtype] - 600);
}
sint16 World::GetItemStatDOVValue(sint16 subtype) {
return (dov_itemstat_conversion[subtype] - 600);
}
sint16 World::GetItemStatCOEValue(sint16 subtype) {
return (coe_itemstat_conversion[subtype] - 600);
}
sint16 World::GetItemStatKAValue(sint16 subtype) {
return (ka_itemstat_conversion[subtype] - 600);
and
change this (add one line comment out or delete the other
Code: Select all
LoadItemBlueStats();//new
//PopulateTOVStatMap();//old
and add this ( i really would like this in worlddatabase.cpp but for some reason could not get it to work it did not have acces to update itemstat_conversion arrays) so Jab if you could possibly show how to get them over
Code: Select all
int32 World::LoadItemBlueStats()
{
Query query;
MYSQL_ROW row;
int32 count = 0;
MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT version_range1,version_range2,emu_stat,name,stat from itemstats");
if (result && mysql_num_rows(result) > 0)
{
while (result && (row = mysql_fetch_row(result)))
{
count++;
//LogWrite(SKILL__DEBUG, 5, "Blue Stats", "Loading SkillID: %u, cur_val: %i, max_val: %l", strtoul(row[0], NULL, 0), atoi(row[1]), atoi(row[2]));
if (atoi(row[0]) >= 63137) { //TEST
ka_itemstat_conversion[atoi(row[2])] = atoi(row[4]);
}
else if(atoi(row[0]) >= 63119) { //KA
ka_itemstat_conversion[atoi(row[2])] = atoi(row[4]);
}
else if (atoi(row[0]) >= 57101){
tov_itemstat_conversion[atoi(row[2])] = atoi(row[4]);
}
else if (atoi(row[0]) >= 1193){
coe_itemstat_conversion[atoi(row[2])] = atoi(row[4]);
}
else if (atoi(row[0]) >= 1096){
dov_itemstat_conversion[atoi(row[2])] = atoi(row[4]);
}
}
}
return count;
}
and finally (ememjr prays he didnt miss anything)
in items.cpp swap out the code stating with if(item_stats.size() > 0){ and ending with just befoe the SF client comment
now there will be someone that asks , it looks as though there is duplicate code here, well kinda there is
since we dont know which client a player is using before the world is loaded, all blue stats are loaded for an item even if its not used by a client, ie ITEM2 has ferver along with 5 other stats for a total of 6 displayed stats, well if your using dov there are only 5 displayed stats but the stat count is 6
the first run goes through the stats and checks if your client supports it and decreases the stat count so that the struct array will be built correctly for the packet. the second run builds the packet skipping unneeded stats (again if anyone sees a better way to accomplish this, please share
Code: Select all
packet->setSubstructDataByName("header_info", "unique_id", details.unique_id);
packet->setSubstructDataByName("header_info", "icon", details.icon);
packet->setSubstructDataByName("header_info", "tier", details.tier);
packet->setSubstructDataByName("header_info", "flags", generic_info.item_flags);
packet->setSubstructDataByName("header_info", "flags2", generic_info.item_flags2);
if(item_stats.size() > 0){
//packet->setSubstructArrayLengthByName("header_info", "stat_count", item_stats.size());
int8 dropstat = 0;
for (int32 i = 0; i < item_stats.size(); i++){
ItemStat* stat = item_stats[i];
if (stat->stat_type == 6){ //Convert stats to proper client
if (client->GetVersion() >= 63137){ //TEST
tmp_subtype =stat->stat_subtype;
}
else if(client->GetVersion() >= 63119){ //KA
tmp_subtype = world.GetItemStatKAValue(stat->stat_subtype);
}
else if (client->GetVersion() >= 57107){ //TOV
tmp_subtype = world.GetItemStatTOVValue(stat->stat_subtype);
}
else if (client->GetVersion() >= 1193){ //COE
tmp_subtype = world.GetItemStatCOEValue(stat->stat_subtype);
//tmp_subtype = stat->stat_subtype;
}
else if (client->GetVersion() >= 1096){ //DOV
tmp_subtype = world.GetItemStatDOVValue(stat->stat_subtype);
//tmp_subtype = stat->stat_subtype; //comment for normal use
}
}
else
tmp_subtype = stat->stat_subtype;
if (tmp_subtype == 255){
dropstat += 1;
}
}
packet->setSubstructArrayLengthByName("header_info", "stat_count", item_stats.size() - dropstat);
dropstat = 0;
for(int32 i=0;i<item_stats.size();i++){
ItemStat* stat = item_stats[i];
if(stat->stat_name.length() > 0)
packet->setArrayDataByName("stat_name", stat->stat_name.c_str(), i);
if (stat->stat_type == 6){ //Convert stats to proper client
if (client->GetVersion() >= 63137){ //TEST
tmp_subtype = stat->stat_subtype;
}
else if (client->GetVersion() >= 63119){ //KA
tmp_subtype = world.GetItemStatKAValue(stat->stat_subtype);
}
else if (client->GetVersion() >= 57107){ //TOV
tmp_subtype = world.GetItemStatTOVValue(stat->stat_subtype);
}
else if (client->GetVersion() >= 1193){ //COE
tmp_subtype = world.GetItemStatCOEValue(stat->stat_subtype);
//tmp_subtype = stat->stat_subtype;
}
else if (client->GetVersion() >= 1096){ //DOV
tmp_subtype = world.GetItemStatDOVValue(stat->stat_subtype); //comment out for testing
//tmp_subtype = stat->stat_subtype; //comment for normal use
}
}
else
tmp_subtype = stat->stat_subtype;
if (tmp_subtype == 255){
dropstat += 1;
//packet->setSubstructArrayLengthByName("header_info", "stat_count", item_stats.size()-dropstat);
}
else {
packet->setArrayDataByName("stat_type", stat->stat_type, i-dropstat);
packet->setArrayDataByName("stat_subtype", tmp_subtype, i-dropstat);
}
/* SF client */