PDA

View Full Version : Updated items issues (DB/source compatability)


eq_addict_08
09-06-2004, 09:54 AM
Ok, using older code, 0.5.5 but wanted to update my items DB. source newest itemsdump. Eqmemshare crapped out because of new columns in DB. So, i modded \common\database.cpp to reflect new structure. Compile gave eq_packet_struct error. Was wondering why eq_packet_struct needed to be involved. things like banedamage/haste/etc could all be kept behind the scenes and not even sent to client..

Forgive me if I seem clueless. Anyone have suggestion for a fix (without going back to old items DB :D ) ?

edit- will post relevant code snippets/table structures/compile errors soon =)

eq_addict_08
09-06-2004, 11:31 AM
Items structure, old....


--
-- Table structure for table `items`
--

CREATE TABLE items (
id int(11) NOT NULL default '0',
minstatus smallint(5) NOT NULL default '0',
Name varchar(64) NOT NULL default '',
aagi int(11) NOT NULL default '0',
ac int(11) NOT NULL default '0',
accuracy int(11) NOT NULL default '0',
acha int(11) NOT NULL default '0',
adex int(11) NOT NULL default '0',
aint int(11) NOT NULL default '0',
asta int(11) NOT NULL default '0',
astr int(11) NOT NULL default '0',
augslot1type tinyint(3) NOT NULL default '0',
augslot2type tinyint(3) NOT NULL default '0',
augslot3type tinyint(3) NOT NULL default '0',
augslot4type tinyint(3) NOT NULL default '0',
augslot5type tinyint(3) NOT NULL default '0',
avoidance int(11) NOT NULL default '0',
awis int(11) NOT NULL default '0',
bagsize int(11) NOT NULL default '0',
bagslots int(11) NOT NULL default '0',
bagtype int(11) NOT NULL default '0',
bagwr int(11) NOT NULL default '0',
banedmgamt int(11) NOT NULL default '0',
banedmgbody int(11) NOT NULL default '0',
banedmgrace int(11) NOT NULL default '0',
bardtype int(11) NOT NULL default '0',
bardvalue int(11) NOT NULL default '0',
booktype int(11) NOT NULL default '0',
casttime int(11) NOT NULL default '0',
charmfile varchar(32) NOT NULL default '',
classes int(11) NOT NULL default '0',
color int(11) NOT NULL default '0',
combateffects varchar(10) NOT NULL default '',
cost int(11) NOT NULL default '0',
cr int(11) NOT NULL default '0',
damage int(11) NOT NULL default '0',
deity int(11) NOT NULL default '0',
delay int(11) NOT NULL default '0',
dr int(11) NOT NULL default '0',
effecttype int(11) NOT NULL default '0',
elemdmgtype int(11) NOT NULL default '0',
elemdmgamt int(11) NOT NULL default '0',
factionmod4 int(11) NOT NULL default '0',
factionamt1 int(11) NOT NULL default '0',
factionamt2 int(11) NOT NULL default '0',
factionamt3 int(11) NOT NULL default '0',
unknown081 int(11) NOT NULL default '0',
factionmod1 int(11) NOT NULL default '0',
factionmod2 int(11) NOT NULL default '0',
factionmod3 int(11) NOT NULL default '0',
filename varchar(15) NOT NULL default '',
focusid int(11) NOT NULL default '0',
fr int(11) NOT NULL default '0',
gmflag int(11) NOT NULL default '0',
hp int(11) NOT NULL default '0',
icon int(11) NOT NULL default '0',
idfile varchar(30) NOT NULL default '',
itemclass int(11) NOT NULL default '0',
itemtype int(11) NOT NULL default '0',
hasteproclvl int(11) NOT NULL default '0',
light int(11) NOT NULL default '0',
lore varchar(80) NOT NULL default '',
magic int(11) NOT NULL default '0',
mana int(11) NOT NULL default '0',
material int(11) NOT NULL default '0',
maxcharges int(11) NOT NULL default '0',
mr int(11) NOT NULL default '0',
nodrop int(11) NOT NULL default '0',
norent int(11) NOT NULL default '0',
pr int(11) NOT NULL default '0',
races int(11) NOT NULL default '0',
range int(11) NOT NULL default '0',
reclevel int(11) NOT NULL default '0',
recskill int(11) NOT NULL default '0',
reqlevel int(11) NOT NULL default '0',
sellrate float NOT NULL default '0',
shielding int(11) NOT NULL default '0',
size int(11) NOT NULL default '0',
skillmodtype int(11) NOT NULL default '0',
skillmodvalue int(11) NOT NULL default '0',
slots int(11) NOT NULL default '0',
spellid int(11) NOT NULL default '0',
spellshield int(11) NOT NULL default '0',
strikethrough int(11) NOT NULL default '0',
stunresist int(11) NOT NULL default '0',
tradeskills int(11) NOT NULL default '0',
unknown002 int(11) NOT NULL default '0',
unknown004 int(11) NOT NULL default '0',
unknown005 int(11) NOT NULL default '0',
unknown018 int(11) NOT NULL default '0',
unknown019 int(11) NOT NULL default '0',
unknown020 int(11) NOT NULL default '0',
casttime2 int(11) NOT NULL default '0',
unknown061 int(11) NOT NULL default '0',
unknown067 int(11) NOT NULL default '0',
unknown069 int(11) NOT NULL default '0',
unknown070 int(11) NOT NULL default '0',
unknown076 int(11) NOT NULL default '0',
unknown077 int(11) NOT NULL default '0',
factionamt4 int(11) NOT NULL default '0',
augtype int(11) NOT NULL default '0',
ldonpointtheme int(11) NOT NULL default '0',
ldonpointcost int(11) NOT NULL default '0',
unknown099 int(11) NOT NULL default '0',
unknown105 int(11) NOT NULL default '0',
unknown107 int(11) NOT NULL default '0',
unknown108 int(11) NOT NULL default '0',
updated datetime NOT NULL default '0000-00-00 00:00:00',
weight int(11) NOT NULL default '0',
comment varchar(255) NOT NULL default '',
loreflag tinyint(3) unsigned NOT NULL default '0',
pendingloreflag tinyint(3) unsigned NOT NULL default '0',
artifactflag tinyint(3) unsigned NOT NULL default '0',
summonedflag tinyint(3) unsigned NOT NULL default '0',
tribute int(11) NOT NULL default '0',
endur int(11) NOT NULL default '0',
unknown008 int(11) NOT NULL default '0',
UNIQUE KEY ID (id)
) TYPE=MyISAM;

