diff --git a/common/database/database_update_manifest.cpp b/common/database/database_update_manifest.cpp index aff1d7173..a27e39de6 100644 --- a/common/database/database_update_manifest.cpp +++ b/common/database/database_update_manifest.cpp @@ -5608,6 +5608,18 @@ ENGINE=InnoDB AUTO_INCREMENT=1 ; )" + }, + ManifestEntry{ + .version = 9278, + .description = "2024_05_06_npc_greed.sql", + .check = "SHOW COLUMNS FROM `npc_types` LIKE 'greed'", + .condition = "empty", + .match = "", + .sql = R"( +ALTER TABLE `npc_types` +ADD COLUMN `greed` tinyint(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `merchant_id`; + )", + .content_schema_update = true } // -- template; copy/paste this when you need to create a new entry // ManifestEntry{ diff --git a/common/repositories/base/base_npc_types_repository.h b/common/repositories/base/base_npc_types_repository.h index 1f0720d92..1eb12660b 100644 --- a/common/repositories/base/base_npc_types_repository.h +++ b/common/repositories/base/base_npc_types_repository.h @@ -38,6 +38,7 @@ public: int64_t mana_regen_rate; uint32_t loottable_id; uint32_t merchant_id; + uint8_t greed; uint32_t alt_currency_id; uint32_t npc_spells_id; uint32_t npc_spells_effects_id; @@ -176,6 +177,7 @@ public: "mana_regen_rate", "loottable_id", "merchant_id", + "greed", "alt_currency_id", "npc_spells_id", "npc_spells_effects_id", @@ -310,6 +312,7 @@ public: "mana_regen_rate", "loottable_id", "merchant_id", + "greed", "alt_currency_id", "npc_spells_id", "npc_spells_effects_id", @@ -478,6 +481,7 @@ public: e.mana_regen_rate = 0; e.loottable_id = 0; e.merchant_id = 0; + e.greed = 0; e.alt_currency_id = 0; e.npc_spells_id = 0; e.npc_spells_effects_id = 0; @@ -642,115 +646,116 @@ public: e.mana_regen_rate = row[16] ? strtoll(row[16], nullptr, 10) : 0; e.loottable_id = row[17] ? static_cast(strtoul(row[17], nullptr, 10)) : 0; e.merchant_id = row[18] ? static_cast(strtoul(row[18], nullptr, 10)) : 0; - e.alt_currency_id = row[19] ? static_cast(strtoul(row[19], nullptr, 10)) : 0; - e.npc_spells_id = row[20] ? static_cast(strtoul(row[20], nullptr, 10)) : 0; - e.npc_spells_effects_id = row[21] ? static_cast(strtoul(row[21], nullptr, 10)) : 0; - e.npc_faction_id = row[22] ? static_cast(atoi(row[22])) : 0; - e.adventure_template_id = row[23] ? static_cast(strtoul(row[23], nullptr, 10)) : 0; - e.trap_template = row[24] ? static_cast(strtoul(row[24], nullptr, 10)) : 0; - e.mindmg = row[25] ? static_cast(strtoul(row[25], nullptr, 10)) : 0; - e.maxdmg = row[26] ? static_cast(strtoul(row[26], nullptr, 10)) : 0; - e.attack_count = row[27] ? static_cast(atoi(row[27])) : -1; - e.npcspecialattks = row[28] ? row[28] : ""; - e.special_abilities = row[29] ? row[29] : ""; - e.aggroradius = row[30] ? static_cast(strtoul(row[30], nullptr, 10)) : 0; - e.assistradius = row[31] ? static_cast(strtoul(row[31], nullptr, 10)) : 0; - e.face = row[32] ? static_cast(strtoul(row[32], nullptr, 10)) : 1; - e.luclin_hairstyle = row[33] ? static_cast(strtoul(row[33], nullptr, 10)) : 1; - e.luclin_haircolor = row[34] ? static_cast(strtoul(row[34], nullptr, 10)) : 1; - e.luclin_eyecolor = row[35] ? static_cast(strtoul(row[35], nullptr, 10)) : 1; - e.luclin_eyecolor2 = row[36] ? static_cast(strtoul(row[36], nullptr, 10)) : 1; - e.luclin_beardcolor = row[37] ? static_cast(strtoul(row[37], nullptr, 10)) : 1; - e.luclin_beard = row[38] ? static_cast(strtoul(row[38], nullptr, 10)) : 0; - e.drakkin_heritage = row[39] ? static_cast(atoi(row[39])) : 0; - e.drakkin_tattoo = row[40] ? static_cast(atoi(row[40])) : 0; - e.drakkin_details = row[41] ? static_cast(atoi(row[41])) : 0; - e.armortint_id = row[42] ? static_cast(strtoul(row[42], nullptr, 10)) : 0; - e.armortint_red = row[43] ? static_cast(strtoul(row[43], nullptr, 10)) : 0; - e.armortint_green = row[44] ? static_cast(strtoul(row[44], nullptr, 10)) : 0; - e.armortint_blue = row[45] ? static_cast(strtoul(row[45], nullptr, 10)) : 0; - e.d_melee_texture1 = row[46] ? static_cast(strtoul(row[46], nullptr, 10)) : 0; - e.d_melee_texture2 = row[47] ? static_cast(strtoul(row[47], nullptr, 10)) : 0; - e.ammo_idfile = row[48] ? row[48] : "IT10"; - e.prim_melee_type = row[49] ? static_cast(strtoul(row[49], nullptr, 10)) : 28; - e.sec_melee_type = row[50] ? static_cast(strtoul(row[50], nullptr, 10)) : 28; - e.ranged_type = row[51] ? static_cast(strtoul(row[51], nullptr, 10)) : 7; - e.runspeed = row[52] ? strtof(row[52], nullptr) : 0; - e.MR = row[53] ? static_cast(atoi(row[53])) : 0; - e.CR = row[54] ? static_cast(atoi(row[54])) : 0; - e.DR = row[55] ? static_cast(atoi(row[55])) : 0; - e.FR = row[56] ? static_cast(atoi(row[56])) : 0; - e.PR = row[57] ? static_cast(atoi(row[57])) : 0; - e.Corrup = row[58] ? static_cast(atoi(row[58])) : 0; - e.PhR = row[59] ? static_cast(strtoul(row[59], nullptr, 10)) : 0; - e.see_invis = row[60] ? static_cast(atoi(row[60])) : 0; - e.see_invis_undead = row[61] ? static_cast(atoi(row[61])) : 0; - e.qglobal = row[62] ? static_cast(strtoul(row[62], nullptr, 10)) : 0; - e.AC = row[63] ? static_cast(atoi(row[63])) : 0; - e.npc_aggro = row[64] ? static_cast(atoi(row[64])) : 0; - e.spawn_limit = row[65] ? static_cast(atoi(row[65])) : 0; - e.attack_speed = row[66] ? strtof(row[66], nullptr) : 0; - e.attack_delay = row[67] ? static_cast(strtoul(row[67], nullptr, 10)) : 30; - e.findable = row[68] ? static_cast(atoi(row[68])) : 0; - e.STR = row[69] ? static_cast(strtoul(row[69], nullptr, 10)) : 75; - e.STA = row[70] ? static_cast(strtoul(row[70], nullptr, 10)) : 75; - e.DEX = row[71] ? static_cast(strtoul(row[71], nullptr, 10)) : 75; - e.AGI = row[72] ? static_cast(strtoul(row[72], nullptr, 10)) : 75; - e._INT = row[73] ? static_cast(strtoul(row[73], nullptr, 10)) : 80; - e.WIS = row[74] ? static_cast(strtoul(row[74], nullptr, 10)) : 75; - e.CHA = row[75] ? static_cast(strtoul(row[75], nullptr, 10)) : 75; - e.see_hide = row[76] ? static_cast(atoi(row[76])) : 0; - e.see_improved_hide = row[77] ? static_cast(atoi(row[77])) : 0; - e.trackable = row[78] ? static_cast(atoi(row[78])) : 1; - e.isbot = row[79] ? static_cast(atoi(row[79])) : 0; - e.exclude = row[80] ? static_cast(atoi(row[80])) : 1; - e.ATK = row[81] ? static_cast(atoi(row[81])) : 0; - e.Accuracy = row[82] ? static_cast(atoi(row[82])) : 0; - e.Avoidance = row[83] ? static_cast(strtoul(row[83], nullptr, 10)) : 0; - e.slow_mitigation = row[84] ? static_cast(atoi(row[84])) : 0; - e.version = row[85] ? static_cast(strtoul(row[85], nullptr, 10)) : 0; - e.maxlevel = row[86] ? static_cast(atoi(row[86])) : 0; - e.scalerate = row[87] ? static_cast(atoi(row[87])) : 100; - e.private_corpse = row[88] ? static_cast(strtoul(row[88], nullptr, 10)) : 0; - e.unique_spawn_by_name = row[89] ? static_cast(strtoul(row[89], nullptr, 10)) : 0; - e.underwater = row[90] ? static_cast(strtoul(row[90], nullptr, 10)) : 0; - e.isquest = row[91] ? static_cast(atoi(row[91])) : 0; - e.emoteid = row[92] ? static_cast(strtoul(row[92], nullptr, 10)) : 0; - e.spellscale = row[93] ? strtof(row[93], nullptr) : 100; - e.healscale = row[94] ? strtof(row[94], nullptr) : 100; - e.no_target_hotkey = row[95] ? static_cast(strtoul(row[95], nullptr, 10)) : 0; - e.raid_target = row[96] ? static_cast(strtoul(row[96], nullptr, 10)) : 0; - e.armtexture = row[97] ? static_cast(atoi(row[97])) : 0; - e.bracertexture = row[98] ? static_cast(atoi(row[98])) : 0; - e.handtexture = row[99] ? static_cast(atoi(row[99])) : 0; - e.legtexture = row[100] ? static_cast(atoi(row[100])) : 0; - e.feettexture = row[101] ? static_cast(atoi(row[101])) : 0; - e.light = row[102] ? static_cast(atoi(row[102])) : 0; - e.walkspeed = row[103] ? static_cast(atoi(row[103])) : 0; - e.peqid = row[104] ? static_cast(atoi(row[104])) : 0; - e.unique_ = row[105] ? static_cast(atoi(row[105])) : 0; - e.fixed = row[106] ? static_cast(atoi(row[106])) : 0; - e.ignore_despawn = row[107] ? static_cast(atoi(row[107])) : 0; - e.show_name = row[108] ? static_cast(atoi(row[108])) : 1; - e.untargetable = row[109] ? static_cast(atoi(row[109])) : 0; - e.charm_ac = row[110] ? static_cast(atoi(row[110])) : 0; - e.charm_min_dmg = row[111] ? static_cast(atoi(row[111])) : 0; - e.charm_max_dmg = row[112] ? static_cast(atoi(row[112])) : 0; - e.charm_attack_delay = row[113] ? static_cast(atoi(row[113])) : 0; - e.charm_accuracy_rating = row[114] ? static_cast(atoi(row[114])) : 0; - e.charm_avoidance_rating = row[115] ? static_cast(atoi(row[115])) : 0; - e.charm_atk = row[116] ? static_cast(atoi(row[116])) : 0; - e.skip_global_loot = row[117] ? static_cast(atoi(row[117])) : 0; - e.rare_spawn = row[118] ? static_cast(atoi(row[118])) : 0; - e.stuck_behavior = row[119] ? static_cast(atoi(row[119])) : 0; - e.model = row[120] ? static_cast(atoi(row[120])) : 0; - e.flymode = row[121] ? static_cast(atoi(row[121])) : -1; - e.always_aggro = row[122] ? static_cast(atoi(row[122])) : 0; - e.exp_mod = row[123] ? static_cast(atoi(row[123])) : 100; - e.heroic_strikethrough = row[124] ? static_cast(atoi(row[124])) : 0; - e.faction_amount = row[125] ? static_cast(atoi(row[125])) : 0; - e.keeps_sold_items = row[126] ? static_cast(strtoul(row[126], nullptr, 10)) : 1; - e.is_parcel_merchant = row[127] ? static_cast(strtoul(row[127], nullptr, 10)) : 0; + e.greed = row[19] ? static_cast(strtoul(row[19], nullptr, 10)) : 0; + e.alt_currency_id = row[20] ? static_cast(strtoul(row[20], nullptr, 10)) : 0; + e.npc_spells_id = row[21] ? static_cast(strtoul(row[21], nullptr, 10)) : 0; + e.npc_spells_effects_id = row[22] ? static_cast(strtoul(row[22], nullptr, 10)) : 0; + e.npc_faction_id = row[23] ? static_cast(atoi(row[23])) : 0; + e.adventure_template_id = row[24] ? static_cast(strtoul(row[24], nullptr, 10)) : 0; + e.trap_template = row[25] ? static_cast(strtoul(row[25], nullptr, 10)) : 0; + e.mindmg = row[26] ? static_cast(strtoul(row[26], nullptr, 10)) : 0; + e.maxdmg = row[27] ? static_cast(strtoul(row[27], nullptr, 10)) : 0; + e.attack_count = row[28] ? static_cast(atoi(row[28])) : -1; + e.npcspecialattks = row[29] ? row[29] : ""; + e.special_abilities = row[30] ? row[30] : ""; + e.aggroradius = row[31] ? static_cast(strtoul(row[31], nullptr, 10)) : 0; + e.assistradius = row[32] ? static_cast(strtoul(row[32], nullptr, 10)) : 0; + e.face = row[33] ? static_cast(strtoul(row[33], nullptr, 10)) : 1; + e.luclin_hairstyle = row[34] ? static_cast(strtoul(row[34], nullptr, 10)) : 1; + e.luclin_haircolor = row[35] ? static_cast(strtoul(row[35], nullptr, 10)) : 1; + e.luclin_eyecolor = row[36] ? static_cast(strtoul(row[36], nullptr, 10)) : 1; + e.luclin_eyecolor2 = row[37] ? static_cast(strtoul(row[37], nullptr, 10)) : 1; + e.luclin_beardcolor = row[38] ? static_cast(strtoul(row[38], nullptr, 10)) : 1; + e.luclin_beard = row[39] ? static_cast(strtoul(row[39], nullptr, 10)) : 0; + e.drakkin_heritage = row[40] ? static_cast(atoi(row[40])) : 0; + e.drakkin_tattoo = row[41] ? static_cast(atoi(row[41])) : 0; + e.drakkin_details = row[42] ? static_cast(atoi(row[42])) : 0; + e.armortint_id = row[43] ? static_cast(strtoul(row[43], nullptr, 10)) : 0; + e.armortint_red = row[44] ? static_cast(strtoul(row[44], nullptr, 10)) : 0; + e.armortint_green = row[45] ? static_cast(strtoul(row[45], nullptr, 10)) : 0; + e.armortint_blue = row[46] ? static_cast(strtoul(row[46], nullptr, 10)) : 0; + e.d_melee_texture1 = row[47] ? static_cast(strtoul(row[47], nullptr, 10)) : 0; + e.d_melee_texture2 = row[48] ? static_cast(strtoul(row[48], nullptr, 10)) : 0; + e.ammo_idfile = row[49] ? row[49] : "IT10"; + e.prim_melee_type = row[50] ? static_cast(strtoul(row[50], nullptr, 10)) : 28; + e.sec_melee_type = row[51] ? static_cast(strtoul(row[51], nullptr, 10)) : 28; + e.ranged_type = row[52] ? static_cast(strtoul(row[52], nullptr, 10)) : 7; + e.runspeed = row[53] ? strtof(row[53], nullptr) : 0; + e.MR = row[54] ? static_cast(atoi(row[54])) : 0; + e.CR = row[55] ? static_cast(atoi(row[55])) : 0; + e.DR = row[56] ? static_cast(atoi(row[56])) : 0; + e.FR = row[57] ? static_cast(atoi(row[57])) : 0; + e.PR = row[58] ? static_cast(atoi(row[58])) : 0; + e.Corrup = row[59] ? static_cast(atoi(row[59])) : 0; + e.PhR = row[60] ? static_cast(strtoul(row[60], nullptr, 10)) : 0; + e.see_invis = row[61] ? static_cast(atoi(row[61])) : 0; + e.see_invis_undead = row[62] ? static_cast(atoi(row[62])) : 0; + e.qglobal = row[63] ? static_cast(strtoul(row[63], nullptr, 10)) : 0; + e.AC = row[64] ? static_cast(atoi(row[64])) : 0; + e.npc_aggro = row[65] ? static_cast(atoi(row[65])) : 0; + e.spawn_limit = row[66] ? static_cast(atoi(row[66])) : 0; + e.attack_speed = row[67] ? strtof(row[67], nullptr) : 0; + e.attack_delay = row[68] ? static_cast(strtoul(row[68], nullptr, 10)) : 30; + e.findable = row[69] ? static_cast(atoi(row[69])) : 0; + e.STR = row[70] ? static_cast(strtoul(row[70], nullptr, 10)) : 75; + e.STA = row[71] ? static_cast(strtoul(row[71], nullptr, 10)) : 75; + e.DEX = row[72] ? static_cast(strtoul(row[72], nullptr, 10)) : 75; + e.AGI = row[73] ? static_cast(strtoul(row[73], nullptr, 10)) : 75; + e._INT = row[74] ? static_cast(strtoul(row[74], nullptr, 10)) : 80; + e.WIS = row[75] ? static_cast(strtoul(row[75], nullptr, 10)) : 75; + e.CHA = row[76] ? static_cast(strtoul(row[76], nullptr, 10)) : 75; + e.see_hide = row[77] ? static_cast(atoi(row[77])) : 0; + e.see_improved_hide = row[78] ? static_cast(atoi(row[78])) : 0; + e.trackable = row[79] ? static_cast(atoi(row[79])) : 1; + e.isbot = row[80] ? static_cast(atoi(row[80])) : 0; + e.exclude = row[81] ? static_cast(atoi(row[81])) : 1; + e.ATK = row[82] ? static_cast(atoi(row[82])) : 0; + e.Accuracy = row[83] ? static_cast(atoi(row[83])) : 0; + e.Avoidance = row[84] ? static_cast(strtoul(row[84], nullptr, 10)) : 0; + e.slow_mitigation = row[85] ? static_cast(atoi(row[85])) : 0; + e.version = row[86] ? static_cast(strtoul(row[86], nullptr, 10)) : 0; + e.maxlevel = row[87] ? static_cast(atoi(row[87])) : 0; + e.scalerate = row[88] ? static_cast(atoi(row[88])) : 100; + e.private_corpse = row[89] ? static_cast(strtoul(row[89], nullptr, 10)) : 0; + e.unique_spawn_by_name = row[90] ? static_cast(strtoul(row[90], nullptr, 10)) : 0; + e.underwater = row[91] ? static_cast(strtoul(row[91], nullptr, 10)) : 0; + e.isquest = row[92] ? static_cast(atoi(row[92])) : 0; + e.emoteid = row[93] ? static_cast(strtoul(row[93], nullptr, 10)) : 0; + e.spellscale = row[94] ? strtof(row[94], nullptr) : 100; + e.healscale = row[95] ? strtof(row[95], nullptr) : 100; + e.no_target_hotkey = row[96] ? static_cast(strtoul(row[96], nullptr, 10)) : 0; + e.raid_target = row[97] ? static_cast(strtoul(row[97], nullptr, 10)) : 0; + e.armtexture = row[98] ? static_cast(atoi(row[98])) : 0; + e.bracertexture = row[99] ? static_cast(atoi(row[99])) : 0; + e.handtexture = row[100] ? static_cast(atoi(row[100])) : 0; + e.legtexture = row[101] ? static_cast(atoi(row[101])) : 0; + e.feettexture = row[102] ? static_cast(atoi(row[102])) : 0; + e.light = row[103] ? static_cast(atoi(row[103])) : 0; + e.walkspeed = row[104] ? static_cast(atoi(row[104])) : 0; + e.peqid = row[105] ? static_cast(atoi(row[105])) : 0; + e.unique_ = row[106] ? static_cast(atoi(row[106])) : 0; + e.fixed = row[107] ? static_cast(atoi(row[107])) : 0; + e.ignore_despawn = row[108] ? static_cast(atoi(row[108])) : 0; + e.show_name = row[109] ? static_cast(atoi(row[109])) : 1; + e.untargetable = row[110] ? static_cast(atoi(row[110])) : 0; + e.charm_ac = row[111] ? static_cast(atoi(row[111])) : 0; + e.charm_min_dmg = row[112] ? static_cast(atoi(row[112])) : 0; + e.charm_max_dmg = row[113] ? static_cast(atoi(row[113])) : 0; + e.charm_attack_delay = row[114] ? static_cast(atoi(row[114])) : 0; + e.charm_accuracy_rating = row[115] ? static_cast(atoi(row[115])) : 0; + e.charm_avoidance_rating = row[116] ? static_cast(atoi(row[116])) : 0; + e.charm_atk = row[117] ? static_cast(atoi(row[117])) : 0; + e.skip_global_loot = row[118] ? static_cast(atoi(row[118])) : 0; + e.rare_spawn = row[119] ? static_cast(atoi(row[119])) : 0; + e.stuck_behavior = row[120] ? static_cast(atoi(row[120])) : 0; + e.model = row[121] ? static_cast(atoi(row[121])) : 0; + e.flymode = row[122] ? static_cast(atoi(row[122])) : -1; + e.always_aggro = row[123] ? static_cast(atoi(row[123])) : 0; + e.exp_mod = row[124] ? static_cast(atoi(row[124])) : 100; + e.heroic_strikethrough = row[125] ? static_cast(atoi(row[125])) : 0; + e.faction_amount = row[126] ? static_cast(atoi(row[126])) : 0; + e.keeps_sold_items = row[127] ? static_cast(strtoul(row[127], nullptr, 10)) : 1; + e.is_parcel_merchant = row[128] ? static_cast(strtoul(row[128], nullptr, 10)) : 0; return e; } @@ -802,115 +807,116 @@ public: v.push_back(columns[16] + " = " + std::to_string(e.mana_regen_rate)); v.push_back(columns[17] + " = " + std::to_string(e.loottable_id)); v.push_back(columns[18] + " = " + std::to_string(e.merchant_id)); - v.push_back(columns[19] + " = " + std::to_string(e.alt_currency_id)); - v.push_back(columns[20] + " = " + std::to_string(e.npc_spells_id)); - v.push_back(columns[21] + " = " + std::to_string(e.npc_spells_effects_id)); - v.push_back(columns[22] + " = " + std::to_string(e.npc_faction_id)); - v.push_back(columns[23] + " = " + std::to_string(e.adventure_template_id)); - v.push_back(columns[24] + " = " + std::to_string(e.trap_template)); - v.push_back(columns[25] + " = " + std::to_string(e.mindmg)); - v.push_back(columns[26] + " = " + std::to_string(e.maxdmg)); - v.push_back(columns[27] + " = " + std::to_string(e.attack_count)); - v.push_back(columns[28] + " = '" + Strings::Escape(e.npcspecialattks) + "'"); - v.push_back(columns[29] + " = '" + Strings::Escape(e.special_abilities) + "'"); - v.push_back(columns[30] + " = " + std::to_string(e.aggroradius)); - v.push_back(columns[31] + " = " + std::to_string(e.assistradius)); - v.push_back(columns[32] + " = " + std::to_string(e.face)); - v.push_back(columns[33] + " = " + std::to_string(e.luclin_hairstyle)); - v.push_back(columns[34] + " = " + std::to_string(e.luclin_haircolor)); - v.push_back(columns[35] + " = " + std::to_string(e.luclin_eyecolor)); - v.push_back(columns[36] + " = " + std::to_string(e.luclin_eyecolor2)); - v.push_back(columns[37] + " = " + std::to_string(e.luclin_beardcolor)); - v.push_back(columns[38] + " = " + std::to_string(e.luclin_beard)); - v.push_back(columns[39] + " = " + std::to_string(e.drakkin_heritage)); - v.push_back(columns[40] + " = " + std::to_string(e.drakkin_tattoo)); - v.push_back(columns[41] + " = " + std::to_string(e.drakkin_details)); - v.push_back(columns[42] + " = " + std::to_string(e.armortint_id)); - v.push_back(columns[43] + " = " + std::to_string(e.armortint_red)); - v.push_back(columns[44] + " = " + std::to_string(e.armortint_green)); - v.push_back(columns[45] + " = " + std::to_string(e.armortint_blue)); - v.push_back(columns[46] + " = " + std::to_string(e.d_melee_texture1)); - v.push_back(columns[47] + " = " + std::to_string(e.d_melee_texture2)); - v.push_back(columns[48] + " = '" + Strings::Escape(e.ammo_idfile) + "'"); - v.push_back(columns[49] + " = " + std::to_string(e.prim_melee_type)); - v.push_back(columns[50] + " = " + std::to_string(e.sec_melee_type)); - v.push_back(columns[51] + " = " + std::to_string(e.ranged_type)); - v.push_back(columns[52] + " = " + std::to_string(e.runspeed)); - v.push_back(columns[53] + " = " + std::to_string(e.MR)); - v.push_back(columns[54] + " = " + std::to_string(e.CR)); - v.push_back(columns[55] + " = " + std::to_string(e.DR)); - v.push_back(columns[56] + " = " + std::to_string(e.FR)); - v.push_back(columns[57] + " = " + std::to_string(e.PR)); - v.push_back(columns[58] + " = " + std::to_string(e.Corrup)); - v.push_back(columns[59] + " = " + std::to_string(e.PhR)); - v.push_back(columns[60] + " = " + std::to_string(e.see_invis)); - v.push_back(columns[61] + " = " + std::to_string(e.see_invis_undead)); - v.push_back(columns[62] + " = " + std::to_string(e.qglobal)); - v.push_back(columns[63] + " = " + std::to_string(e.AC)); - v.push_back(columns[64] + " = " + std::to_string(e.npc_aggro)); - v.push_back(columns[65] + " = " + std::to_string(e.spawn_limit)); - v.push_back(columns[66] + " = " + std::to_string(e.attack_speed)); - v.push_back(columns[67] + " = " + std::to_string(e.attack_delay)); - v.push_back(columns[68] + " = " + std::to_string(e.findable)); - v.push_back(columns[69] + " = " + std::to_string(e.STR)); - v.push_back(columns[70] + " = " + std::to_string(e.STA)); - v.push_back(columns[71] + " = " + std::to_string(e.DEX)); - v.push_back(columns[72] + " = " + std::to_string(e.AGI)); - v.push_back(columns[73] + " = " + std::to_string(e._INT)); - v.push_back(columns[74] + " = " + std::to_string(e.WIS)); - v.push_back(columns[75] + " = " + std::to_string(e.CHA)); - v.push_back(columns[76] + " = " + std::to_string(e.see_hide)); - v.push_back(columns[77] + " = " + std::to_string(e.see_improved_hide)); - v.push_back(columns[78] + " = " + std::to_string(e.trackable)); - v.push_back(columns[79] + " = " + std::to_string(e.isbot)); - v.push_back(columns[80] + " = " + std::to_string(e.exclude)); - v.push_back(columns[81] + " = " + std::to_string(e.ATK)); - v.push_back(columns[82] + " = " + std::to_string(e.Accuracy)); - v.push_back(columns[83] + " = " + std::to_string(e.Avoidance)); - v.push_back(columns[84] + " = " + std::to_string(e.slow_mitigation)); - v.push_back(columns[85] + " = " + std::to_string(e.version)); - v.push_back(columns[86] + " = " + std::to_string(e.maxlevel)); - v.push_back(columns[87] + " = " + std::to_string(e.scalerate)); - v.push_back(columns[88] + " = " + std::to_string(e.private_corpse)); - v.push_back(columns[89] + " = " + std::to_string(e.unique_spawn_by_name)); - v.push_back(columns[90] + " = " + std::to_string(e.underwater)); - v.push_back(columns[91] + " = " + std::to_string(e.isquest)); - v.push_back(columns[92] + " = " + std::to_string(e.emoteid)); - v.push_back(columns[93] + " = " + std::to_string(e.spellscale)); - v.push_back(columns[94] + " = " + std::to_string(e.healscale)); - v.push_back(columns[95] + " = " + std::to_string(e.no_target_hotkey)); - v.push_back(columns[96] + " = " + std::to_string(e.raid_target)); - v.push_back(columns[97] + " = " + std::to_string(e.armtexture)); - v.push_back(columns[98] + " = " + std::to_string(e.bracertexture)); - v.push_back(columns[99] + " = " + std::to_string(e.handtexture)); - v.push_back(columns[100] + " = " + std::to_string(e.legtexture)); - v.push_back(columns[101] + " = " + std::to_string(e.feettexture)); - v.push_back(columns[102] + " = " + std::to_string(e.light)); - v.push_back(columns[103] + " = " + std::to_string(e.walkspeed)); - v.push_back(columns[104] + " = " + std::to_string(e.peqid)); - v.push_back(columns[105] + " = " + std::to_string(e.unique_)); - v.push_back(columns[106] + " = " + std::to_string(e.fixed)); - v.push_back(columns[107] + " = " + std::to_string(e.ignore_despawn)); - v.push_back(columns[108] + " = " + std::to_string(e.show_name)); - v.push_back(columns[109] + " = " + std::to_string(e.untargetable)); - v.push_back(columns[110] + " = " + std::to_string(e.charm_ac)); - v.push_back(columns[111] + " = " + std::to_string(e.charm_min_dmg)); - v.push_back(columns[112] + " = " + std::to_string(e.charm_max_dmg)); - v.push_back(columns[113] + " = " + std::to_string(e.charm_attack_delay)); - v.push_back(columns[114] + " = " + std::to_string(e.charm_accuracy_rating)); - v.push_back(columns[115] + " = " + std::to_string(e.charm_avoidance_rating)); - v.push_back(columns[116] + " = " + std::to_string(e.charm_atk)); - v.push_back(columns[117] + " = " + std::to_string(e.skip_global_loot)); - v.push_back(columns[118] + " = " + std::to_string(e.rare_spawn)); - v.push_back(columns[119] + " = " + std::to_string(e.stuck_behavior)); - v.push_back(columns[120] + " = " + std::to_string(e.model)); - v.push_back(columns[121] + " = " + std::to_string(e.flymode)); - v.push_back(columns[122] + " = " + std::to_string(e.always_aggro)); - v.push_back(columns[123] + " = " + std::to_string(e.exp_mod)); - v.push_back(columns[124] + " = " + std::to_string(e.heroic_strikethrough)); - v.push_back(columns[125] + " = " + std::to_string(e.faction_amount)); - v.push_back(columns[126] + " = " + std::to_string(e.keeps_sold_items)); - v.push_back(columns[127] + " = " + std::to_string(e.is_parcel_merchant)); + v.push_back(columns[19] + " = " + std::to_string(e.greed)); + v.push_back(columns[20] + " = " + std::to_string(e.alt_currency_id)); + v.push_back(columns[21] + " = " + std::to_string(e.npc_spells_id)); + v.push_back(columns[22] + " = " + std::to_string(e.npc_spells_effects_id)); + v.push_back(columns[23] + " = " + std::to_string(e.npc_faction_id)); + v.push_back(columns[24] + " = " + std::to_string(e.adventure_template_id)); + v.push_back(columns[25] + " = " + std::to_string(e.trap_template)); + v.push_back(columns[26] + " = " + std::to_string(e.mindmg)); + v.push_back(columns[27] + " = " + std::to_string(e.maxdmg)); + v.push_back(columns[28] + " = " + std::to_string(e.attack_count)); + v.push_back(columns[29] + " = '" + Strings::Escape(e.npcspecialattks) + "'"); + v.push_back(columns[30] + " = '" + Strings::Escape(e.special_abilities) + "'"); + v.push_back(columns[31] + " = " + std::to_string(e.aggroradius)); + v.push_back(columns[32] + " = " + std::to_string(e.assistradius)); + v.push_back(columns[33] + " = " + std::to_string(e.face)); + v.push_back(columns[34] + " = " + std::to_string(e.luclin_hairstyle)); + v.push_back(columns[35] + " = " + std::to_string(e.luclin_haircolor)); + v.push_back(columns[36] + " = " + std::to_string(e.luclin_eyecolor)); + v.push_back(columns[37] + " = " + std::to_string(e.luclin_eyecolor2)); + v.push_back(columns[38] + " = " + std::to_string(e.luclin_beardcolor)); + v.push_back(columns[39] + " = " + std::to_string(e.luclin_beard)); + v.push_back(columns[40] + " = " + std::to_string(e.drakkin_heritage)); + v.push_back(columns[41] + " = " + std::to_string(e.drakkin_tattoo)); + v.push_back(columns[42] + " = " + std::to_string(e.drakkin_details)); + v.push_back(columns[43] + " = " + std::to_string(e.armortint_id)); + v.push_back(columns[44] + " = " + std::to_string(e.armortint_red)); + v.push_back(columns[45] + " = " + std::to_string(e.armortint_green)); + v.push_back(columns[46] + " = " + std::to_string(e.armortint_blue)); + v.push_back(columns[47] + " = " + std::to_string(e.d_melee_texture1)); + v.push_back(columns[48] + " = " + std::to_string(e.d_melee_texture2)); + v.push_back(columns[49] + " = '" + Strings::Escape(e.ammo_idfile) + "'"); + v.push_back(columns[50] + " = " + std::to_string(e.prim_melee_type)); + v.push_back(columns[51] + " = " + std::to_string(e.sec_melee_type)); + v.push_back(columns[52] + " = " + std::to_string(e.ranged_type)); + v.push_back(columns[53] + " = " + std::to_string(e.runspeed)); + v.push_back(columns[54] + " = " + std::to_string(e.MR)); + v.push_back(columns[55] + " = " + std::to_string(e.CR)); + v.push_back(columns[56] + " = " + std::to_string(e.DR)); + v.push_back(columns[57] + " = " + std::to_string(e.FR)); + v.push_back(columns[58] + " = " + std::to_string(e.PR)); + v.push_back(columns[59] + " = " + std::to_string(e.Corrup)); + v.push_back(columns[60] + " = " + std::to_string(e.PhR)); + v.push_back(columns[61] + " = " + std::to_string(e.see_invis)); + v.push_back(columns[62] + " = " + std::to_string(e.see_invis_undead)); + v.push_back(columns[63] + " = " + std::to_string(e.qglobal)); + v.push_back(columns[64] + " = " + std::to_string(e.AC)); + v.push_back(columns[65] + " = " + std::to_string(e.npc_aggro)); + v.push_back(columns[66] + " = " + std::to_string(e.spawn_limit)); + v.push_back(columns[67] + " = " + std::to_string(e.attack_speed)); + v.push_back(columns[68] + " = " + std::to_string(e.attack_delay)); + v.push_back(columns[69] + " = " + std::to_string(e.findable)); + v.push_back(columns[70] + " = " + std::to_string(e.STR)); + v.push_back(columns[71] + " = " + std::to_string(e.STA)); + v.push_back(columns[72] + " = " + std::to_string(e.DEX)); + v.push_back(columns[73] + " = " + std::to_string(e.AGI)); + v.push_back(columns[74] + " = " + std::to_string(e._INT)); + v.push_back(columns[75] + " = " + std::to_string(e.WIS)); + v.push_back(columns[76] + " = " + std::to_string(e.CHA)); + v.push_back(columns[77] + " = " + std::to_string(e.see_hide)); + v.push_back(columns[78] + " = " + std::to_string(e.see_improved_hide)); + v.push_back(columns[79] + " = " + std::to_string(e.trackable)); + v.push_back(columns[80] + " = " + std::to_string(e.isbot)); + v.push_back(columns[81] + " = " + std::to_string(e.exclude)); + v.push_back(columns[82] + " = " + std::to_string(e.ATK)); + v.push_back(columns[83] + " = " + std::to_string(e.Accuracy)); + v.push_back(columns[84] + " = " + std::to_string(e.Avoidance)); + v.push_back(columns[85] + " = " + std::to_string(e.slow_mitigation)); + v.push_back(columns[86] + " = " + std::to_string(e.version)); + v.push_back(columns[87] + " = " + std::to_string(e.maxlevel)); + v.push_back(columns[88] + " = " + std::to_string(e.scalerate)); + v.push_back(columns[89] + " = " + std::to_string(e.private_corpse)); + v.push_back(columns[90] + " = " + std::to_string(e.unique_spawn_by_name)); + v.push_back(columns[91] + " = " + std::to_string(e.underwater)); + v.push_back(columns[92] + " = " + std::to_string(e.isquest)); + v.push_back(columns[93] + " = " + std::to_string(e.emoteid)); + v.push_back(columns[94] + " = " + std::to_string(e.spellscale)); + v.push_back(columns[95] + " = " + std::to_string(e.healscale)); + v.push_back(columns[96] + " = " + std::to_string(e.no_target_hotkey)); + v.push_back(columns[97] + " = " + std::to_string(e.raid_target)); + v.push_back(columns[98] + " = " + std::to_string(e.armtexture)); + v.push_back(columns[99] + " = " + std::to_string(e.bracertexture)); + v.push_back(columns[100] + " = " + std::to_string(e.handtexture)); + v.push_back(columns[101] + " = " + std::to_string(e.legtexture)); + v.push_back(columns[102] + " = " + std::to_string(e.feettexture)); + v.push_back(columns[103] + " = " + std::to_string(e.light)); + v.push_back(columns[104] + " = " + std::to_string(e.walkspeed)); + v.push_back(columns[105] + " = " + std::to_string(e.peqid)); + v.push_back(columns[106] + " = " + std::to_string(e.unique_)); + v.push_back(columns[107] + " = " + std::to_string(e.fixed)); + v.push_back(columns[108] + " = " + std::to_string(e.ignore_despawn)); + v.push_back(columns[109] + " = " + std::to_string(e.show_name)); + v.push_back(columns[110] + " = " + std::to_string(e.untargetable)); + v.push_back(columns[111] + " = " + std::to_string(e.charm_ac)); + v.push_back(columns[112] + " = " + std::to_string(e.charm_min_dmg)); + v.push_back(columns[113] + " = " + std::to_string(e.charm_max_dmg)); + v.push_back(columns[114] + " = " + std::to_string(e.charm_attack_delay)); + v.push_back(columns[115] + " = " + std::to_string(e.charm_accuracy_rating)); + v.push_back(columns[116] + " = " + std::to_string(e.charm_avoidance_rating)); + v.push_back(columns[117] + " = " + std::to_string(e.charm_atk)); + v.push_back(columns[118] + " = " + std::to_string(e.skip_global_loot)); + v.push_back(columns[119] + " = " + std::to_string(e.rare_spawn)); + v.push_back(columns[120] + " = " + std::to_string(e.stuck_behavior)); + v.push_back(columns[121] + " = " + std::to_string(e.model)); + v.push_back(columns[122] + " = " + std::to_string(e.flymode)); + v.push_back(columns[123] + " = " + std::to_string(e.always_aggro)); + v.push_back(columns[124] + " = " + std::to_string(e.exp_mod)); + v.push_back(columns[125] + " = " + std::to_string(e.heroic_strikethrough)); + v.push_back(columns[126] + " = " + std::to_string(e.faction_amount)); + v.push_back(columns[127] + " = " + std::to_string(e.keeps_sold_items)); + v.push_back(columns[128] + " = " + std::to_string(e.is_parcel_merchant)); auto results = db.QueryDatabase( fmt::format( @@ -951,6 +957,7 @@ public: v.push_back(std::to_string(e.mana_regen_rate)); v.push_back(std::to_string(e.loottable_id)); v.push_back(std::to_string(e.merchant_id)); + v.push_back(std::to_string(e.greed)); v.push_back(std::to_string(e.alt_currency_id)); v.push_back(std::to_string(e.npc_spells_id)); v.push_back(std::to_string(e.npc_spells_effects_id)); @@ -1108,6 +1115,7 @@ public: v.push_back(std::to_string(e.mana_regen_rate)); v.push_back(std::to_string(e.loottable_id)); v.push_back(std::to_string(e.merchant_id)); + v.push_back(std::to_string(e.greed)); v.push_back(std::to_string(e.alt_currency_id)); v.push_back(std::to_string(e.npc_spells_id)); v.push_back(std::to_string(e.npc_spells_effects_id)); @@ -1269,115 +1277,116 @@ public: e.mana_regen_rate = row[16] ? strtoll(row[16], nullptr, 10) : 0; e.loottable_id = row[17] ? static_cast(strtoul(row[17], nullptr, 10)) : 0; e.merchant_id = row[18] ? static_cast(strtoul(row[18], nullptr, 10)) : 0; - e.alt_currency_id = row[19] ? static_cast(strtoul(row[19], nullptr, 10)) : 0; - e.npc_spells_id = row[20] ? static_cast(strtoul(row[20], nullptr, 10)) : 0; - e.npc_spells_effects_id = row[21] ? static_cast(strtoul(row[21], nullptr, 10)) : 0; - e.npc_faction_id = row[22] ? static_cast(atoi(row[22])) : 0; - e.adventure_template_id = row[23] ? static_cast(strtoul(row[23], nullptr, 10)) : 0; - e.trap_template = row[24] ? static_cast(strtoul(row[24], nullptr, 10)) : 0; - e.mindmg = row[25] ? static_cast(strtoul(row[25], nullptr, 10)) : 0; - e.maxdmg = row[26] ? static_cast(strtoul(row[26], nullptr, 10)) : 0; - e.attack_count = row[27] ? static_cast(atoi(row[27])) : -1; - e.npcspecialattks = row[28] ? row[28] : ""; - e.special_abilities = row[29] ? row[29] : ""; - e.aggroradius = row[30] ? static_cast(strtoul(row[30], nullptr, 10)) : 0; - e.assistradius = row[31] ? static_cast(strtoul(row[31], nullptr, 10)) : 0; - e.face = row[32] ? static_cast(strtoul(row[32], nullptr, 10)) : 1; - e.luclin_hairstyle = row[33] ? static_cast(strtoul(row[33], nullptr, 10)) : 1; - e.luclin_haircolor = row[34] ? static_cast(strtoul(row[34], nullptr, 10)) : 1; - e.luclin_eyecolor = row[35] ? static_cast(strtoul(row[35], nullptr, 10)) : 1; - e.luclin_eyecolor2 = row[36] ? static_cast(strtoul(row[36], nullptr, 10)) : 1; - e.luclin_beardcolor = row[37] ? static_cast(strtoul(row[37], nullptr, 10)) : 1; - e.luclin_beard = row[38] ? static_cast(strtoul(row[38], nullptr, 10)) : 0; - e.drakkin_heritage = row[39] ? static_cast(atoi(row[39])) : 0; - e.drakkin_tattoo = row[40] ? static_cast(atoi(row[40])) : 0; - e.drakkin_details = row[41] ? static_cast(atoi(row[41])) : 0; - e.armortint_id = row[42] ? static_cast(strtoul(row[42], nullptr, 10)) : 0; - e.armortint_red = row[43] ? static_cast(strtoul(row[43], nullptr, 10)) : 0; - e.armortint_green = row[44] ? static_cast(strtoul(row[44], nullptr, 10)) : 0; - e.armortint_blue = row[45] ? static_cast(strtoul(row[45], nullptr, 10)) : 0; - e.d_melee_texture1 = row[46] ? static_cast(strtoul(row[46], nullptr, 10)) : 0; - e.d_melee_texture2 = row[47] ? static_cast(strtoul(row[47], nullptr, 10)) : 0; - e.ammo_idfile = row[48] ? row[48] : "IT10"; - e.prim_melee_type = row[49] ? static_cast(strtoul(row[49], nullptr, 10)) : 28; - e.sec_melee_type = row[50] ? static_cast(strtoul(row[50], nullptr, 10)) : 28; - e.ranged_type = row[51] ? static_cast(strtoul(row[51], nullptr, 10)) : 7; - e.runspeed = row[52] ? strtof(row[52], nullptr) : 0; - e.MR = row[53] ? static_cast(atoi(row[53])) : 0; - e.CR = row[54] ? static_cast(atoi(row[54])) : 0; - e.DR = row[55] ? static_cast(atoi(row[55])) : 0; - e.FR = row[56] ? static_cast(atoi(row[56])) : 0; - e.PR = row[57] ? static_cast(atoi(row[57])) : 0; - e.Corrup = row[58] ? static_cast(atoi(row[58])) : 0; - e.PhR = row[59] ? static_cast(strtoul(row[59], nullptr, 10)) : 0; - e.see_invis = row[60] ? static_cast(atoi(row[60])) : 0; - e.see_invis_undead = row[61] ? static_cast(atoi(row[61])) : 0; - e.qglobal = row[62] ? static_cast(strtoul(row[62], nullptr, 10)) : 0; - e.AC = row[63] ? static_cast(atoi(row[63])) : 0; - e.npc_aggro = row[64] ? static_cast(atoi(row[64])) : 0; - e.spawn_limit = row[65] ? static_cast(atoi(row[65])) : 0; - e.attack_speed = row[66] ? strtof(row[66], nullptr) : 0; - e.attack_delay = row[67] ? static_cast(strtoul(row[67], nullptr, 10)) : 30; - e.findable = row[68] ? static_cast(atoi(row[68])) : 0; - e.STR = row[69] ? static_cast(strtoul(row[69], nullptr, 10)) : 75; - e.STA = row[70] ? static_cast(strtoul(row[70], nullptr, 10)) : 75; - e.DEX = row[71] ? static_cast(strtoul(row[71], nullptr, 10)) : 75; - e.AGI = row[72] ? static_cast(strtoul(row[72], nullptr, 10)) : 75; - e._INT = row[73] ? static_cast(strtoul(row[73], nullptr, 10)) : 80; - e.WIS = row[74] ? static_cast(strtoul(row[74], nullptr, 10)) : 75; - e.CHA = row[75] ? static_cast(strtoul(row[75], nullptr, 10)) : 75; - e.see_hide = row[76] ? static_cast(atoi(row[76])) : 0; - e.see_improved_hide = row[77] ? static_cast(atoi(row[77])) : 0; - e.trackable = row[78] ? static_cast(atoi(row[78])) : 1; - e.isbot = row[79] ? static_cast(atoi(row[79])) : 0; - e.exclude = row[80] ? static_cast(atoi(row[80])) : 1; - e.ATK = row[81] ? static_cast(atoi(row[81])) : 0; - e.Accuracy = row[82] ? static_cast(atoi(row[82])) : 0; - e.Avoidance = row[83] ? static_cast(strtoul(row[83], nullptr, 10)) : 0; - e.slow_mitigation = row[84] ? static_cast(atoi(row[84])) : 0; - e.version = row[85] ? static_cast(strtoul(row[85], nullptr, 10)) : 0; - e.maxlevel = row[86] ? static_cast(atoi(row[86])) : 0; - e.scalerate = row[87] ? static_cast(atoi(row[87])) : 100; - e.private_corpse = row[88] ? static_cast(strtoul(row[88], nullptr, 10)) : 0; - e.unique_spawn_by_name = row[89] ? static_cast(strtoul(row[89], nullptr, 10)) : 0; - e.underwater = row[90] ? static_cast(strtoul(row[90], nullptr, 10)) : 0; - e.isquest = row[91] ? static_cast(atoi(row[91])) : 0; - e.emoteid = row[92] ? static_cast(strtoul(row[92], nullptr, 10)) : 0; - e.spellscale = row[93] ? strtof(row[93], nullptr) : 100; - e.healscale = row[94] ? strtof(row[94], nullptr) : 100; - e.no_target_hotkey = row[95] ? static_cast(strtoul(row[95], nullptr, 10)) : 0; - e.raid_target = row[96] ? static_cast(strtoul(row[96], nullptr, 10)) : 0; - e.armtexture = row[97] ? static_cast(atoi(row[97])) : 0; - e.bracertexture = row[98] ? static_cast(atoi(row[98])) : 0; - e.handtexture = row[99] ? static_cast(atoi(row[99])) : 0; - e.legtexture = row[100] ? static_cast(atoi(row[100])) : 0; - e.feettexture = row[101] ? static_cast(atoi(row[101])) : 0; - e.light = row[102] ? static_cast(atoi(row[102])) : 0; - e.walkspeed = row[103] ? static_cast(atoi(row[103])) : 0; - e.peqid = row[104] ? static_cast(atoi(row[104])) : 0; - e.unique_ = row[105] ? static_cast(atoi(row[105])) : 0; - e.fixed = row[106] ? static_cast(atoi(row[106])) : 0; - e.ignore_despawn = row[107] ? static_cast(atoi(row[107])) : 0; - e.show_name = row[108] ? static_cast(atoi(row[108])) : 1; - e.untargetable = row[109] ? static_cast(atoi(row[109])) : 0; - e.charm_ac = row[110] ? static_cast(atoi(row[110])) : 0; - e.charm_min_dmg = row[111] ? static_cast(atoi(row[111])) : 0; - e.charm_max_dmg = row[112] ? static_cast(atoi(row[112])) : 0; - e.charm_attack_delay = row[113] ? static_cast(atoi(row[113])) : 0; - e.charm_accuracy_rating = row[114] ? static_cast(atoi(row[114])) : 0; - e.charm_avoidance_rating = row[115] ? static_cast(atoi(row[115])) : 0; - e.charm_atk = row[116] ? static_cast(atoi(row[116])) : 0; - e.skip_global_loot = row[117] ? static_cast(atoi(row[117])) : 0; - e.rare_spawn = row[118] ? static_cast(atoi(row[118])) : 0; - e.stuck_behavior = row[119] ? static_cast(atoi(row[119])) : 0; - e.model = row[120] ? static_cast(atoi(row[120])) : 0; - e.flymode = row[121] ? static_cast(atoi(row[121])) : -1; - e.always_aggro = row[122] ? static_cast(atoi(row[122])) : 0; - e.exp_mod = row[123] ? static_cast(atoi(row[123])) : 100; - e.heroic_strikethrough = row[124] ? static_cast(atoi(row[124])) : 0; - e.faction_amount = row[125] ? static_cast(atoi(row[125])) : 0; - e.keeps_sold_items = row[126] ? static_cast(strtoul(row[126], nullptr, 10)) : 1; - e.is_parcel_merchant = row[127] ? static_cast(strtoul(row[127], nullptr, 10)) : 0; + e.greed = row[19] ? static_cast(strtoul(row[19], nullptr, 10)) : 0; + e.alt_currency_id = row[20] ? static_cast(strtoul(row[20], nullptr, 10)) : 0; + e.npc_spells_id = row[21] ? static_cast(strtoul(row[21], nullptr, 10)) : 0; + e.npc_spells_effects_id = row[22] ? static_cast(strtoul(row[22], nullptr, 10)) : 0; + e.npc_faction_id = row[23] ? static_cast(atoi(row[23])) : 0; + e.adventure_template_id = row[24] ? static_cast(strtoul(row[24], nullptr, 10)) : 0; + e.trap_template = row[25] ? static_cast(strtoul(row[25], nullptr, 10)) : 0; + e.mindmg = row[26] ? static_cast(strtoul(row[26], nullptr, 10)) : 0; + e.maxdmg = row[27] ? static_cast(strtoul(row[27], nullptr, 10)) : 0; + e.attack_count = row[28] ? static_cast(atoi(row[28])) : -1; + e.npcspecialattks = row[29] ? row[29] : ""; + e.special_abilities = row[30] ? row[30] : ""; + e.aggroradius = row[31] ? static_cast(strtoul(row[31], nullptr, 10)) : 0; + e.assistradius = row[32] ? static_cast(strtoul(row[32], nullptr, 10)) : 0; + e.face = row[33] ? static_cast(strtoul(row[33], nullptr, 10)) : 1; + e.luclin_hairstyle = row[34] ? static_cast(strtoul(row[34], nullptr, 10)) : 1; + e.luclin_haircolor = row[35] ? static_cast(strtoul(row[35], nullptr, 10)) : 1; + e.luclin_eyecolor = row[36] ? static_cast(strtoul(row[36], nullptr, 10)) : 1; + e.luclin_eyecolor2 = row[37] ? static_cast(strtoul(row[37], nullptr, 10)) : 1; + e.luclin_beardcolor = row[38] ? static_cast(strtoul(row[38], nullptr, 10)) : 1; + e.luclin_beard = row[39] ? static_cast(strtoul(row[39], nullptr, 10)) : 0; + e.drakkin_heritage = row[40] ? static_cast(atoi(row[40])) : 0; + e.drakkin_tattoo = row[41] ? static_cast(atoi(row[41])) : 0; + e.drakkin_details = row[42] ? static_cast(atoi(row[42])) : 0; + e.armortint_id = row[43] ? static_cast(strtoul(row[43], nullptr, 10)) : 0; + e.armortint_red = row[44] ? static_cast(strtoul(row[44], nullptr, 10)) : 0; + e.armortint_green = row[45] ? static_cast(strtoul(row[45], nullptr, 10)) : 0; + e.armortint_blue = row[46] ? static_cast(strtoul(row[46], nullptr, 10)) : 0; + e.d_melee_texture1 = row[47] ? static_cast(strtoul(row[47], nullptr, 10)) : 0; + e.d_melee_texture2 = row[48] ? static_cast(strtoul(row[48], nullptr, 10)) : 0; + e.ammo_idfile = row[49] ? row[49] : "IT10"; + e.prim_melee_type = row[50] ? static_cast(strtoul(row[50], nullptr, 10)) : 28; + e.sec_melee_type = row[51] ? static_cast(strtoul(row[51], nullptr, 10)) : 28; + e.ranged_type = row[52] ? static_cast(strtoul(row[52], nullptr, 10)) : 7; + e.runspeed = row[53] ? strtof(row[53], nullptr) : 0; + e.MR = row[54] ? static_cast(atoi(row[54])) : 0; + e.CR = row[55] ? static_cast(atoi(row[55])) : 0; + e.DR = row[56] ? static_cast(atoi(row[56])) : 0; + e.FR = row[57] ? static_cast(atoi(row[57])) : 0; + e.PR = row[58] ? static_cast(atoi(row[58])) : 0; + e.Corrup = row[59] ? static_cast(atoi(row[59])) : 0; + e.PhR = row[60] ? static_cast(strtoul(row[60], nullptr, 10)) : 0; + e.see_invis = row[61] ? static_cast(atoi(row[61])) : 0; + e.see_invis_undead = row[62] ? static_cast(atoi(row[62])) : 0; + e.qglobal = row[63] ? static_cast(strtoul(row[63], nullptr, 10)) : 0; + e.AC = row[64] ? static_cast(atoi(row[64])) : 0; + e.npc_aggro = row[65] ? static_cast(atoi(row[65])) : 0; + e.spawn_limit = row[66] ? static_cast(atoi(row[66])) : 0; + e.attack_speed = row[67] ? strtof(row[67], nullptr) : 0; + e.attack_delay = row[68] ? static_cast(strtoul(row[68], nullptr, 10)) : 30; + e.findable = row[69] ? static_cast(atoi(row[69])) : 0; + e.STR = row[70] ? static_cast(strtoul(row[70], nullptr, 10)) : 75; + e.STA = row[71] ? static_cast(strtoul(row[71], nullptr, 10)) : 75; + e.DEX = row[72] ? static_cast(strtoul(row[72], nullptr, 10)) : 75; + e.AGI = row[73] ? static_cast(strtoul(row[73], nullptr, 10)) : 75; + e._INT = row[74] ? static_cast(strtoul(row[74], nullptr, 10)) : 80; + e.WIS = row[75] ? static_cast(strtoul(row[75], nullptr, 10)) : 75; + e.CHA = row[76] ? static_cast(strtoul(row[76], nullptr, 10)) : 75; + e.see_hide = row[77] ? static_cast(atoi(row[77])) : 0; + e.see_improved_hide = row[78] ? static_cast(atoi(row[78])) : 0; + e.trackable = row[79] ? static_cast(atoi(row[79])) : 1; + e.isbot = row[80] ? static_cast(atoi(row[80])) : 0; + e.exclude = row[81] ? static_cast(atoi(row[81])) : 1; + e.ATK = row[82] ? static_cast(atoi(row[82])) : 0; + e.Accuracy = row[83] ? static_cast(atoi(row[83])) : 0; + e.Avoidance = row[84] ? static_cast(strtoul(row[84], nullptr, 10)) : 0; + e.slow_mitigation = row[85] ? static_cast(atoi(row[85])) : 0; + e.version = row[86] ? static_cast(strtoul(row[86], nullptr, 10)) : 0; + e.maxlevel = row[87] ? static_cast(atoi(row[87])) : 0; + e.scalerate = row[88] ? static_cast(atoi(row[88])) : 100; + e.private_corpse = row[89] ? static_cast(strtoul(row[89], nullptr, 10)) : 0; + e.unique_spawn_by_name = row[90] ? static_cast(strtoul(row[90], nullptr, 10)) : 0; + e.underwater = row[91] ? static_cast(strtoul(row[91], nullptr, 10)) : 0; + e.isquest = row[92] ? static_cast(atoi(row[92])) : 0; + e.emoteid = row[93] ? static_cast(strtoul(row[93], nullptr, 10)) : 0; + e.spellscale = row[94] ? strtof(row[94], nullptr) : 100; + e.healscale = row[95] ? strtof(row[95], nullptr) : 100; + e.no_target_hotkey = row[96] ? static_cast(strtoul(row[96], nullptr, 10)) : 0; + e.raid_target = row[97] ? static_cast(strtoul(row[97], nullptr, 10)) : 0; + e.armtexture = row[98] ? static_cast(atoi(row[98])) : 0; + e.bracertexture = row[99] ? static_cast(atoi(row[99])) : 0; + e.handtexture = row[100] ? static_cast(atoi(row[100])) : 0; + e.legtexture = row[101] ? static_cast(atoi(row[101])) : 0; + e.feettexture = row[102] ? static_cast(atoi(row[102])) : 0; + e.light = row[103] ? static_cast(atoi(row[103])) : 0; + e.walkspeed = row[104] ? static_cast(atoi(row[104])) : 0; + e.peqid = row[105] ? static_cast(atoi(row[105])) : 0; + e.unique_ = row[106] ? static_cast(atoi(row[106])) : 0; + e.fixed = row[107] ? static_cast(atoi(row[107])) : 0; + e.ignore_despawn = row[108] ? static_cast(atoi(row[108])) : 0; + e.show_name = row[109] ? static_cast(atoi(row[109])) : 1; + e.untargetable = row[110] ? static_cast(atoi(row[110])) : 0; + e.charm_ac = row[111] ? static_cast(atoi(row[111])) : 0; + e.charm_min_dmg = row[112] ? static_cast(atoi(row[112])) : 0; + e.charm_max_dmg = row[113] ? static_cast(atoi(row[113])) : 0; + e.charm_attack_delay = row[114] ? static_cast(atoi(row[114])) : 0; + e.charm_accuracy_rating = row[115] ? static_cast(atoi(row[115])) : 0; + e.charm_avoidance_rating = row[116] ? static_cast(atoi(row[116])) : 0; + e.charm_atk = row[117] ? static_cast(atoi(row[117])) : 0; + e.skip_global_loot = row[118] ? static_cast(atoi(row[118])) : 0; + e.rare_spawn = row[119] ? static_cast(atoi(row[119])) : 0; + e.stuck_behavior = row[120] ? static_cast(atoi(row[120])) : 0; + e.model = row[121] ? static_cast(atoi(row[121])) : 0; + e.flymode = row[122] ? static_cast(atoi(row[122])) : -1; + e.always_aggro = row[123] ? static_cast(atoi(row[123])) : 0; + e.exp_mod = row[124] ? static_cast(atoi(row[124])) : 100; + e.heroic_strikethrough = row[125] ? static_cast(atoi(row[125])) : 0; + e.faction_amount = row[126] ? static_cast(atoi(row[126])) : 0; + e.keeps_sold_items = row[127] ? static_cast(strtoul(row[127], nullptr, 10)) : 1; + e.is_parcel_merchant = row[128] ? static_cast(strtoul(row[128], nullptr, 10)) : 0; all_entries.push_back(e); } @@ -1421,115 +1430,116 @@ public: e.mana_regen_rate = row[16] ? strtoll(row[16], nullptr, 10) : 0; e.loottable_id = row[17] ? static_cast(strtoul(row[17], nullptr, 10)) : 0; e.merchant_id = row[18] ? static_cast(strtoul(row[18], nullptr, 10)) : 0; - e.alt_currency_id = row[19] ? static_cast(strtoul(row[19], nullptr, 10)) : 0; - e.npc_spells_id = row[20] ? static_cast(strtoul(row[20], nullptr, 10)) : 0; - e.npc_spells_effects_id = row[21] ? static_cast(strtoul(row[21], nullptr, 10)) : 0; - e.npc_faction_id = row[22] ? static_cast(atoi(row[22])) : 0; - e.adventure_template_id = row[23] ? static_cast(strtoul(row[23], nullptr, 10)) : 0; - e.trap_template = row[24] ? static_cast(strtoul(row[24], nullptr, 10)) : 0; - e.mindmg = row[25] ? static_cast(strtoul(row[25], nullptr, 10)) : 0; - e.maxdmg = row[26] ? static_cast(strtoul(row[26], nullptr, 10)) : 0; - e.attack_count = row[27] ? static_cast(atoi(row[27])) : -1; - e.npcspecialattks = row[28] ? row[28] : ""; - e.special_abilities = row[29] ? row[29] : ""; - e.aggroradius = row[30] ? static_cast(strtoul(row[30], nullptr, 10)) : 0; - e.assistradius = row[31] ? static_cast(strtoul(row[31], nullptr, 10)) : 0; - e.face = row[32] ? static_cast(strtoul(row[32], nullptr, 10)) : 1; - e.luclin_hairstyle = row[33] ? static_cast(strtoul(row[33], nullptr, 10)) : 1; - e.luclin_haircolor = row[34] ? static_cast(strtoul(row[34], nullptr, 10)) : 1; - e.luclin_eyecolor = row[35] ? static_cast(strtoul(row[35], nullptr, 10)) : 1; - e.luclin_eyecolor2 = row[36] ? static_cast(strtoul(row[36], nullptr, 10)) : 1; - e.luclin_beardcolor = row[37] ? static_cast(strtoul(row[37], nullptr, 10)) : 1; - e.luclin_beard = row[38] ? static_cast(strtoul(row[38], nullptr, 10)) : 0; - e.drakkin_heritage = row[39] ? static_cast(atoi(row[39])) : 0; - e.drakkin_tattoo = row[40] ? static_cast(atoi(row[40])) : 0; - e.drakkin_details = row[41] ? static_cast(atoi(row[41])) : 0; - e.armortint_id = row[42] ? static_cast(strtoul(row[42], nullptr, 10)) : 0; - e.armortint_red = row[43] ? static_cast(strtoul(row[43], nullptr, 10)) : 0; - e.armortint_green = row[44] ? static_cast(strtoul(row[44], nullptr, 10)) : 0; - e.armortint_blue = row[45] ? static_cast(strtoul(row[45], nullptr, 10)) : 0; - e.d_melee_texture1 = row[46] ? static_cast(strtoul(row[46], nullptr, 10)) : 0; - e.d_melee_texture2 = row[47] ? static_cast(strtoul(row[47], nullptr, 10)) : 0; - e.ammo_idfile = row[48] ? row[48] : "IT10"; - e.prim_melee_type = row[49] ? static_cast(strtoul(row[49], nullptr, 10)) : 28; - e.sec_melee_type = row[50] ? static_cast(strtoul(row[50], nullptr, 10)) : 28; - e.ranged_type = row[51] ? static_cast(strtoul(row[51], nullptr, 10)) : 7; - e.runspeed = row[52] ? strtof(row[52], nullptr) : 0; - e.MR = row[53] ? static_cast(atoi(row[53])) : 0; - e.CR = row[54] ? static_cast(atoi(row[54])) : 0; - e.DR = row[55] ? static_cast(atoi(row[55])) : 0; - e.FR = row[56] ? static_cast(atoi(row[56])) : 0; - e.PR = row[57] ? static_cast(atoi(row[57])) : 0; - e.Corrup = row[58] ? static_cast(atoi(row[58])) : 0; - e.PhR = row[59] ? static_cast(strtoul(row[59], nullptr, 10)) : 0; - e.see_invis = row[60] ? static_cast(atoi(row[60])) : 0; - e.see_invis_undead = row[61] ? static_cast(atoi(row[61])) : 0; - e.qglobal = row[62] ? static_cast(strtoul(row[62], nullptr, 10)) : 0; - e.AC = row[63] ? static_cast(atoi(row[63])) : 0; - e.npc_aggro = row[64] ? static_cast(atoi(row[64])) : 0; - e.spawn_limit = row[65] ? static_cast(atoi(row[65])) : 0; - e.attack_speed = row[66] ? strtof(row[66], nullptr) : 0; - e.attack_delay = row[67] ? static_cast(strtoul(row[67], nullptr, 10)) : 30; - e.findable = row[68] ? static_cast(atoi(row[68])) : 0; - e.STR = row[69] ? static_cast(strtoul(row[69], nullptr, 10)) : 75; - e.STA = row[70] ? static_cast(strtoul(row[70], nullptr, 10)) : 75; - e.DEX = row[71] ? static_cast(strtoul(row[71], nullptr, 10)) : 75; - e.AGI = row[72] ? static_cast(strtoul(row[72], nullptr, 10)) : 75; - e._INT = row[73] ? static_cast(strtoul(row[73], nullptr, 10)) : 80; - e.WIS = row[74] ? static_cast(strtoul(row[74], nullptr, 10)) : 75; - e.CHA = row[75] ? static_cast(strtoul(row[75], nullptr, 10)) : 75; - e.see_hide = row[76] ? static_cast(atoi(row[76])) : 0; - e.see_improved_hide = row[77] ? static_cast(atoi(row[77])) : 0; - e.trackable = row[78] ? static_cast(atoi(row[78])) : 1; - e.isbot = row[79] ? static_cast(atoi(row[79])) : 0; - e.exclude = row[80] ? static_cast(atoi(row[80])) : 1; - e.ATK = row[81] ? static_cast(atoi(row[81])) : 0; - e.Accuracy = row[82] ? static_cast(atoi(row[82])) : 0; - e.Avoidance = row[83] ? static_cast(strtoul(row[83], nullptr, 10)) : 0; - e.slow_mitigation = row[84] ? static_cast(atoi(row[84])) : 0; - e.version = row[85] ? static_cast(strtoul(row[85], nullptr, 10)) : 0; - e.maxlevel = row[86] ? static_cast(atoi(row[86])) : 0; - e.scalerate = row[87] ? static_cast(atoi(row[87])) : 100; - e.private_corpse = row[88] ? static_cast(strtoul(row[88], nullptr, 10)) : 0; - e.unique_spawn_by_name = row[89] ? static_cast(strtoul(row[89], nullptr, 10)) : 0; - e.underwater = row[90] ? static_cast(strtoul(row[90], nullptr, 10)) : 0; - e.isquest = row[91] ? static_cast(atoi(row[91])) : 0; - e.emoteid = row[92] ? static_cast(strtoul(row[92], nullptr, 10)) : 0; - e.spellscale = row[93] ? strtof(row[93], nullptr) : 100; - e.healscale = row[94] ? strtof(row[94], nullptr) : 100; - e.no_target_hotkey = row[95] ? static_cast(strtoul(row[95], nullptr, 10)) : 0; - e.raid_target = row[96] ? static_cast(strtoul(row[96], nullptr, 10)) : 0; - e.armtexture = row[97] ? static_cast(atoi(row[97])) : 0; - e.bracertexture = row[98] ? static_cast(atoi(row[98])) : 0; - e.handtexture = row[99] ? static_cast(atoi(row[99])) : 0; - e.legtexture = row[100] ? static_cast(atoi(row[100])) : 0; - e.feettexture = row[101] ? static_cast(atoi(row[101])) : 0; - e.light = row[102] ? static_cast(atoi(row[102])) : 0; - e.walkspeed = row[103] ? static_cast(atoi(row[103])) : 0; - e.peqid = row[104] ? static_cast(atoi(row[104])) : 0; - e.unique_ = row[105] ? static_cast(atoi(row[105])) : 0; - e.fixed = row[106] ? static_cast(atoi(row[106])) : 0; - e.ignore_despawn = row[107] ? static_cast(atoi(row[107])) : 0; - e.show_name = row[108] ? static_cast(atoi(row[108])) : 1; - e.untargetable = row[109] ? static_cast(atoi(row[109])) : 0; - e.charm_ac = row[110] ? static_cast(atoi(row[110])) : 0; - e.charm_min_dmg = row[111] ? static_cast(atoi(row[111])) : 0; - e.charm_max_dmg = row[112] ? static_cast(atoi(row[112])) : 0; - e.charm_attack_delay = row[113] ? static_cast(atoi(row[113])) : 0; - e.charm_accuracy_rating = row[114] ? static_cast(atoi(row[114])) : 0; - e.charm_avoidance_rating = row[115] ? static_cast(atoi(row[115])) : 0; - e.charm_atk = row[116] ? static_cast(atoi(row[116])) : 0; - e.skip_global_loot = row[117] ? static_cast(atoi(row[117])) : 0; - e.rare_spawn = row[118] ? static_cast(atoi(row[118])) : 0; - e.stuck_behavior = row[119] ? static_cast(atoi(row[119])) : 0; - e.model = row[120] ? static_cast(atoi(row[120])) : 0; - e.flymode = row[121] ? static_cast(atoi(row[121])) : -1; - e.always_aggro = row[122] ? static_cast(atoi(row[122])) : 0; - e.exp_mod = row[123] ? static_cast(atoi(row[123])) : 100; - e.heroic_strikethrough = row[124] ? static_cast(atoi(row[124])) : 0; - e.faction_amount = row[125] ? static_cast(atoi(row[125])) : 0; - e.keeps_sold_items = row[126] ? static_cast(strtoul(row[126], nullptr, 10)) : 1; - e.is_parcel_merchant = row[127] ? static_cast(strtoul(row[127], nullptr, 10)) : 0; + e.greed = row[19] ? static_cast(strtoul(row[19], nullptr, 10)) : 0; + e.alt_currency_id = row[20] ? static_cast(strtoul(row[20], nullptr, 10)) : 0; + e.npc_spells_id = row[21] ? static_cast(strtoul(row[21], nullptr, 10)) : 0; + e.npc_spells_effects_id = row[22] ? static_cast(strtoul(row[22], nullptr, 10)) : 0; + e.npc_faction_id = row[23] ? static_cast(atoi(row[23])) : 0; + e.adventure_template_id = row[24] ? static_cast(strtoul(row[24], nullptr, 10)) : 0; + e.trap_template = row[25] ? static_cast(strtoul(row[25], nullptr, 10)) : 0; + e.mindmg = row[26] ? static_cast(strtoul(row[26], nullptr, 10)) : 0; + e.maxdmg = row[27] ? static_cast(strtoul(row[27], nullptr, 10)) : 0; + e.attack_count = row[28] ? static_cast(atoi(row[28])) : -1; + e.npcspecialattks = row[29] ? row[29] : ""; + e.special_abilities = row[30] ? row[30] : ""; + e.aggroradius = row[31] ? static_cast(strtoul(row[31], nullptr, 10)) : 0; + e.assistradius = row[32] ? static_cast(strtoul(row[32], nullptr, 10)) : 0; + e.face = row[33] ? static_cast(strtoul(row[33], nullptr, 10)) : 1; + e.luclin_hairstyle = row[34] ? static_cast(strtoul(row[34], nullptr, 10)) : 1; + e.luclin_haircolor = row[35] ? static_cast(strtoul(row[35], nullptr, 10)) : 1; + e.luclin_eyecolor = row[36] ? static_cast(strtoul(row[36], nullptr, 10)) : 1; + e.luclin_eyecolor2 = row[37] ? static_cast(strtoul(row[37], nullptr, 10)) : 1; + e.luclin_beardcolor = row[38] ? static_cast(strtoul(row[38], nullptr, 10)) : 1; + e.luclin_beard = row[39] ? static_cast(strtoul(row[39], nullptr, 10)) : 0; + e.drakkin_heritage = row[40] ? static_cast(atoi(row[40])) : 0; + e.drakkin_tattoo = row[41] ? static_cast(atoi(row[41])) : 0; + e.drakkin_details = row[42] ? static_cast(atoi(row[42])) : 0; + e.armortint_id = row[43] ? static_cast(strtoul(row[43], nullptr, 10)) : 0; + e.armortint_red = row[44] ? static_cast(strtoul(row[44], nullptr, 10)) : 0; + e.armortint_green = row[45] ? static_cast(strtoul(row[45], nullptr, 10)) : 0; + e.armortint_blue = row[46] ? static_cast(strtoul(row[46], nullptr, 10)) : 0; + e.d_melee_texture1 = row[47] ? static_cast(strtoul(row[47], nullptr, 10)) : 0; + e.d_melee_texture2 = row[48] ? static_cast(strtoul(row[48], nullptr, 10)) : 0; + e.ammo_idfile = row[49] ? row[49] : "IT10"; + e.prim_melee_type = row[50] ? static_cast(strtoul(row[50], nullptr, 10)) : 28; + e.sec_melee_type = row[51] ? static_cast(strtoul(row[51], nullptr, 10)) : 28; + e.ranged_type = row[52] ? static_cast(strtoul(row[52], nullptr, 10)) : 7; + e.runspeed = row[53] ? strtof(row[53], nullptr) : 0; + e.MR = row[54] ? static_cast(atoi(row[54])) : 0; + e.CR = row[55] ? static_cast(atoi(row[55])) : 0; + e.DR = row[56] ? static_cast(atoi(row[56])) : 0; + e.FR = row[57] ? static_cast(atoi(row[57])) : 0; + e.PR = row[58] ? static_cast(atoi(row[58])) : 0; + e.Corrup = row[59] ? static_cast(atoi(row[59])) : 0; + e.PhR = row[60] ? static_cast(strtoul(row[60], nullptr, 10)) : 0; + e.see_invis = row[61] ? static_cast(atoi(row[61])) : 0; + e.see_invis_undead = row[62] ? static_cast(atoi(row[62])) : 0; + e.qglobal = row[63] ? static_cast(strtoul(row[63], nullptr, 10)) : 0; + e.AC = row[64] ? static_cast(atoi(row[64])) : 0; + e.npc_aggro = row[65] ? static_cast(atoi(row[65])) : 0; + e.spawn_limit = row[66] ? static_cast(atoi(row[66])) : 0; + e.attack_speed = row[67] ? strtof(row[67], nullptr) : 0; + e.attack_delay = row[68] ? static_cast(strtoul(row[68], nullptr, 10)) : 30; + e.findable = row[69] ? static_cast(atoi(row[69])) : 0; + e.STR = row[70] ? static_cast(strtoul(row[70], nullptr, 10)) : 75; + e.STA = row[71] ? static_cast(strtoul(row[71], nullptr, 10)) : 75; + e.DEX = row[72] ? static_cast(strtoul(row[72], nullptr, 10)) : 75; + e.AGI = row[73] ? static_cast(strtoul(row[73], nullptr, 10)) : 75; + e._INT = row[74] ? static_cast(strtoul(row[74], nullptr, 10)) : 80; + e.WIS = row[75] ? static_cast(strtoul(row[75], nullptr, 10)) : 75; + e.CHA = row[76] ? static_cast(strtoul(row[76], nullptr, 10)) : 75; + e.see_hide = row[77] ? static_cast(atoi(row[77])) : 0; + e.see_improved_hide = row[78] ? static_cast(atoi(row[78])) : 0; + e.trackable = row[79] ? static_cast(atoi(row[79])) : 1; + e.isbot = row[80] ? static_cast(atoi(row[80])) : 0; + e.exclude = row[81] ? static_cast(atoi(row[81])) : 1; + e.ATK = row[82] ? static_cast(atoi(row[82])) : 0; + e.Accuracy = row[83] ? static_cast(atoi(row[83])) : 0; + e.Avoidance = row[84] ? static_cast(strtoul(row[84], nullptr, 10)) : 0; + e.slow_mitigation = row[85] ? static_cast(atoi(row[85])) : 0; + e.version = row[86] ? static_cast(strtoul(row[86], nullptr, 10)) : 0; + e.maxlevel = row[87] ? static_cast(atoi(row[87])) : 0; + e.scalerate = row[88] ? static_cast(atoi(row[88])) : 100; + e.private_corpse = row[89] ? static_cast(strtoul(row[89], nullptr, 10)) : 0; + e.unique_spawn_by_name = row[90] ? static_cast(strtoul(row[90], nullptr, 10)) : 0; + e.underwater = row[91] ? static_cast(strtoul(row[91], nullptr, 10)) : 0; + e.isquest = row[92] ? static_cast(atoi(row[92])) : 0; + e.emoteid = row[93] ? static_cast(strtoul(row[93], nullptr, 10)) : 0; + e.spellscale = row[94] ? strtof(row[94], nullptr) : 100; + e.healscale = row[95] ? strtof(row[95], nullptr) : 100; + e.no_target_hotkey = row[96] ? static_cast(strtoul(row[96], nullptr, 10)) : 0; + e.raid_target = row[97] ? static_cast(strtoul(row[97], nullptr, 10)) : 0; + e.armtexture = row[98] ? static_cast(atoi(row[98])) : 0; + e.bracertexture = row[99] ? static_cast(atoi(row[99])) : 0; + e.handtexture = row[100] ? static_cast(atoi(row[100])) : 0; + e.legtexture = row[101] ? static_cast(atoi(row[101])) : 0; + e.feettexture = row[102] ? static_cast(atoi(row[102])) : 0; + e.light = row[103] ? static_cast(atoi(row[103])) : 0; + e.walkspeed = row[104] ? static_cast(atoi(row[104])) : 0; + e.peqid = row[105] ? static_cast(atoi(row[105])) : 0; + e.unique_ = row[106] ? static_cast(atoi(row[106])) : 0; + e.fixed = row[107] ? static_cast(atoi(row[107])) : 0; + e.ignore_despawn = row[108] ? static_cast(atoi(row[108])) : 0; + e.show_name = row[109] ? static_cast(atoi(row[109])) : 1; + e.untargetable = row[110] ? static_cast(atoi(row[110])) : 0; + e.charm_ac = row[111] ? static_cast(atoi(row[111])) : 0; + e.charm_min_dmg = row[112] ? static_cast(atoi(row[112])) : 0; + e.charm_max_dmg = row[113] ? static_cast(atoi(row[113])) : 0; + e.charm_attack_delay = row[114] ? static_cast(atoi(row[114])) : 0; + e.charm_accuracy_rating = row[115] ? static_cast(atoi(row[115])) : 0; + e.charm_avoidance_rating = row[116] ? static_cast(atoi(row[116])) : 0; + e.charm_atk = row[117] ? static_cast(atoi(row[117])) : 0; + e.skip_global_loot = row[118] ? static_cast(atoi(row[118])) : 0; + e.rare_spawn = row[119] ? static_cast(atoi(row[119])) : 0; + e.stuck_behavior = row[120] ? static_cast(atoi(row[120])) : 0; + e.model = row[121] ? static_cast(atoi(row[121])) : 0; + e.flymode = row[122] ? static_cast(atoi(row[122])) : -1; + e.always_aggro = row[123] ? static_cast(atoi(row[123])) : 0; + e.exp_mod = row[124] ? static_cast(atoi(row[124])) : 100; + e.heroic_strikethrough = row[125] ? static_cast(atoi(row[125])) : 0; + e.faction_amount = row[126] ? static_cast(atoi(row[126])) : 0; + e.keeps_sold_items = row[127] ? static_cast(strtoul(row[127], nullptr, 10)) : 1; + e.is_parcel_merchant = row[128] ? static_cast(strtoul(row[128], nullptr, 10)) : 0; all_entries.push_back(e); } @@ -1623,6 +1633,7 @@ public: v.push_back(std::to_string(e.mana_regen_rate)); v.push_back(std::to_string(e.loottable_id)); v.push_back(std::to_string(e.merchant_id)); + v.push_back(std::to_string(e.greed)); v.push_back(std::to_string(e.alt_currency_id)); v.push_back(std::to_string(e.npc_spells_id)); v.push_back(std::to_string(e.npc_spells_effects_id)); @@ -1773,6 +1784,7 @@ public: v.push_back(std::to_string(e.mana_regen_rate)); v.push_back(std::to_string(e.loottable_id)); v.push_back(std::to_string(e.merchant_id)); + v.push_back(std::to_string(e.greed)); v.push_back(std::to_string(e.alt_currency_id)); v.push_back(std::to_string(e.npc_spells_id)); v.push_back(std::to_string(e.npc_spells_effects_id)); diff --git a/common/ruletypes.h b/common/ruletypes.h index 97b428fce..9e27cbadf 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -754,6 +754,7 @@ RULE_CATEGORY_END() RULE_CATEGORY(Merchant) RULE_BOOL(Merchant, UsePriceMod, true, "Use faction/charisma price modifiers") +RULE_BOOL(Merchant, UseClassicPriceMod, false, "Must also set UsePriceMod. Negates other rules for vendor price mods.") RULE_REAL(Merchant, SellCostMod, 1.05, "Modifier for NPC sell price") RULE_REAL(Merchant, BuyCostMod, 0.95, "Modifier for NPC buy price") RULE_INT(Merchant, PriceBonusPct, 4, "Determines maximum price bonus from having good faction/CHA. Value is a percent") diff --git a/common/version.h b/common/version.h index a21f51dac..47c648d0c 100644 --- a/common/version.h +++ b/common/version.h @@ -42,7 +42,7 @@ * Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9277 +#define CURRENT_BINARY_DATABASE_VERSION 9278 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9044 #endif diff --git a/zone/client.cpp b/zone/client.cpp index d586c97fe..e7535fb2c 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -3761,7 +3761,83 @@ void Client::Escape() MessageString(Chat::Skills, ESCAPE); } -float Client::CalcPriceMod(Mob* other, bool reverse) +float Client::CalcClassicPriceMod(Mob* other, bool reverse) { + float price_multiplier = 0.8f; + + if (other && other->IsNPC()) { + FACTION_VALUE faction_level = GetFactionLevel(CharacterID(), other->CastToNPC()->GetNPCTypeID(), GetRace(), GetClass(), GetDeity(), other->CastToNPC()->GetPrimaryFaction(), other); + int32 cha = GetCHA(); + + if (faction_level <= FACTION_AMIABLY) { + cha += 11; // amiable faction grants a defacto 11 charisma bonus + } + + uint8 greed = other->CastToNPC()->GetGreedPercent(); + + // Sony's precise algorithm is unknown, but this produces output that is virtually identical + if (faction_level <= FACTION_INDIFFERENTLY) { + if (cha > 75) { + if (greed) { + // this is derived from curve fitting to a lot of price data + price_multiplier = -0.2487768 + (1.599635 - -0.2487768) / (1 + pow((cha / 135.1495), 1.001983)); + price_multiplier += (greed + 25u) / 100.0f; // default vendor markup is 25%; anything above that is 'greedy' + price_multiplier = 1.0f / price_multiplier; + } + else { + // non-greedy merchants use a linear scale + price_multiplier = 1.0f - ((115.0f - cha) * 0.004f); + } + } + else if (cha > 60) { + price_multiplier = 1.0f / (1.25f + (greed / 100.0f)); + } + else { + price_multiplier = 1.0f / ((1.0f - (cha - 120.0f) / 220.0f) + (greed / 100.0f)); + } + } + else { // apprehensive + if (cha > 75) { + if (greed) { + // this is derived from curve fitting to a lot of price data + price_multiplier = -0.25f + (1.823662 - -0.25f) / (1 + (cha / 135.0f)); + price_multiplier += (greed + 25u) / 100.0f; // default vendor markup is 25%; anything above that is 'greedy' + price_multiplier = 1.0f / price_multiplier; + } + else { + price_multiplier = (100.0f - (145.0f - cha) / 2.8f) / 100.0f; + } + } + else if (cha > 60) { + price_multiplier = 1.0f / (1.4f + greed / 100.0f); + } + else { + price_multiplier = 1.0f / ((1.0f + (143.574 - cha) / 196.434) + (greed / 100.0f)); + } + } + + float maxResult = 1.0f / 1.05; // price reduction caps at this amount + if (price_multiplier > maxResult) { + price_multiplier = maxResult; + } + + if (!reverse) { + price_multiplier = 1.0f / price_multiplier; + } + } + + LogMerchants( + "[{}] [{}] items at [{}] price multiplier [{}] [{}]", + other->GetName(), + reverse ? "buys" : "sells", + price_multiplier, + reverse ? "from" : "to", + GetName() + ); + + return price_multiplier; +} + +float Client::CalcNewPriceMod(Mob* other, bool reverse) { float chaformula = 0; if (other) @@ -3807,6 +3883,17 @@ float Client::CalcPriceMod(Mob* other, bool reverse) return chaformula; //Returns 1.10, expensive stuff! } +float Client::CalcPriceMod(Mob* other, bool reverse) +{ + float price_mod = CalcNewPriceMod(other, reverse); + + if (RuleB(Merchant, UseClassicPriceMod)) { + price_mod = CalcClassicPriceMod(other, reverse); + } + + return price_mod; +} + void Client::GetGroupAAs(GroupLeadershipAA_Struct *into) const { memcpy(into, &m_pp.leader_abilities.group, sizeof(GroupLeadershipAA_Struct)); } @@ -12474,4 +12561,4 @@ void Client::RemoveItemBySerialNumber(uint32 serial_number, uint32 quantity) } } } -} \ No newline at end of file +} diff --git a/zone/client.h b/zone/client.h index 7ac740f3d..3c3051c29 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1127,6 +1127,8 @@ public: void GoFish(bool guarantee = false, bool use_bait = true); void ForageItem(bool guarantee = false); //Calculate vendor price modifier based on CHA: (reverse==selling) + float CalcClassicPriceMod(Mob* other = 0, bool reverse = false); + float CalcNewPriceMod(Mob* other = 0, bool reverse = false); float CalcPriceMod(Mob* other = 0, bool reverse = false); void ResetTrade(); void DropInst(const EQ::ItemInstance* inst); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index ea96e5726..44b971745 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -14041,16 +14041,21 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) EQ::ItemInstance* inst = database.CreateItem(item, charges); - int SinglePrice = 0; - if (RuleB(Merchant, UsePriceMod)) - SinglePrice = (item->Price * (RuleR(Merchant, SellCostMod)) * item->SellRate * Client::CalcPriceMod(tmp, false)); - else - SinglePrice = (item->Price * (RuleR(Merchant, SellCostMod)) * item->SellRate); + int single_price = (item->Price * item->SellRate); + + // Don't use SellCostMod if using UseClassicPriceMod + if (!RuleB(Merchant, UseClassicPriceMod)) { + single_price *= RuleR(Merchant, SellCostMod); + } + + if (RuleB(Merchant, UsePriceMod)) { + single_price *= Client::CalcPriceMod(tmp, false); + } if (item->MaxCharges > 1) - mpo->price = SinglePrice; + mpo->price = single_price; else - mpo->price = SinglePrice * mp->quantity; + mpo->price = single_price * mp->quantity; if (mpo->price < 0) { @@ -14131,7 +14136,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) else { // Update the charges/quantity in the merchant window inst->SetCharges(new_charges); - inst->SetPrice(SinglePrice); + inst->SetPrice(single_price); inst->SetMerchantSlot(mp->itemslot); inst->SetMerchantCount(new_charges); @@ -14310,7 +14315,15 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) if (RuleB(Merchant, UsePriceMod)) { for (i = 1; i <= cost_quantity; i++) { - price = (uint32)((item->Price * i)*(RuleR(Merchant, BuyCostMod))*Client::CalcPriceMod(vendor, true) + 0.5); // need to round up, because client does it automatically when displaying price + price = (uint32)(item->Price * i) * Client::CalcPriceMod(vendor, true); + + // Don't use SellCostMod if using UseClassicPriceMod + if (!RuleB(Merchant, UseClassicPriceMod)) { + price *= RuleR(Merchant, BuyCostMod); + } + + price += 0.5; // need to round up, because client does it automatically when displaying price + if (price > 4000000000) { cost_quantity = i; mp->quantity = i; @@ -14360,11 +14373,12 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) break; } - uint32 price = ( - item->Price * - RuleR(Merchant, SellCostMod) * - item->SellRate - ); + uint32 price = (item->Price * item->SellRate); + + // Don't use SellCostMod if using UseClassicPriceMod + if (!RuleB(Merchant, UseClassicPriceMod)) { + price *= RuleR(Merchant, SellCostMod); + } if (RuleB(Merchant, UsePriceMod)) { price *= Client::CalcPriceMod(vendor, false); @@ -14571,11 +14585,18 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) mco->command = action; // Merchant command 0x01 = open mco->tab_display = tabs_to_display; + float buy_cost_mod = 1; + + // Only use the BuyCostMod if we're not using the classic function. + if (!RuleB(Merchant, UseClassicPriceMod)) { + buy_cost_mod = RuleR(Merchant, BuyCostMod); + } + if (RuleB(Merchant, UsePriceMod)) { - mco->rate = 1 / ((RuleR(Merchant, BuyCostMod)) * Client::CalcPriceMod(tmp, true)); // works + mco->rate = 1 / (buy_cost_mod * Client::CalcPriceMod(tmp, true)); } else { - mco->rate = 1 / (RuleR(Merchant, BuyCostMod)); + mco->rate = 1 / buy_cost_mod; } outapp->priority = 6; diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 57f295756..782932e2e 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -902,9 +902,14 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { auto inst = database.CreateItem(item, charges); if (inst) { - auto item_price = static_cast(item->Price * RuleR(Merchant, SellCostMod) * item->SellRate); + auto item_price = static_cast(item->Price * item->SellRate); auto item_charges = charges ? charges : 1; + // Don't use SellCostMod if using UseClassicPriceMod + if (!RuleB(Merchant, UseClassicPriceMod)) { + item_price *= RuleR(Merchant, SellCostMod); + } + if (RuleB(Merchant, UsePriceMod)) { item_price *= Client::CalcPriceMod(npc); } @@ -948,9 +953,14 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { auto charges = item->MaxCharges; auto inst = database.CreateItem(item, charges); if (inst) { - auto item_price = static_cast(item->Price * RuleR(Merchant, SellCostMod) * item->SellRate); + auto item_price = static_cast(item->Price * item->SellRate); auto item_charges = charges ? charges : 1; + // Don't use SellCostMod if using UseClassicPriceMod + if (!RuleB(Merchant, UseClassicPriceMod)) { + item_price *= RuleR(Merchant, SellCostMod); + } + if (RuleB(Merchant, UsePriceMod)) { item_price *= Client::CalcPriceMod(npc); } diff --git a/zone/npc.h b/zone/npc.h index ff9fb23cd..8d4d5e300 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -268,6 +268,7 @@ public: inline void MerchantOpenShop() { merchant_open = true; } inline void MerchantCloseShop() { merchant_open = false; } inline bool IsMerchantOpen() { return merchant_open; } + inline uint8 GetGreedPercent() { return NPCTypedata->greed; } inline bool GetParcelMerchant() { return NPCTypedata->is_parcel_merchant; } void Depop(bool start_spawn_timer = false); void Stun(int duration); diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 9c5bc58d8..6729becb6 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1793,6 +1793,7 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load t->max_dmg = n.maxdmg; t->attack_count = n.attack_count; t->is_parcel_merchant = n.is_parcel_merchant ? true : false; + t->greed = n.greed; if (!n.special_abilities.empty()) { strn0cpy(t->special_abilities, n.special_abilities.c_str(), 512); diff --git a/zone/zonedump.h b/zone/zonedump.h index 07d14e105..52dbb5b3e 100644 --- a/zone/zonedump.h +++ b/zone/zonedump.h @@ -155,6 +155,7 @@ struct NPCType int heroic_strikethrough; bool keeps_sold_items; bool is_parcel_merchant; + uint8 greed; }; #pragma pack()