New table struct.....


CREATE TABLE items (
id int(11) NOT NULL default '0',
minstatus smallint(5) NOT NULL default '0',
Name varchar(64) NOT NULL default '',
aagi int(11) NOT NULL default '0',
ac int(11) NOT NULL default '0',
accuracy int(11) NOT NULL default '0',
acha int(11) NOT NULL default '0',
adex int(11) NOT NULL default '0',
aint int(11) NOT NULL default '0',
artifactflag tinyint(3) unsigned NOT NULL default '0',
asta int(11) NOT NULL default '0',
astr int(11) NOT NULL default '0',
attackbonus int(11) NOT NULL default '0',
augmentrestriction int(11) NOT NULL default '0',
augslot1type tinyint(3) NOT NULL default '0',
augslot2type tinyint(3) NOT NULL default '0',
augslot3type tinyint(3) NOT NULL default '0',
augslot4type tinyint(3) NOT NULL default '0',
augslot5type tinyint(3) NOT NULL default '0',
augtype int(11) NOT NULL default '0',
avoidance int(11) NOT NULL default '0',
awis int(11) NOT NULL default '0',
bagsize int(11) NOT NULL default '0',
bagslots int(11) NOT NULL default '0',
bagtype int(11) NOT NULL default '0',
bagwr int(11) NOT NULL default '0',
banedmgamt int(11) NOT NULL default '0',
banedmgamt2 int(11) NOT NULL default '0',
banedmgbody int(11) NOT NULL default '0',
banedmgrace int(11) NOT NULL default '0',
bardtype int(11) NOT NULL default '0',
bardvalue int(11) NOT NULL default '0',
booktype int(11) NOT NULL default '0',
casttime int(11) NOT NULL default '0',
casttime2 int(11) NOT NULL default '0',
charges int(11) NOT NULL default '0',
charmfile varchar(32) NOT NULL default '',
classes int(11) NOT NULL default '0',
color int(11) NOT NULL default '0',
combateffects varchar(10) NOT NULL default '',
combatskill int(11) NOT NULL default '0',
combatskilldmg int(11) NOT NULL default '0',
cost int(11) NOT NULL default '0',
cr int(11) NOT NULL default '0',
damage int(11) NOT NULL default '0',
damageshield int(11) NOT NULL default '0',
deity int(11) NOT NULL default '0',
delay int(11) NOT NULL default '0',
dotshielding int(11) NOT NULL default '0',
dr int(11) NOT NULL default '0',
effecttype int(11) NOT NULL default '0',
elemdmgtype int(11) NOT NULL default '0',
elemdmgamt int(11) NOT NULL default '0',
endur int(11) NOT NULL default '0',
factionamt1 int(11) NOT NULL default '0',
factionamt2 int(11) NOT NULL default '0',
factionamt3 int(11) NOT NULL default '0',
factionamt4 int(11) NOT NULL default '0',
factionmod1 int(11) NOT NULL default '0',
factionmod2 int(11) NOT NULL default '0',
factionmod3 int(11) NOT NULL default '0',
factionmod4 int(11) NOT NULL default '0',
filename varchar(15) NOT NULL default '',
focusid int(11) NOT NULL default '0',
fr int(11) NOT NULL default '0',
gmflag int(11) NOT NULL default '0',
hastepercent int(11) NOT NULL default '0',
hasteproclvl int(11) NOT NULL default '0',
hp int(11) NOT NULL default '0',
hpregen int(11) NOT NULL default '0',
icon int(11) NOT NULL default '0',
idfile varchar(30) NOT NULL default '',
itemclass int(11) NOT NULL default '0',
itemtype int(11) NOT NULL default '0',
ldonpointcost int(11) NOT NULL default '0',
ldonpointtheme int(11) NOT NULL default '0',
ldonsold int(11) NOT NULL default '0',
light int(11) NOT NULL default '0',
lore varchar(80) NOT NULL default '',
loreflag tinyint(3) unsigned NOT NULL default '0',
magic int(11) NOT NULL default '0',
mana int(11) NOT NULL default '0',
manaregen int(11) NOT NULL default '0',
material int(11) NOT NULL default '0',
maxcharges int(11) NOT NULL default '0',
merchantprice int(11) NOT NULL default '0',
mr int(11) NOT NULL default '0',
nodrop int(11) NOT NULL default '0',
norent int(11) NOT NULL default '0',
pendingloreflag tinyint(3) unsigned NOT NULL default '0',
pr int(11) NOT NULL default '0',
proc_rate_mod int(11) NOT NULL default '0',
races int(11) NOT NULL default '0',
range int(11) NOT NULL default '0',
reclevel int(11) NOT NULL default '0',
recskill int(11) NOT NULL default '0',
reqlevel int(11) NOT NULL default '0',
sellrate float NOT NULL default '0',
shielding int(11) NOT NULL default '0',
size int(11) NOT NULL default '0',
skillmodtype int(11) NOT NULL default '0',
skillmodvalue int(11) NOT NULL default '0',
slots int(11) NOT NULL default '0',
spellid int(11) NOT NULL default '0',
spellshield int(11) NOT NULL default '0',
strikethrough int(11) NOT NULL default '0',
stunresist int(11) NOT NULL default '0',
summonedflag tinyint(3) unsigned NOT NULL default '0',
tradeskills int(11) NOT NULL default '0',
tribute int(11) NOT NULL default '0',
weight int(11) NOT NULL default '0',
unknown002 int(11) NOT NULL default '0',
unknown003 int(11) NOT NULL default '0',
unknown005 int(11) NOT NULL default '0',
unknown006 int(11) NOT NULL default '0',
unknown007 int(11) NOT NULL default '0',
unknown018 int(11) NOT NULL default '0',
unknown019 int(11) NOT NULL default '0',
unknown020 int(11) NOT NULL default '0',
unknown061 int(11) NOT NULL default '0',
unknown067 int(11) NOT NULL default '0',
unknown069 int(11) NOT NULL default '0',
unknown081 int(11) NOT NULL default '0',
unknown105 int(11) NOT NULL default '0',
unknown122 int(11) NOT NULL default '0',
unknown123 varchar(11) NOT NULL default '0',
unknown124 varchar(11) NOT NULL default '0',
unknown125 varchar(11) NOT NULL default '0',
unknown126 varchar(11) NOT NULL default '0',
unknown127 varchar(11) NOT NULL default '0',
unknown128 varchar(11) NOT NULL default '0',
unknown129 varchar(11) NOT NULL default '0',
unknown130 varchar(11) NOT NULL default '0',
unknown131 varchar(11) NOT NULL default '0',
unknown132 varchar(11) NOT NULL default '0',
unknown133 varchar(11) NOT NULL default '0',
updated datetime NOT NULL default '0000-00-00 00:00:00',
comment varchar(255) NOT NULL default '',
unknown008 int(10) unsigned NOT NULL default '0',
UNIQUE KEY ID (id)
) TYPE=MyISAM;

old database.cpp...


// Base Item_Struct members
item.gm = (atoi(row[idx++])==0) ? false : true;
item.minstatus = (uint8)atoi(row[idx++]);
item.Unknown002 = (uint32)atoi(row[idx++]);
item.Unknown005 = (uint32)atoi(row[idx++]);
item.Unknown107 = (uint32)atoi(row[idx++]);
item.Unknown108 = (uint32)atoi(row[idx++]);
item.ItemNumber = (uint32)atoi(row[idx++]);
item.Weight = (uint8)atoi(row[idx++]);
item.NoRent = (uint8)atoi(row[idx++]);
item.NoDrop = (uint8)atoi(row[idx++]);
item.Size = (int8)atoi(row[idx++]);
item.Type = (int8)atoi(row[idx++]);
strcpy(item.IDFile,row[idx++]);
strcpy(item.LoreName,row[idx++]);
item.EquipSlots = (uint32)atoi(row[idx++]);
item.Cost = atoi(row[idx++]);
strcpy(item.Name, row[idx++]);
item.IconNumber = atoi(row[idx++]);
if (item.Type == ItemTypeBook) { // Books
item.Book.Unknown105 = (uint32)atoi(row[idx++]);
item.Book.BookType = (uint8)atoi(row[idx++]);
strcpy(item.Book.File, row[20]);
}
else if (item.Type == ItemTypeContainer) { // Containers
idx = 21;
item.Container.PackType = (int8)atoi(row[idx++]);
item.Container.Slots = (int8)atoi(row[idx++]);
item.Container.SizeCapacity = (int8)atoi(row[idx++]);
item.Container.WeightReduction = (int8)atoi(row[idx++]);
}
else if (item.Type == ItemTypeCommon) { // Common
idx = 26;
item.Common.AugSlot1Type = (int8)atoi(row[idx++]);
item.Common.AugSlot2Type = (int8)atoi(row[idx++]);
item.Common.AugSlot3Type = (int8)atoi(row[idx++]);
item.Common.AugSlot4Type = (int8)atoi(row[idx++]);
item.Common.AugSlot5Type = (int8)atoi(row[idx++]);
item.Common.Unknown018 = (uint32)atoi(row[idx++]);
item.Common.Unknown019 = (uint32)atoi(row[idx++]);
item.Common.Unknown020 = (uint32)atoi(row[idx++]);
item.Common.casttime2 = (uint32)atoi(row[idx++]);
item.Common.Unknown061 = (uint32)atoi(row[idx++]);
item.Common.Unknown067 = (uint32)atoi(row[idx++]);
item.Common.Unknown070 = (uint32)atoi(row[idx++]);
item.Common.Unknown076 = (uint32)atoi(row[idx++]);
item.Common.Unknown077 = (uint32)atoi(row[idx++]);
item.Common.Unknown091 = (uint32)atoi(row[idx++]);
item.Common.ldonpointtheme = (uint32)atoi(row[idx++]);
item.Common.ldonpointcost = (uint32)atoi(row[idx++]);
item.Common.Unknown099 = (uint32)atoi(row[idx++]);
item.Common.STR = (sint8)atoi(row[idx++]);
item.Common.STA = (sint8)atoi(row[idx++]);
item.Common.AGI = (sint8)atoi(row[idx++]);
item.Common.DEX = (sint8)atoi(row[idx++]);
item.Common.WIS = (sint8)atoi(row[idx++]);
item.Common.INT = (sint8)atoi(row[idx++]);
item.Common.CHA = (sint8)atoi(row[idx++]);
item.Common.SvPoison = (sint8)atoi(row[idx++]);
item.Common.SvMagic = (sint8)atoi(row[idx++]);
item.Common.SvDisease = (sint8)atoi(row[idx++]);
item.Common.SvFire = (sint8)atoi(row[idx++]);
item.Common.SvCold = (sint8)atoi(row[idx++]);
item.Common.SkillModValue = atoi(row[idx++]);
item.Common.SkillModType = (uint32)atoi(row[idx++]);
item.Common.BaneDmg = (sint8)atoi(row[idx++]);
item.Common.BaneDmgBody = (sint8)atoi(row[idx++]);
item.Common.BaneDmgRace = (uint32)atoi(row[idx++]);
item.Common.Magic = (atoi(row[idx++])==0) ? false : true;
item.Common.Haste = (uint8)atoi(row[idx++]);
item.Common.Light = (uint8)atoi(row[idx++]);
item.Common.Delay = (uint8)atoi(row[idx++]);
item.Common.EffectType = (uint8)atoi(row[idx++]);
item.Common.Range = (uint8)atoi(row[idx++]);
item.Common.Damage = (uint8)atoi(row[idx++]);
item.Common.Material = (uint8)atoi(row[idx++]);
item.Common.MaxCharges = (sint8)atoi(row[idx++]);
item.Common.RecommendedLevel = (uint8)atoi(row[idx++]);
item.Common.RecSkill = (uint8)atoi(row[idx++]);
strcpy(item.Common.CharmFile, row[idx++]);
item.Common.FactionMod1 = atoi(row[idx++]);
item.Common.FactionMod2 = atoi(row[idx++]);
item.Common.FactionMod3 = atoi(row[idx++]);
item.Common.FactionMod4 = atoi(row[idx++]);
item.Common.FactionAmt1 = atoi(row[idx++]);
item.Common.FactionAmt2 = atoi(row[idx++]);
item.Common.FactionAmt3 = atoi(row[idx++]);
item.Common.FactionAmt4 = atoi(row[idx++]);
item.Common.RequiredLevel = atoi(row[idx++]);
item.Common.HP = atoi(row[idx++]);
item.Common.Mana = atoi(row[idx++]);
item.Common.AC = atoi(row[idx++]);
item.Common.Color = (uint32)atoi(row[idx++]);
item.Common.Classes = (uint32)atoi(row[idx++]);
item.Common.Races = (uint32)atoi(row[idx++]);
item.Common.SpellId = (sint16)atoi(row[idx++]);
item.Common.CastTime = (uint32)atoi(row[idx++]);
item.Common.FocusId = atoi(row[idx++]);
item.Common.Skill = (uint8)atoi(row[idx++]);
item.Common.Accuracy = (sint8)atoi(row[idx++]);
item.Common.Avoidance = (sint8)atoi(row[idx++]);
item.Common.BardSkillType = (uint32)atoi(row[idx++]);
item.Common.BardSkillAmt = atoi(row[idx++]);
item.Common.CombatEffects = (sint8)atoi(row[idx++]);
item.Common.Deity = (uint32)atoi(row[idx++]);
item.Common.ElemDmg = (uint8)atoi(row[idx++]);
item.Common.ElemDmgType = (uint8)atoi(row[idx++]);
item.Common.SellRate = (float)atof(row[idx++]);
item.Common.Shielding = (sint8)atoi(row[idx++]);
item.Common.SpellShield = (sint8)atoi(row[idx++]);
item.Common.StrikeThrough = (sint8)atoi(row[idx++]);
item.Common.StunResist = (sint8)atoi(row[idx++]);
item.Common.Tradeskills = (atoi(row[idx++])==0) ? false : true;
}

New database.cpp...



// Base Item_Struct members
item.Charges = (uint8)atoi(row[idx++]);
item.Unknown002 = (uint32)atoi(row[idx++]);
item.CurrentEquipSlot = (sint16)atoi(row[idx++]);
item.MerchantPrice = (uint32)atoi(row[idx++]);
item.Unknown005 = (uint32)atoi(row[idx++]);
item.Unknown006 = (uint32)atoi(row[idx++]);
item.Unknown007 = (uint32)atoi(row[idx++]);
item.Unknown008 = (uint32)atoi(row[idx++]);
item.ItemClass = (uint8)atoi(row[idx++]);
strcpy(item.Name, row[idx++]);
strcpy(item.LoreName,row[idx++]);
strcpy(item.IDFile,row[idx++]);
item.ItemNumber = (uint32)atoi(row[idx++]);
item.Weight = (uint8)atoi(row[idx++]);
item.NoRent = (uint8)atoi(row[idx++]);
item.NoDrop = (uint8)atoi(row[idx++]);
item.Size = (int8)atoi(row[idx++]);
item.EquipSlots = (uint32)atoi(row[idx++]);
item.Cost = atoi(row[idx++]);
item.IconNumber = atoi(row[idx++]);
if (item.ItemClass == ItemTypeBook) { // Books
idx = 106;
item.Book.Unknown105 = (uint32)atoi(row[idx++]);
item.Book.BookType = (uint8)atoi(row[idx++]);
strcpy(item.Book.File, row[idx++]);
}
else if (item.ItemClass == ItemTypeContainer) { // Containers
idx = 101;
item.Container.PackType = (int8)atoi(row[idx++]);
item.Container.Slots = (int8)atoi(row[idx++]);
item.Container.SizeCapacity = (int8)atoi(row[idx++]);
item.Container.WeightReduction = (int8)atoi(row[idx++]);
}
else if (item.ItemClass == ItemTypeCommon) { // Common
item.Common.Unknown018 = (uint32)atoi(row[idx++]);
item.Common.Unknown019 = (uint32)atoi(row[idx++]);
item.Common.Unknown020 = (uint32)atoi(row[idx++]);
item.Common.Tradeskills = (atoi(row[idx++])==0) ? false : true;
item.Common.SvCold = (sint8)atoi(row[idx++]);
item.Common.SvDisease = (sint8)atoi(row[idx++]);
item.Common.SvPoison = (sint8)atoi(row[idx++]);
item.Common.SvMagic = (sint8)atoi(row[idx++]);
item.Common.SvFire = (sint8)atoi(row[idx++]);
item.Common.STR = (sint8)atoi(row[idx++]);
item.Common.STA = (sint8)atoi(row[idx++]);
item.Common.AGI = (sint8)atoi(row[idx++]);
item.Common.DEX = (sint8)atoi(row[idx++]);
item.Common.CHA = (sint8)atoi(row[idx++]);
item.Common.INT = (sint8)atoi(row[idx++]);
item.Common.WIS = (sint8)atoi(row[idx++]);
item.Common.HP = atoi(row[idx++]);
item.Common.Mana = atoi(row[idx++]);
item.Common.AC = atoi(row[idx++]);
item.Common.Deity = (uint32)atoi(row[idx++]);
item.Common.SkillModValue = atoi(row[idx++]);
item.Common.SkillModType = (uint32)atoi(row[idx++]);
item.Common.BaneDmgRace = (uint32)atoi(row[idx++]);
item.Common.BaneDmg = (sint8)atoi(row[idx++]);
item.Common.BaneDmgBody = (sint8)atoi(row[idx++]);
item.Common.Magic = (atoi(row[idx++])==0) ? false : true;
item.Common.casttime2 = (uint32)atoi(row[idx++]);
item.Common.ProcLevel = (uint8)atoi(row[idx++]);
item.Common.RequiredLevel = atoi(row[idx++]);
item.Common.BardSkillType = (uint32)atoi(row[idx++]);
item.Common.BardSkillAmt = atoi(row[idx++]);
item.Common.Light = (uint8)atoi(row[idx++]);
item.Common.Delay = (uint8)atoi(row[idx++]);
item.Common.RecommendedLevel = (uint8)atoi(row[idx++]);
item.Common.RecommendedSkill = (uint8)atoi(row[idx++]);
item.Common.ElemDmgType = (uint8)atoi(row[idx++]);
item.Common.ElemDmg = (uint8)atoi(row[idx++]);
item.Common.EffectType = (uint8)atoi(row[idx++]);
item.Common.Range = (uint8)atoi(row[idx++]);
item.Common.Damage = (uint8)atoi(row[idx++]);
item.Common.Color = (uint32)atoi(row[idx++]);
item.Common.Classes = (uint32)atoi(row[idx++]);
item.Common.Races = (uint32)atoi(row[idx++]);
item.Common.Unknown061 = (uint32)atoi(row[idx++]);
item.Common.SpellId = (sint16)atoi(row[idx++]);
item.Common.MaxCharges = (sint8)atoi(row[idx++]);
item.Common.Skill = (uint8)atoi(row[idx++]);
item.Common.Material = (uint8)atoi(row[idx++]);
item.Common.SellRate = (float)atof(row[idx++]);
item.Common.Unknown067 = (uint32)atoi(row[idx++]);
item.Common.CastTime = (uint32)atoi(row[idx++]);
item.Common.Unknown069 = (uint32)atoi(row[idx++]);
item.Common.ProcRateMod = (uint32)atoi(row[idx++]);
item.Common.FocusId = atoi(row[idx++]);
item.Common.CombatEffects = (sint8)atoi(row[idx++]);
item.Common.Shielding = (sint8)atoi(row[idx++]);
item.Common.StunResist = (sint8)atoi(row[idx++]);
item.Common.StrikeThrough = (sint8)atoi(row[idx++]);
item.Common.CombatSkill = (uint32)atoi(row[idx++]);
item.Common.CombatSkillDmg = (uint32)atoi(row[idx++]);
item.Common.SpellShield = (sint8)atoi(row[idx++]);
item.Common.Avoidance = (sint8)atoi(row[idx++]);
item.Common.Accuracy = (sint8)atoi(row[idx++]);
item.Common.Unknown081 = (uint32)atoi(row[idx++]);
item.Common.FactionMod1 = atoi(row[idx++]);
item.Common.FactionMod2 = atoi(row[idx++]);
item.Common.FactionMod3 = atoi(row[idx++]);
item.Common.FactionMod4 = atoi(row[idx++]);
item.Common.FactionAmt1 = atoi(row[idx++]);
item.Common.FactionAmt2 = atoi(row[idx++]);
item.Common.FactionAmt3 = atoi(row[idx++]);
item.Common.FactionAmt4 = atoi(row[idx++]);
strcpy(item.Common.CharmFile, row[idx++]);
item.Common.augtype = (int8)atoi(row[idx++]);
item.Common.AugSlot1Type = (int8)atoi(row[idx++]);
item.Common.AugSlot2Type = (int8)atoi(row[idx++]);
item.Common.AugSlot3Type = (int8)atoi(row[idx++]);
item.Common.AugSlot4Type = (int8)atoi(row[idx++]);
item.Common.AugSlot5Type = (int8)atoi(row[idx++]);
item.Common.ldonpointtheme = (uint32)atoi(row[idx++]);
item.Common.ldonpointcost = (uint32)atoi(row[idx++]);
item.Common.ldonsold = (uint32)atoi(row[idx++]);
idx+=7;
item.banedmgamt2 = (uint32)atoi(row[idx++]);
item.augmentrestriction = (uint32)atoi(row[idx++]);
item.loreflag = (atoi(row[idx++])==0) ? false : true;
item.pendingloreflag = (atoi(row[idx++])==0) ? false : true;
item.artifactflag = (atoi(row[idx++])==0) ? false : true;
item.summonedflag = (atoi(row[idx++])==0) ? false : true;
item.tribute = (uint32)atoi(row[idx++]);
item.gm = (atoi(row[idx++])==0) ? false : true;
item.endur = (uint32)atoi(row[idx++]);
item.dotshielding = (uint32)atoi(row[idx++]);
item.attackbonus = (uint32)atoi(row[idx++]);
item.hpregen = (uint32)atoi(row[idx++]);
item.manaregen = (uint32)atoi(row[idx++]);
item.hastepercent = (uint32)atoi(row[idx++]);
item.damageshield = (uint32)atoi(row[idx++]);
item.minstatus = (int8)atoi(row[idx++]);

Compile error with wold and zone..



database.cpp
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3700) : error C2039: 'Charges' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3702) : error C2039: 'CurrentEquipSlot' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3703) : error C2039: 'MerchantPrice' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3705) : error C2039: 'Unknown006' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3706) : error C2039: 'Unknown007' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3707) : error C2039: 'Unknown008' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3708) : error C2039: 'ItemClass' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3720) : error C2039: 'ItemClass' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3726) : error C2039: 'ItemClass' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3733) : error C2039: 'ItemClass' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3768) : error C2039: 'RecommendedSkill' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3786) : error C2039: 'ProcRateMod' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3792) : error C2039: 'CombatSkill' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3793) : error C2039: 'CombatSkillDmg' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3797) : error C2039: 'Unknown081' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3807) : error C2039: 'augtype' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3815) : error C2039: 'ldonsold' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3817) : error C2039: 'banedmgamt2' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3818) : error C2039: 'augmentrestriction' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3819) : error C2039: 'loreflag' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3820) : error C2039: 'pendingloreflag' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3821) : error C2039: 'artifactflag' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3822) : error C2039: 'summonedflag' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3823) : error C2039: 'tribute' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3825) : error C2039: 'endur' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3826) : error C2039: 'dotshielding' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3827) : error C2039: 'attackbonus' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3828) : error C2039: 'hpregen' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3829) : error C2039: 'manaregen' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3830) : error C2039: 'hastepercent' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3831) : error C2039: 'damageshield' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1634) : see declaration of 'Item_Struct'
dbasync.cpp
dbcore.cpp
DBMemLeak.cpp
debug.cpp
EMuShareMem.cpp
EQNetwork.cpp
eqtime.cpp
guilds.cpp
Item.cpp
md5.cpp
misc.cpp
MiscFunctions.cpp
moremath.cpp
Mutex.cpp
packet_dump.cpp
packet_dump_file.cpp
packet_functions.cpp
races.cpp
serverinfo.cpp
TCPConnection.cpp
timer.cpp
Error executing cl.exe.

Zone.exe - 31 error(s), 0 warning(s)

And finally eq_packet_struct.h



struct Item_Struct {
void SetCache() {
// Caching calculated values
attribs = ItemAttribNone;

if (strstr(LoreName, "&") != 0)
attribs = (ItemAttrib)(attribs | ItemAttribSummoned);
if (strstr(LoreName, "*") != 0)
attribs = (ItemAttrib)(attribs | ItemAttribLore);
if (strstr(LoreName, "#") != 0)
attribs = (ItemAttrib)(attribs | ItemAttribArtifact);
if (strstr(LoreName, "~") != 0)
attribs = (ItemAttrib)(attribs | ItemAttribPendingLore);
if ((Type == ItemTypeCommon) && Common.Magic)
attribs = (ItemAttrib)(attribs | ItemAttribMagic);
};

// Non packet based fields
uint8 minstatus;
bool gm;
ItemAttrib attribs;


// Packet based fields
/*index*/
//001*/ sint8 Charges; // Instance data (just here as FYI)
/*002*/ uint32 Unknown002;
//003*/ sint16 CurrentEquipSlot // Instance data (just here as FYI)
//004*/ uint32 BazaarTraderPrice; // Instance data (just here as FYI)
/*005*/ uint32 Unknown005;
/*006*/ uint8 Type; // Item Type: 0=common, 1=container, 2=book (quote precedes field - dunno why)
/*007*/ char Name[64]; // Name
/*008*/ char LoreName[80]; // Lore Name: *=lore, &=summoned, #=artifact, ~=pending lore
/*009*/ char IDFile[30]; // Visible model
/*010*/ uint32 ItemNumber; // Unique ID (also PK for DB)
/*011*/ uint8 Weight; // Item weight * 10
/*012*/ uint8 NoRent; // No Rent: 0=norent, 255=not norent
/*013*/ uint8 NoDrop; // No Drop: 0=nodrop, 255=not nodrop
/*014*/ uint8 Size; // Size: 0=tiny, 1=small, 2=medium, 3=large, 4=giant
/*015*/ uint32 EquipSlots; // Bitfield for which slots this item can be used in
/*016*/ uint32 Cost; // Item cost (?)
/*017*/ uint32 IconNumber; // Icon Number

union {
/*018->100*/ ItemCommon_Struct Common;
/*101->104*/ ItemContainer_Struct Container;
/*105->107*/ ItemBook_Struct Book;
};

/*107*/ uint32 Unknown107;
/*108*/ uint32 Unknown108;
};

/*
** Item Packet Struct - Works on a variety of opcodes
** Packet Types: See ItemPacketType enum
**
*/
struct ItemPacket_Struct
{
/*00*/ ItemPacketType PacketType;
/*04*/ char SerializedItem[0];
/*xx*/
};

struct Consume_Struct
{
/*0000*/ int32 slot;
/*0004*/ int32 auto_consumed; // 0xffffffff when auto eating e7030000 when right click
/*0008*/ int8 c_unknown1[4];
/*0012*/ int8 type; // 0x01=Food 0x02=Water
/*0013*/ int8 unknown13[3];
};



wow.. hopefully I can figure it out. (maybe just seeing all the snipets in from of me at once will help :D )

eq_addict_08
09-06-2004, 11:39 AM
SHould I just add the needed fields into the "Non packet based fields" ?

bah, I suck =P YEA, butt!!

eq_addict_08
09-06-2004, 12:56 PM
Ok, I got them to compile. =) Now when I log onto char zone crashes. Wrong slot numbers on items it says. Gonna delete and stat fresh.. Wish me luck..

eq_addict_08
09-06-2004, 01:15 PM
Bah!! Looks like I'll have to go back to old items db and old source...
locks up when I enter world..

It shouldn't work that way imo, everything behind scene- DB, attk calcs, etc, should have nuthing to do with packets unless we want it to.

(If anyone wants to help, I would still appriciate it :D )

Well, I may force one compile with older eq_packet_struck and see if it works

eq_addict_08
09-06-2004, 04:33 PM
Well, I have lowered the number of errors quite a bit. Changed Haste to hastepercent and changed some other names as needed. Seems the lore/artifact/etc flag is in different columns now. May have to write an sql to reformat into single column method. Also, was wondering if I could arbitrarily define some of the Unkowns to things like attk bonus/Mana regen/hp regen? Then I'll delete the remaining crud from my db..

what remains to be done

database.cpp
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3703) : error C2039: 'MerchantPrice' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3705) : error C2039: 'Unknown006' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3706) : error C2039: 'Unknown007' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3707) : error C2039: 'Unknown008' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3708) : error C2039: 'ItemClass' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3720) : error C2039: 'ItemClass' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3726) : error C2039: 'ItemClass' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3733) : error C2039: 'ItemClass' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3786) : error C2039: 'ProcRateMod' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3792) : error C2039: 'CombatSkill' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3793) : error C2039: 'CombatSkillDmg' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3797) : error C2039: 'Unknown081' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3807) : error C2039: 'augtype' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3815) : error C2039: 'ldonsold' : is not a member of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1506) : see declaration of 'ItemCommon_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3817) : error C2039: 'banedmgamt2' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3818) : error C2039: 'augmentrestriction' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3819) : error C2039: 'loreflag' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3820) : error C2039: 'pendingloreflag' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3821) : error C2039: 'artifactflag' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3822) : error C2039: 'summonedflag' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3823) : error C2039: 'tribute' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3825) : error C2039: 'endur' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3826) : error C2039: 'dotshielding' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3827) : error C2039: 'attackbonus' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3828) : error C2039: 'hpregen' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3829) : error C2039: 'manaregen' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\database.cpp(3831) : error C2039: 'damageshield' : is not a member of 'Item_Struct'
D:\source\EQEmu-0.5.5-Source\common\eq_packet_structs.h(1645) : see declaration of 'Item_Struct'