diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d87da2db..7f735023c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,84 @@ +## [23.10.3] 9/16/2025 + +### Hotfix + +* Hotfix crashes occurring in #4987. @Akkadius 2025-09-17 + +## [23.10.2] 9/16/2025 + +### Hotfix + +* Revert #4996 as it was causing critical issues with spells that needs to be further investigated. @Akkadius 2025-09-17 + +## [23.10.1] 9/16/2025 + +### Hotfix +* Fixed Mail Key Bug ([#5015](https://github.com/EQEmu/Server/pull/5015)) @Kinglykrab 2025-09-16 + +## [23.10.0] 9/15/2025 + +### Build + +* Fix Linking with GCC ([#4969](https://github.com/EQEmu/Server/pull/4969)) @solar984 2025-08-03 + +### Code + +* Add #npcedit npc_tint_id Help Message ([#4982](https://github.com/EQEmu/Server/pull/4982)) @Kinglykrab 2025-08-17 +* Cleanup #show ip_lookup Message ([#5005](https://github.com/EQEmu/Server/pull/5005)) @Kinglykrab 2025-08-30 +* Fix #set race 0 Message ([#5004](https://github.com/EQEmu/Server/pull/5004)) @Kinglykrab 2025-08-30 +* Fix Issues with Strings::Commify and Mob::SendStatsWindow ([#4984](https://github.com/EQEmu/Server/pull/4984)) @Kinglykrab 2025-08-17 +* Remove Attributions ([#4988](https://github.com/EQEmu/Server/pull/4988)) @KimLS 2025-08-16 +* Remove Unused errorname Variable ([#5001](https://github.com/EQEmu/Server/pull/5001)) @Kinglykrab 2025-08-29 + +### Commands + +* Add #find account Subcommand ([#4981](https://github.com/EQEmu/Server/pull/4981)) @Kinglykrab 2025-08-17 +* Add #show keyring Subcommand ([#4973](https://github.com/EQEmu/Server/pull/4973)) @Kinglykrab 2025-08-03 +* Add #task complete Saylink to #task show ([#4985](https://github.com/EQEmu/Server/pull/4985)) @Kinglykrab 2025-08-17 + +### Constants + +* Change Race Changes to Race Namespace ([#5000](https://github.com/EQEmu/Server/pull/5000)) @Kinglykrab 2025-08-30 +* Convert SE Defines to SpellEffect Namespace ([#4999](https://github.com/EQEmu/Server/pull/4999)) @Kinglykrab 2025-08-30 + +### Database + +* Add `heal_amount` to `character_stats_record` ([#4986](https://github.com/EQEmu/Server/pull/4986)) @Kinglykrab 2025-08-17 + +### Fixes + +* Fix #show recipe uint16 Cap ([#4978](https://github.com/EQEmu/Server/pull/4978)) @Kinglykrab 2025-08-11 +* Fix Race 474 for Titanium ([#4979](https://github.com/EQEmu/Server/pull/4979)) @regneq 2025-08-11 +* Fix Recipe Inspect Bug ([#4994](https://github.com/EQEmu/Server/pull/4994)) @Kinglykrab 2025-08-30 +* Fix Several Evolving Item Bugs ([#4992](https://github.com/EQEmu/Server/pull/4992)) @neckkola 2025-09-08 +* Fix Task Reloading ([#5002](https://github.com/EQEmu/Server/pull/5002)) @Kinglykrab 2025-08-29 + +### Loginserver + +* Fix Legacy World When Using Local DB ([#4970](https://github.com/EQEmu/Server/pull/4970)) @solar984 2025-08-03 + +### Pets + +* Add Pet Constants and Methods ([#4987](https://github.com/EQEmu/Server/pull/4987)) @Kinglykrab 2025-08-17 + +### Quest API + +* Add EVENT_CHARM_START and EVENT_CHARM_END ([#5013](https://github.com/EQEmu/Server/pull/5013)) @Kinglykrab 2025-09-15 +* Add GetKeyRing() to Perl/Lua ([#4980](https://github.com/EQEmu/Server/pull/4980)) @Kinglykrab 2025-08-17 +* Add GetNPCTintIndex() to Perl/Lua ([#4983](https://github.com/EQEmu/Server/pull/4983)) @Kinglykrab 2025-08-17 +* Add GetTimers() and GetPausedTimers() to Perl/Lua ([#4965](https://github.com/EQEmu/Server/pull/4965)) @Kinglykrab 2025-08-03 +* Add Identifiers to Get/Modify NPC Stat Methods ([#5012](https://github.com/EQEmu/Server/pull/5012)) @Kinglykrab 2025-09-15 + +### Repositories + +* Convert Character Inspect Messages to Repositories ([#4997](https://github.com/EQEmu/Server/pull/4997)) @Kinglykrab 2025-08-30 +* Convert Damage Shield Types to Repositories ([#4995](https://github.com/EQEmu/Server/pull/4995)) @Kinglykrab 2025-08-30 +* Convert Item Loading to Repositories ([#4998](https://github.com/EQEmu/Server/pull/4998)) @Kinglykrab 2025-08-30 +* Convert Mail Key to Repositories ([#5007](https://github.com/EQEmu/Server/pull/5007)) @Kinglykrab 2025-09-15 +* Convert Shared Bank Platinum to Repositories ([#5006](https://github.com/EQEmu/Server/pull/5006)) @Kinglykrab 2025-09-02 +* Convert Spell Loading to Repositories ([#4996](https://github.com/EQEmu/Server/pull/4996)) @Kinglykrab 2025-08-30 +* Convert Total Time Played to Repositories ([#5008](https://github.com/EQEmu/Server/pull/5008)) @Kinglykrab 2025-09-15 + ## [23.9.1] 8/2/2025 ### Hotfix diff --git a/common/database/database_update_manifest.cpp b/common/database/database_update_manifest.cpp index 2236b4ab9..15dc4a27f 100644 --- a/common/database/database_update_manifest.cpp +++ b/common/database/database_update_manifest.cpp @@ -7173,24 +7173,19 @@ ADD COLUMN `heal_amount` int(11) NULL DEFAULT 0 AFTER `spell_damage`; }, ManifestEntry{ .version = 9328, - .description = "2025_08_27_spells_new_column_names.sql", - .check = "SHOW COLUMNS FROM `spells_new` LIKE 'feedbackable'", + .description = "2025_08_22_character_parcel_updates.sql", + .check = "SHOW COLUMNS FROM `character_parcels` LIKE 'evolve_amount'", .condition = "empty", .match = "", .sql = R"( -ALTER TABLE `spells_new` -CHANGE COLUMN `field160` `feedbackable` int(11) NOT NULL DEFAULT 0 AFTER `npc_no_los`, -CHANGE COLUMN `field198` `no_detrimental_spell_aggro` int(11) NOT NULL DEFAULT 0 AFTER `not_extendable`, -CHANGE COLUMN `field209` `no_resist` int(11) NULL DEFAULT 0 AFTER `rank`, -CHANGE COLUMN `field217` `override_crit_chance` int(11) NULL DEFAULT 0 AFTER `field216`, -CHANGE COLUMN `field220` `no_heal_damage_item_mod` int(11) NULL DEFAULT 0 AFTER `maxtargets`, -CHANGE COLUMN `field221` `caster_requirement_id` int(11) NULL DEFAULT 0 AFTER `no_heal_damage_item_mod`, -CHANGE COLUMN `field222` `spell_class` int(11) NULL DEFAULT 0 AFTER `caster_requirement_id`, -CHANGE COLUMN `field223` `spell_subclass` int(11) NULL DEFAULT 0 AFTER `spell_class`, -CHANGE COLUMN `field232` `no_remove` int(11) NOT NULL DEFAULT 0 AFTER `min_range`; -)" - } +ALTER TABLE `character_parcels` + ADD COLUMN `evolve_amount` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `quantity`; +ALTER TABLE `character_parcels_containers` + ADD COLUMN `evolve_amount` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `quantity`; +)", + .content_schema_update = false + }, // -- template; copy/paste this when you need to create a new entry // ManifestEntry{ // .version = 9228, diff --git a/common/evolving_items.cpp b/common/evolving_items.cpp index f7f99b7a6..f14a733f3 100644 --- a/common/evolving_items.cpp +++ b/common/evolving_items.cpp @@ -74,6 +74,10 @@ void EvolvingItemsManager::DoLootChecks(const uint32 char_id, const uint16 slot_ e.item_id = inst.GetID(); e.equipped = inst.GetEvolveEquipped(); e.final_item_id = EvolvingItemsManager::Instance()->GetFinalItemID(inst); + if (inst.GetEvolveCurrentAmount() > 0) { + e.current_amount = inst.GetEvolveCurrentAmount(); + inst.CalculateEvolveProgression(); + } auto r = CharacterEvolvingItemsRepository::InsertOne(*m_db, e); e.id = r.id; diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 0d4043d30..b250a5de6 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -6481,7 +6481,7 @@ namespace RoF2 hdr.scaled_value = (inst->IsScaling() ? (inst->GetExp() / 100) : 0); hdr.instance_id = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : inst->GetSerialNumber()); hdr.parcel_item_id = packet_type == ItemPacketParcel ? inst->GetID() : 0; - if (item->EvolvingItem) { + if (item->EvolvingItem && packet_type != ItemPacketParcel && packet_type != ItemPacketMerchant) { hdr.instance_id = inst->GetEvolveUniqueID() & 0xFFFFFFFF; //lower dword hdr.parcel_item_id = inst->GetEvolveUniqueID() >> 32; //upper dword } @@ -6500,6 +6500,7 @@ namespace RoF2 if (item->EvolvingItem > 0) { RoF2::structs::EvolvingItem_Struct evotop; + inst->CalculateEvolveProgression(); evotop.final_item_id = inst->GetEvolveFinalItemID(); evotop.evolve_level = item->EvolvingLevel; diff --git a/common/repositories/base/base_character_parcels_containers_repository.h b/common/repositories/base/base_character_parcels_containers_repository.h index 9c98cc068..12ca611b7 100644 --- a/common/repositories/base/base_character_parcels_containers_repository.h +++ b/common/repositories/base/base_character_parcels_containers_repository.h @@ -30,6 +30,7 @@ public: uint32_t aug_slot_5; uint32_t aug_slot_6; uint32_t quantity; + uint32_t evolve_amount; }; static std::string PrimaryKey() @@ -51,6 +52,7 @@ public: "aug_slot_5", "aug_slot_6", "quantity", + "evolve_amount", }; } @@ -68,6 +70,7 @@ public: "aug_slot_5", "aug_slot_6", "quantity", + "evolve_amount", }; } @@ -108,17 +111,18 @@ public: { CharacterParcelsContainers e{}; - e.id = 0; - e.parcels_id = 0; - e.slot_id = 0; - e.item_id = 0; - e.aug_slot_1 = 0; - e.aug_slot_2 = 0; - e.aug_slot_3 = 0; - e.aug_slot_4 = 0; - e.aug_slot_5 = 0; - e.aug_slot_6 = 0; - e.quantity = 0; + e.id = 0; + e.parcels_id = 0; + e.slot_id = 0; + e.item_id = 0; + e.aug_slot_1 = 0; + e.aug_slot_2 = 0; + e.aug_slot_3 = 0; + e.aug_slot_4 = 0; + e.aug_slot_5 = 0; + e.aug_slot_6 = 0; + e.quantity = 0; + e.evolve_amount = 0; return e; } @@ -155,17 +159,18 @@ public: if (results.RowCount() == 1) { CharacterParcelsContainers e{}; - e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; - e.parcels_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; - e.slot_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; - e.item_id = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; - e.aug_slot_1 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; - e.aug_slot_2 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; - e.aug_slot_3 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; - e.aug_slot_4 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; - e.aug_slot_5 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; - e.aug_slot_6 = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; - e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; + e.parcels_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; + e.slot_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; + e.item_id = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; + e.aug_slot_1 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; + e.aug_slot_2 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; + e.aug_slot_3 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; + e.aug_slot_4 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; + e.aug_slot_5 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; + e.aug_slot_6 = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; + e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.evolve_amount = row[11] ? static_cast(strtoul(row[11], nullptr, 10)) : 0; return e; } @@ -209,6 +214,7 @@ public: v.push_back(columns[8] + " = " + std::to_string(e.aug_slot_5)); v.push_back(columns[9] + " = " + std::to_string(e.aug_slot_6)); v.push_back(columns[10] + " = " + std::to_string(e.quantity)); + v.push_back(columns[11] + " = " + std::to_string(e.evolve_amount)); auto results = db.QueryDatabase( fmt::format( @@ -241,6 +247,7 @@ public: v.push_back(std::to_string(e.aug_slot_5)); v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.quantity)); + v.push_back(std::to_string(e.evolve_amount)); auto results = db.QueryDatabase( fmt::format( @@ -281,6 +288,7 @@ public: v.push_back(std::to_string(e.aug_slot_5)); v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.quantity)); + v.push_back(std::to_string(e.evolve_amount)); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); } @@ -314,17 +322,18 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterParcelsContainers e{}; - e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; - e.parcels_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; - e.slot_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; - e.item_id = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; - e.aug_slot_1 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; - e.aug_slot_2 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; - e.aug_slot_3 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; - e.aug_slot_4 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; - e.aug_slot_5 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; - e.aug_slot_6 = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; - e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; + e.parcels_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; + e.slot_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; + e.item_id = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; + e.aug_slot_1 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; + e.aug_slot_2 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; + e.aug_slot_3 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; + e.aug_slot_4 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; + e.aug_slot_5 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; + e.aug_slot_6 = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; + e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.evolve_amount = row[11] ? static_cast(strtoul(row[11], nullptr, 10)) : 0; all_entries.push_back(e); } @@ -349,17 +358,18 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterParcelsContainers e{}; - e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; - e.parcels_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; - e.slot_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; - e.item_id = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; - e.aug_slot_1 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; - e.aug_slot_2 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; - e.aug_slot_3 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; - e.aug_slot_4 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; - e.aug_slot_5 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; - e.aug_slot_6 = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; - e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; + e.parcels_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; + e.slot_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; + e.item_id = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; + e.aug_slot_1 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; + e.aug_slot_2 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; + e.aug_slot_3 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; + e.aug_slot_4 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; + e.aug_slot_5 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; + e.aug_slot_6 = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; + e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.evolve_amount = row[11] ? static_cast(strtoul(row[11], nullptr, 10)) : 0; all_entries.push_back(e); } @@ -445,6 +455,7 @@ public: v.push_back(std::to_string(e.aug_slot_5)); v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.quantity)); + v.push_back(std::to_string(e.evolve_amount)); auto results = db.QueryDatabase( fmt::format( @@ -478,6 +489,7 @@ public: v.push_back(std::to_string(e.aug_slot_5)); v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.quantity)); + v.push_back(std::to_string(e.evolve_amount)); insert_chunks.push_back("(" + Strings::Implode(",", v) + ")"); } diff --git a/common/repositories/base/base_character_parcels_repository.h b/common/repositories/base/base_character_parcels_repository.h index 9263f307b..df7242aed 100644 --- a/common/repositories/base/base_character_parcels_repository.h +++ b/common/repositories/base/base_character_parcels_repository.h @@ -30,6 +30,7 @@ public: uint32_t aug_slot_6; uint32_t slot_id; uint32_t quantity; + uint32_t evolve_amount; std::string from_name; std::string note; time_t sent_date; @@ -54,6 +55,7 @@ public: "aug_slot_6", "slot_id", "quantity", + "evolve_amount", "from_name", "note", "sent_date", @@ -74,6 +76,7 @@ public: "aug_slot_6", "slot_id", "quantity", + "evolve_amount", "from_name", "note", "UNIX_TIMESTAMP(sent_date)", @@ -117,20 +120,21 @@ public: { CharacterParcels e{}; - e.id = 0; - e.char_id = 0; - e.item_id = 0; - e.aug_slot_1 = 0; - e.aug_slot_2 = 0; - e.aug_slot_3 = 0; - e.aug_slot_4 = 0; - e.aug_slot_5 = 0; - e.aug_slot_6 = 0; - e.slot_id = 0; - e.quantity = 0; - e.from_name = ""; - e.note = ""; - e.sent_date = 0; + e.id = 0; + e.char_id = 0; + e.item_id = 0; + e.aug_slot_1 = 0; + e.aug_slot_2 = 0; + e.aug_slot_3 = 0; + e.aug_slot_4 = 0; + e.aug_slot_5 = 0; + e.aug_slot_6 = 0; + e.slot_id = 0; + e.quantity = 0; + e.evolve_amount = 0; + e.from_name = ""; + e.note = ""; + e.sent_date = 0; return e; } @@ -167,20 +171,21 @@ public: if (results.RowCount() == 1) { CharacterParcels e{}; - e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; - e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; - e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; - e.aug_slot_1 = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; - e.aug_slot_2 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; - e.aug_slot_3 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; - e.aug_slot_4 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; - e.aug_slot_5 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; - e.aug_slot_6 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; - e.slot_id = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; - e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; - e.from_name = row[11] ? row[11] : ""; - e.note = row[12] ? row[12] : ""; - e.sent_date = strtoll(row[13] ? row[13] : "-1", nullptr, 10); + e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; + e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; + e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; + e.aug_slot_1 = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; + e.aug_slot_2 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; + e.aug_slot_3 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; + e.aug_slot_4 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; + e.aug_slot_5 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; + e.aug_slot_6 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; + e.slot_id = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; + e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.evolve_amount = row[11] ? static_cast(strtoul(row[11], nullptr, 10)) : 0; + e.from_name = row[12] ? row[12] : ""; + e.note = row[13] ? row[13] : ""; + e.sent_date = strtoll(row[14] ? row[14] : "-1", nullptr, 10); return e; } @@ -224,9 +229,10 @@ public: v.push_back(columns[8] + " = " + std::to_string(e.aug_slot_6)); v.push_back(columns[9] + " = " + std::to_string(e.slot_id)); v.push_back(columns[10] + " = " + std::to_string(e.quantity)); - v.push_back(columns[11] + " = '" + Strings::Escape(e.from_name) + "'"); - v.push_back(columns[12] + " = '" + Strings::Escape(e.note) + "'"); - v.push_back(columns[13] + " = FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")"); + v.push_back(columns[11] + " = " + std::to_string(e.evolve_amount)); + v.push_back(columns[12] + " = '" + Strings::Escape(e.from_name) + "'"); + v.push_back(columns[13] + " = '" + Strings::Escape(e.note) + "'"); + v.push_back(columns[14] + " = FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")"); auto results = db.QueryDatabase( fmt::format( @@ -259,6 +265,7 @@ public: v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.slot_id)); v.push_back(std::to_string(e.quantity)); + v.push_back(std::to_string(e.evolve_amount)); v.push_back("'" + Strings::Escape(e.from_name) + "'"); v.push_back("'" + Strings::Escape(e.note) + "'"); v.push_back("FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")"); @@ -302,6 +309,7 @@ public: v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.slot_id)); v.push_back(std::to_string(e.quantity)); + v.push_back(std::to_string(e.evolve_amount)); v.push_back("'" + Strings::Escape(e.from_name) + "'"); v.push_back("'" + Strings::Escape(e.note) + "'"); v.push_back("FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")"); @@ -338,20 +346,21 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterParcels e{}; - e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; - e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; - e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; - e.aug_slot_1 = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; - e.aug_slot_2 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; - e.aug_slot_3 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; - e.aug_slot_4 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; - e.aug_slot_5 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; - e.aug_slot_6 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; - e.slot_id = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; - e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; - e.from_name = row[11] ? row[11] : ""; - e.note = row[12] ? row[12] : ""; - e.sent_date = strtoll(row[13] ? row[13] : "-1", nullptr, 10); + e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; + e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; + e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; + e.aug_slot_1 = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; + e.aug_slot_2 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; + e.aug_slot_3 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; + e.aug_slot_4 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; + e.aug_slot_5 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; + e.aug_slot_6 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; + e.slot_id = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; + e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.evolve_amount = row[11] ? static_cast(strtoul(row[11], nullptr, 10)) : 0; + e.from_name = row[12] ? row[12] : ""; + e.note = row[13] ? row[13] : ""; + e.sent_date = strtoll(row[14] ? row[14] : "-1", nullptr, 10); all_entries.push_back(e); } @@ -376,20 +385,21 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterParcels e{}; - e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; - e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; - e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; - e.aug_slot_1 = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; - e.aug_slot_2 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; - e.aug_slot_3 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; - e.aug_slot_4 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; - e.aug_slot_5 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; - e.aug_slot_6 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; - e.slot_id = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; - e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; - e.from_name = row[11] ? row[11] : ""; - e.note = row[12] ? row[12] : ""; - e.sent_date = strtoll(row[13] ? row[13] : "-1", nullptr, 10); + e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; + e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; + e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; + e.aug_slot_1 = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; + e.aug_slot_2 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; + e.aug_slot_3 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; + e.aug_slot_4 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; + e.aug_slot_5 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; + e.aug_slot_6 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; + e.slot_id = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; + e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.evolve_amount = row[11] ? static_cast(strtoul(row[11], nullptr, 10)) : 0; + e.from_name = row[12] ? row[12] : ""; + e.note = row[13] ? row[13] : ""; + e.sent_date = strtoll(row[14] ? row[14] : "-1", nullptr, 10); all_entries.push_back(e); } @@ -475,6 +485,7 @@ public: v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.slot_id)); v.push_back(std::to_string(e.quantity)); + v.push_back(std::to_string(e.evolve_amount)); v.push_back("'" + Strings::Escape(e.from_name) + "'"); v.push_back("'" + Strings::Escape(e.note) + "'"); v.push_back("FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")"); @@ -511,6 +522,7 @@ public: v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.slot_id)); v.push_back(std::to_string(e.quantity)); + v.push_back(std::to_string(e.evolve_amount)); v.push_back("'" + Strings::Escape(e.from_name) + "'"); v.push_back("'" + Strings::Escape(e.note) + "'"); v.push_back("FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")"); diff --git a/common/repositories/base/base_spells_new_repository.h b/common/repositories/base/base_spells_new_repository.h index 60a19fb57..019e8eaea 100644 --- a/common/repositories/base/base_spells_new_repository.h +++ b/common/repositories/base/base_spells_new_repository.h @@ -179,7 +179,7 @@ public: int32_t effectdescnum; int32_t effectdescnum2; int32_t npc_no_los; - int32_t feedbackable; + int32_t field160; int32_t reflectable; int32_t bonushate; int32_t field163; @@ -217,7 +217,7 @@ public: int32_t ConeStopAngle; int32_t sneaking; int32_t not_extendable; - int32_t no_detrimental_spell_aggro; + int32_t field198; int32_t field199; int32_t suspendable; int32_t viral_range; @@ -228,7 +228,7 @@ public: int32_t field206; int32_t spellgroup; int32_t rank_; - int32_t no_resist; + int32_t field209; int32_t field210; int32_t CastRestriction; int32_t allowrest; @@ -236,13 +236,13 @@ public: int32_t OutofCombat; int32_t field215; int32_t field216; - int32_t override_crit_chance; + int32_t field217; int32_t aemaxtargets; int32_t maxtargets; - int32_t no_heal_damage_item_mod; - int32_t caster_requirement_id; - int32_t spell_class; - int32_t spell_subclass; + int32_t field220; + int32_t field221; + int32_t field222; + int32_t field223; int32_t persistdeath; int32_t field225; int32_t field226; @@ -251,7 +251,7 @@ public: float max_dist; float max_dist_mod; int32_t min_range; - int32_t no_remove; + int32_t field232; int32_t field233; int32_t field234; int32_t field235; @@ -426,7 +426,7 @@ public: "effectdescnum", "effectdescnum2", "npc_no_los", - "feedbackable", + "field160", "reflectable", "bonushate", "field163", @@ -464,7 +464,7 @@ public: "ConeStopAngle", "sneaking", "not_extendable", - "no_detrimental_spell_aggro", + "field198", "field199", "suspendable", "viral_range", @@ -475,7 +475,7 @@ public: "field206", "spellgroup", "`rank`", - "no_resist", + "field209", "field210", "CastRestriction", "allowrest", @@ -483,13 +483,13 @@ public: "OutofCombat", "field215", "field216", - "override_crit_chance", + "field217", "aemaxtargets", "maxtargets", - "no_heal_damage_item_mod", - "caster_requirement_id", - "spell_class", - "spell_subclass", + "field220", + "field221", + "field222", + "field223", "persistdeath", "field225", "field226", @@ -498,7 +498,7 @@ public: "max_dist", "max_dist_mod", "min_range", - "no_remove", + "field232", "field233", "field234", "field235", @@ -669,7 +669,7 @@ public: "effectdescnum", "effectdescnum2", "npc_no_los", - "feedbackable", + "field160", "reflectable", "bonushate", "field163", @@ -707,7 +707,7 @@ public: "ConeStopAngle", "sneaking", "not_extendable", - "no_detrimental_spell_aggro", + "field198", "field199", "suspendable", "viral_range", @@ -718,7 +718,7 @@ public: "field206", "spellgroup", "`rank`", - "no_resist", + "field209", "field210", "CastRestriction", "allowrest", @@ -726,13 +726,13 @@ public: "OutofCombat", "field215", "field216", - "override_crit_chance", + "field217", "aemaxtargets", "maxtargets", - "no_heal_damage_item_mod", - "caster_requirement_id", - "spell_class", - "spell_subclass", + "field220", + "field221", + "field222", + "field223", "persistdeath", "field225", "field226", @@ -741,7 +741,7 @@ public: "max_dist", "max_dist_mod", "min_range", - "no_remove", + "field232", "field233", "field234", "field235", @@ -786,243 +786,243 @@ public: { SpellsNew e{}; - e.id = 0; - e.name = ""; - e.player_1 = "BLUE_TRAIL"; - e.teleport_zone = ""; - e.you_cast = ""; - e.other_casts = ""; - e.cast_on_you = ""; - e.cast_on_other = ""; - e.spell_fades = ""; - e.range_ = 100; - e.aoerange = 0; - e.pushback = 0; - e.pushup = 0; - e.cast_time = 0; - e.recovery_time = 0; - e.recast_time = 0; - e.buffdurationformula = 7; - e.buffduration = 65; - e.AEDuration = 0; - e.mana = 0; - e.effect_base_value1 = 100; - e.effect_base_value2 = 0; - e.effect_base_value3 = 0; - e.effect_base_value4 = 0; - e.effect_base_value5 = 0; - e.effect_base_value6 = 0; - e.effect_base_value7 = 0; - e.effect_base_value8 = 0; - e.effect_base_value9 = 0; - e.effect_base_value10 = 0; - e.effect_base_value11 = 0; - e.effect_base_value12 = 0; - e.effect_limit_value1 = 0; - e.effect_limit_value2 = 0; - e.effect_limit_value3 = 0; - e.effect_limit_value4 = 0; - e.effect_limit_value5 = 0; - e.effect_limit_value6 = 0; - e.effect_limit_value7 = 0; - e.effect_limit_value8 = 0; - e.effect_limit_value9 = 0; - e.effect_limit_value10 = 0; - e.effect_limit_value11 = 0; - e.effect_limit_value12 = 0; - e.max1 = 0; - e.max2 = 0; - e.max3 = 0; - e.max4 = 0; - e.max5 = 0; - e.max6 = 0; - e.max7 = 0; - e.max8 = 0; - e.max9 = 0; - e.max10 = 0; - e.max11 = 0; - e.max12 = 0; - e.icon = 0; - e.memicon = 0; - e.components1 = -1; - e.components2 = -1; - e.components3 = -1; - e.components4 = -1; - e.component_counts1 = 1; - e.component_counts2 = 1; - e.component_counts3 = 1; - e.component_counts4 = 1; - e.NoexpendReagent1 = -1; - e.NoexpendReagent2 = -1; - e.NoexpendReagent3 = -1; - e.NoexpendReagent4 = -1; - e.formula1 = 100; - e.formula2 = 100; - e.formula3 = 100; - e.formula4 = 100; - e.formula5 = 100; - e.formula6 = 100; - e.formula7 = 100; - e.formula8 = 100; - e.formula9 = 100; - e.formula10 = 100; - e.formula11 = 100; - e.formula12 = 100; - e.LightType = 0; - e.goodEffect = 0; - e.Activated = 0; - e.resisttype = 0; - e.effectid1 = 254; - e.effectid2 = 254; - e.effectid3 = 254; - e.effectid4 = 254; - e.effectid5 = 254; - e.effectid6 = 254; - e.effectid7 = 254; - e.effectid8 = 254; - e.effectid9 = 254; - e.effectid10 = 254; - e.effectid11 = 254; - e.effectid12 = 254; - e.targettype = 2; - e.basediff = 0; - e.skill = 98; - e.zonetype = -1; - e.EnvironmentType = 0; - e.TimeOfDay = 0; - e.classes1 = 255; - e.classes2 = 255; - e.classes3 = 255; - e.classes4 = 255; - e.classes5 = 255; - e.classes6 = 255; - e.classes7 = 255; - e.classes8 = 255; - e.classes9 = 255; - e.classes10 = 255; - e.classes11 = 255; - e.classes12 = 255; - e.classes13 = 255; - e.classes14 = 255; - e.classes15 = 255; - e.classes16 = 255; - e.CastingAnim = 44; - e.TargetAnim = 13; - e.TravelType = 0; - e.SpellAffectIndex = -1; - e.disallow_sit = 0; - e.deities0 = 0; - e.deities1 = 0; - e.deities2 = 0; - e.deities3 = 0; - e.deities4 = 0; - e.deities5 = 0; - e.deities6 = 0; - e.deities7 = 0; - e.deities8 = 0; - e.deities9 = 0; - e.deities10 = 0; - e.deities11 = 0; - e.deities12 = 0; - e.deities13 = 0; - e.deities14 = 0; - e.deities15 = 0; - e.deities16 = 0; - e.field142 = 100; - e.field143 = 0; - e.new_icon = 161; - e.spellanim = 0; - e.uninterruptable = 0; - e.ResistDiff = -150; - e.dot_stacking_exempt = 0; - e.deleteable = 0; - e.RecourseLink = 0; - e.no_partial_resist = 0; - e.field152 = 0; - e.field153 = 0; - e.short_buff_box = -1; - e.descnum = 0; - e.typedescnum = 0; - e.effectdescnum = 0; - e.effectdescnum2 = 0; - e.npc_no_los = 0; - e.feedbackable = 0; - e.reflectable = 0; - e.bonushate = 0; - e.field163 = 100; - e.field164 = -150; - e.ldon_trap = 0; - e.EndurCost = 0; - e.EndurTimerIndex = 0; - e.IsDiscipline = 0; - e.field169 = 0; - e.field170 = 0; - e.field171 = 0; - e.field172 = 0; - e.HateAdded = 0; - e.EndurUpkeep = 0; - e.numhitstype = 0; - e.numhits = 0; - e.pvpresistbase = -150; - e.pvpresistcalc = 100; - e.pvpresistcap = -150; - e.spell_category = -99; - e.pvp_duration = 0; - e.pvp_duration_cap = 0; - e.pcnpc_only_flag = 0; - e.cast_not_standing = 0; - e.can_mgb = 0; - e.nodispell = -1; - e.npc_category = 0; - e.npc_usefulness = 0; - e.MinResist = 0; - e.MaxResist = 0; - e.viral_targets = 0; - e.viral_timer = 0; - e.nimbuseffect = 0; - e.ConeStartAngle = 0; - e.ConeStopAngle = 0; - e.sneaking = 0; - e.not_extendable = 0; - e.no_detrimental_spell_aggro = 0; - e.field199 = 1; - e.suspendable = 0; - e.viral_range = 0; - e.songcap = 0; - e.field203 = 0; - e.field204 = 0; - e.no_block = 0; - e.field206 = -1; - e.spellgroup = 0; - e.rank_ = 0; - e.no_resist = 0; - e.field210 = 1; - e.CastRestriction = 0; - e.allowrest = 0; - e.InCombat = 0; - e.OutofCombat = 0; - e.field215 = 0; - e.field216 = 0; - e.override_crit_chance = 0; - e.aemaxtargets = 0; - e.maxtargets = 0; - e.no_heal_damage_item_mod = 0; - e.caster_requirement_id = 0; - e.spell_class = 0; - e.spell_subclass = 0; - e.persistdeath = 0; - e.field225 = 0; - e.field226 = 0; - e.min_dist = 0; - e.min_dist_mod = 0; - e.max_dist = 0; - e.max_dist_mod = 0; - e.min_range = 0; - e.no_remove = 0; - e.field233 = 0; - e.field234 = 0; - e.field235 = 0; - e.field236 = 0; + e.id = 0; + e.name = ""; + e.player_1 = "BLUE_TRAIL"; + e.teleport_zone = ""; + e.you_cast = ""; + e.other_casts = ""; + e.cast_on_you = ""; + e.cast_on_other = ""; + e.spell_fades = ""; + e.range_ = 100; + e.aoerange = 0; + e.pushback = 0; + e.pushup = 0; + e.cast_time = 0; + e.recovery_time = 0; + e.recast_time = 0; + e.buffdurationformula = 7; + e.buffduration = 65; + e.AEDuration = 0; + e.mana = 0; + e.effect_base_value1 = 100; + e.effect_base_value2 = 0; + e.effect_base_value3 = 0; + e.effect_base_value4 = 0; + e.effect_base_value5 = 0; + e.effect_base_value6 = 0; + e.effect_base_value7 = 0; + e.effect_base_value8 = 0; + e.effect_base_value9 = 0; + e.effect_base_value10 = 0; + e.effect_base_value11 = 0; + e.effect_base_value12 = 0; + e.effect_limit_value1 = 0; + e.effect_limit_value2 = 0; + e.effect_limit_value3 = 0; + e.effect_limit_value4 = 0; + e.effect_limit_value5 = 0; + e.effect_limit_value6 = 0; + e.effect_limit_value7 = 0; + e.effect_limit_value8 = 0; + e.effect_limit_value9 = 0; + e.effect_limit_value10 = 0; + e.effect_limit_value11 = 0; + e.effect_limit_value12 = 0; + e.max1 = 0; + e.max2 = 0; + e.max3 = 0; + e.max4 = 0; + e.max5 = 0; + e.max6 = 0; + e.max7 = 0; + e.max8 = 0; + e.max9 = 0; + e.max10 = 0; + e.max11 = 0; + e.max12 = 0; + e.icon = 0; + e.memicon = 0; + e.components1 = -1; + e.components2 = -1; + e.components3 = -1; + e.components4 = -1; + e.component_counts1 = 1; + e.component_counts2 = 1; + e.component_counts3 = 1; + e.component_counts4 = 1; + e.NoexpendReagent1 = -1; + e.NoexpendReagent2 = -1; + e.NoexpendReagent3 = -1; + e.NoexpendReagent4 = -1; + e.formula1 = 100; + e.formula2 = 100; + e.formula3 = 100; + e.formula4 = 100; + e.formula5 = 100; + e.formula6 = 100; + e.formula7 = 100; + e.formula8 = 100; + e.formula9 = 100; + e.formula10 = 100; + e.formula11 = 100; + e.formula12 = 100; + e.LightType = 0; + e.goodEffect = 0; + e.Activated = 0; + e.resisttype = 0; + e.effectid1 = 254; + e.effectid2 = 254; + e.effectid3 = 254; + e.effectid4 = 254; + e.effectid5 = 254; + e.effectid6 = 254; + e.effectid7 = 254; + e.effectid8 = 254; + e.effectid9 = 254; + e.effectid10 = 254; + e.effectid11 = 254; + e.effectid12 = 254; + e.targettype = 2; + e.basediff = 0; + e.skill = 98; + e.zonetype = -1; + e.EnvironmentType = 0; + e.TimeOfDay = 0; + e.classes1 = 255; + e.classes2 = 255; + e.classes3 = 255; + e.classes4 = 255; + e.classes5 = 255; + e.classes6 = 255; + e.classes7 = 255; + e.classes8 = 255; + e.classes9 = 255; + e.classes10 = 255; + e.classes11 = 255; + e.classes12 = 255; + e.classes13 = 255; + e.classes14 = 255; + e.classes15 = 255; + e.classes16 = 255; + e.CastingAnim = 44; + e.TargetAnim = 13; + e.TravelType = 0; + e.SpellAffectIndex = -1; + e.disallow_sit = 0; + e.deities0 = 0; + e.deities1 = 0; + e.deities2 = 0; + e.deities3 = 0; + e.deities4 = 0; + e.deities5 = 0; + e.deities6 = 0; + e.deities7 = 0; + e.deities8 = 0; + e.deities9 = 0; + e.deities10 = 0; + e.deities11 = 0; + e.deities12 = 0; + e.deities13 = 0; + e.deities14 = 0; + e.deities15 = 0; + e.deities16 = 0; + e.field142 = 100; + e.field143 = 0; + e.new_icon = 161; + e.spellanim = 0; + e.uninterruptable = 0; + e.ResistDiff = -150; + e.dot_stacking_exempt = 0; + e.deleteable = 0; + e.RecourseLink = 0; + e.no_partial_resist = 0; + e.field152 = 0; + e.field153 = 0; + e.short_buff_box = -1; + e.descnum = 0; + e.typedescnum = 0; + e.effectdescnum = 0; + e.effectdescnum2 = 0; + e.npc_no_los = 0; + e.field160 = 0; + e.reflectable = 0; + e.bonushate = 0; + e.field163 = 100; + e.field164 = -150; + e.ldon_trap = 0; + e.EndurCost = 0; + e.EndurTimerIndex = 0; + e.IsDiscipline = 0; + e.field169 = 0; + e.field170 = 0; + e.field171 = 0; + e.field172 = 0; + e.HateAdded = 0; + e.EndurUpkeep = 0; + e.numhitstype = 0; + e.numhits = 0; + e.pvpresistbase = -150; + e.pvpresistcalc = 100; + e.pvpresistcap = -150; + e.spell_category = -99; + e.pvp_duration = 0; + e.pvp_duration_cap = 0; + e.pcnpc_only_flag = 0; + e.cast_not_standing = 0; + e.can_mgb = 0; + e.nodispell = -1; + e.npc_category = 0; + e.npc_usefulness = 0; + e.MinResist = 0; + e.MaxResist = 0; + e.viral_targets = 0; + e.viral_timer = 0; + e.nimbuseffect = 0; + e.ConeStartAngle = 0; + e.ConeStopAngle = 0; + e.sneaking = 0; + e.not_extendable = 0; + e.field198 = 0; + e.field199 = 1; + e.suspendable = 0; + e.viral_range = 0; + e.songcap = 0; + e.field203 = 0; + e.field204 = 0; + e.no_block = 0; + e.field206 = -1; + e.spellgroup = 0; + e.rank_ = 0; + e.field209 = 0; + e.field210 = 1; + e.CastRestriction = 0; + e.allowrest = 0; + e.InCombat = 0; + e.OutofCombat = 0; + e.field215 = 0; + e.field216 = 0; + e.field217 = 0; + e.aemaxtargets = 0; + e.maxtargets = 0; + e.field220 = 0; + e.field221 = 0; + e.field222 = 0; + e.field223 = 0; + e.persistdeath = 0; + e.field225 = 0; + e.field226 = 0; + e.min_dist = 0; + e.min_dist_mod = 0; + e.max_dist = 0; + e.max_dist_mod = 0; + e.min_range = 0; + e.field232 = 0; + e.field233 = 0; + e.field234 = 0; + e.field235 = 0; + e.field236 = 0; return e; } @@ -1059,243 +1059,243 @@ public: if (results.RowCount() == 1) { SpellsNew e{}; - e.id = row[0] ? static_cast(atoi(row[0])) : 0; - e.name = row[1] ? row[1] : ""; - e.player_1 = row[2] ? row[2] : "BLUE_TRAIL"; - e.teleport_zone = row[3] ? row[3] : ""; - e.you_cast = row[4] ? row[4] : ""; - e.other_casts = row[5] ? row[5] : ""; - e.cast_on_you = row[6] ? row[6] : ""; - e.cast_on_other = row[7] ? row[7] : ""; - e.spell_fades = row[8] ? row[8] : ""; - e.range_ = row[9] ? static_cast(atoi(row[9])) : 100; - e.aoerange = row[10] ? static_cast(atoi(row[10])) : 0; - e.pushback = row[11] ? static_cast(atoi(row[11])) : 0; - e.pushup = row[12] ? static_cast(atoi(row[12])) : 0; - e.cast_time = row[13] ? static_cast(atoi(row[13])) : 0; - e.recovery_time = row[14] ? static_cast(atoi(row[14])) : 0; - e.recast_time = row[15] ? static_cast(atoi(row[15])) : 0; - e.buffdurationformula = row[16] ? static_cast(atoi(row[16])) : 7; - e.buffduration = row[17] ? static_cast(atoi(row[17])) : 65; - e.AEDuration = row[18] ? static_cast(atoi(row[18])) : 0; - e.mana = row[19] ? static_cast(atoi(row[19])) : 0; - e.effect_base_value1 = row[20] ? static_cast(atoi(row[20])) : 100; - e.effect_base_value2 = row[21] ? static_cast(atoi(row[21])) : 0; - e.effect_base_value3 = row[22] ? static_cast(atoi(row[22])) : 0; - e.effect_base_value4 = row[23] ? static_cast(atoi(row[23])) : 0; - e.effect_base_value5 = row[24] ? static_cast(atoi(row[24])) : 0; - e.effect_base_value6 = row[25] ? static_cast(atoi(row[25])) : 0; - e.effect_base_value7 = row[26] ? static_cast(atoi(row[26])) : 0; - e.effect_base_value8 = row[27] ? static_cast(atoi(row[27])) : 0; - e.effect_base_value9 = row[28] ? static_cast(atoi(row[28])) : 0; - e.effect_base_value10 = row[29] ? static_cast(atoi(row[29])) : 0; - e.effect_base_value11 = row[30] ? static_cast(atoi(row[30])) : 0; - e.effect_base_value12 = row[31] ? static_cast(atoi(row[31])) : 0; - e.effect_limit_value1 = row[32] ? static_cast(atoi(row[32])) : 0; - e.effect_limit_value2 = row[33] ? static_cast(atoi(row[33])) : 0; - e.effect_limit_value3 = row[34] ? static_cast(atoi(row[34])) : 0; - e.effect_limit_value4 = row[35] ? static_cast(atoi(row[35])) : 0; - e.effect_limit_value5 = row[36] ? static_cast(atoi(row[36])) : 0; - e.effect_limit_value6 = row[37] ? static_cast(atoi(row[37])) : 0; - e.effect_limit_value7 = row[38] ? static_cast(atoi(row[38])) : 0; - e.effect_limit_value8 = row[39] ? static_cast(atoi(row[39])) : 0; - e.effect_limit_value9 = row[40] ? static_cast(atoi(row[40])) : 0; - e.effect_limit_value10 = row[41] ? static_cast(atoi(row[41])) : 0; - e.effect_limit_value11 = row[42] ? static_cast(atoi(row[42])) : 0; - e.effect_limit_value12 = row[43] ? static_cast(atoi(row[43])) : 0; - e.max1 = row[44] ? static_cast(atoi(row[44])) : 0; - e.max2 = row[45] ? static_cast(atoi(row[45])) : 0; - e.max3 = row[46] ? static_cast(atoi(row[46])) : 0; - e.max4 = row[47] ? static_cast(atoi(row[47])) : 0; - e.max5 = row[48] ? static_cast(atoi(row[48])) : 0; - e.max6 = row[49] ? static_cast(atoi(row[49])) : 0; - e.max7 = row[50] ? static_cast(atoi(row[50])) : 0; - e.max8 = row[51] ? static_cast(atoi(row[51])) : 0; - e.max9 = row[52] ? static_cast(atoi(row[52])) : 0; - e.max10 = row[53] ? static_cast(atoi(row[53])) : 0; - e.max11 = row[54] ? static_cast(atoi(row[54])) : 0; - e.max12 = row[55] ? static_cast(atoi(row[55])) : 0; - e.icon = row[56] ? static_cast(atoi(row[56])) : 0; - e.memicon = row[57] ? static_cast(atoi(row[57])) : 0; - e.components1 = row[58] ? static_cast(atoi(row[58])) : -1; - e.components2 = row[59] ? static_cast(atoi(row[59])) : -1; - e.components3 = row[60] ? static_cast(atoi(row[60])) : -1; - e.components4 = row[61] ? static_cast(atoi(row[61])) : -1; - e.component_counts1 = row[62] ? static_cast(atoi(row[62])) : 1; - e.component_counts2 = row[63] ? static_cast(atoi(row[63])) : 1; - e.component_counts3 = row[64] ? static_cast(atoi(row[64])) : 1; - e.component_counts4 = row[65] ? static_cast(atoi(row[65])) : 1; - e.NoexpendReagent1 = row[66] ? static_cast(atoi(row[66])) : -1; - e.NoexpendReagent2 = row[67] ? static_cast(atoi(row[67])) : -1; - e.NoexpendReagent3 = row[68] ? static_cast(atoi(row[68])) : -1; - e.NoexpendReagent4 = row[69] ? static_cast(atoi(row[69])) : -1; - e.formula1 = row[70] ? static_cast(atoi(row[70])) : 100; - e.formula2 = row[71] ? static_cast(atoi(row[71])) : 100; - e.formula3 = row[72] ? static_cast(atoi(row[72])) : 100; - e.formula4 = row[73] ? static_cast(atoi(row[73])) : 100; - e.formula5 = row[74] ? static_cast(atoi(row[74])) : 100; - e.formula6 = row[75] ? static_cast(atoi(row[75])) : 100; - e.formula7 = row[76] ? static_cast(atoi(row[76])) : 100; - e.formula8 = row[77] ? static_cast(atoi(row[77])) : 100; - e.formula9 = row[78] ? static_cast(atoi(row[78])) : 100; - e.formula10 = row[79] ? static_cast(atoi(row[79])) : 100; - e.formula11 = row[80] ? static_cast(atoi(row[80])) : 100; - e.formula12 = row[81] ? static_cast(atoi(row[81])) : 100; - e.LightType = row[82] ? static_cast(atoi(row[82])) : 0; - e.goodEffect = row[83] ? static_cast(atoi(row[83])) : 0; - e.Activated = row[84] ? static_cast(atoi(row[84])) : 0; - e.resisttype = row[85] ? static_cast(atoi(row[85])) : 0; - e.effectid1 = row[86] ? static_cast(atoi(row[86])) : 254; - e.effectid2 = row[87] ? static_cast(atoi(row[87])) : 254; - e.effectid3 = row[88] ? static_cast(atoi(row[88])) : 254; - e.effectid4 = row[89] ? static_cast(atoi(row[89])) : 254; - e.effectid5 = row[90] ? static_cast(atoi(row[90])) : 254; - e.effectid6 = row[91] ? static_cast(atoi(row[91])) : 254; - e.effectid7 = row[92] ? static_cast(atoi(row[92])) : 254; - e.effectid8 = row[93] ? static_cast(atoi(row[93])) : 254; - e.effectid9 = row[94] ? static_cast(atoi(row[94])) : 254; - e.effectid10 = row[95] ? static_cast(atoi(row[95])) : 254; - e.effectid11 = row[96] ? static_cast(atoi(row[96])) : 254; - e.effectid12 = row[97] ? static_cast(atoi(row[97])) : 254; - e.targettype = row[98] ? static_cast(atoi(row[98])) : 2; - e.basediff = row[99] ? static_cast(atoi(row[99])) : 0; - e.skill = row[100] ? static_cast(atoi(row[100])) : 98; - e.zonetype = row[101] ? static_cast(atoi(row[101])) : -1; - e.EnvironmentType = row[102] ? static_cast(atoi(row[102])) : 0; - e.TimeOfDay = row[103] ? static_cast(atoi(row[103])) : 0; - e.classes1 = row[104] ? static_cast(atoi(row[104])) : 255; - e.classes2 = row[105] ? static_cast(atoi(row[105])) : 255; - e.classes3 = row[106] ? static_cast(atoi(row[106])) : 255; - e.classes4 = row[107] ? static_cast(atoi(row[107])) : 255; - e.classes5 = row[108] ? static_cast(atoi(row[108])) : 255; - e.classes6 = row[109] ? static_cast(atoi(row[109])) : 255; - e.classes7 = row[110] ? static_cast(atoi(row[110])) : 255; - e.classes8 = row[111] ? static_cast(atoi(row[111])) : 255; - e.classes9 = row[112] ? static_cast(atoi(row[112])) : 255; - e.classes10 = row[113] ? static_cast(atoi(row[113])) : 255; - e.classes11 = row[114] ? static_cast(atoi(row[114])) : 255; - e.classes12 = row[115] ? static_cast(atoi(row[115])) : 255; - e.classes13 = row[116] ? static_cast(atoi(row[116])) : 255; - e.classes14 = row[117] ? static_cast(atoi(row[117])) : 255; - e.classes15 = row[118] ? static_cast(atoi(row[118])) : 255; - e.classes16 = row[119] ? static_cast(atoi(row[119])) : 255; - e.CastingAnim = row[120] ? static_cast(atoi(row[120])) : 44; - e.TargetAnim = row[121] ? static_cast(atoi(row[121])) : 13; - e.TravelType = row[122] ? static_cast(atoi(row[122])) : 0; - e.SpellAffectIndex = row[123] ? static_cast(atoi(row[123])) : -1; - e.disallow_sit = row[124] ? static_cast(atoi(row[124])) : 0; - e.deities0 = row[125] ? static_cast(atoi(row[125])) : 0; - e.deities1 = row[126] ? static_cast(atoi(row[126])) : 0; - e.deities2 = row[127] ? static_cast(atoi(row[127])) : 0; - e.deities3 = row[128] ? static_cast(atoi(row[128])) : 0; - e.deities4 = row[129] ? static_cast(atoi(row[129])) : 0; - e.deities5 = row[130] ? static_cast(atoi(row[130])) : 0; - e.deities6 = row[131] ? static_cast(atoi(row[131])) : 0; - e.deities7 = row[132] ? static_cast(atoi(row[132])) : 0; - e.deities8 = row[133] ? static_cast(atoi(row[133])) : 0; - e.deities9 = row[134] ? static_cast(atoi(row[134])) : 0; - e.deities10 = row[135] ? static_cast(atoi(row[135])) : 0; - e.deities11 = row[136] ? static_cast(atoi(row[136])) : 0; - e.deities12 = row[137] ? static_cast(atoi(row[137])) : 0; - e.deities13 = row[138] ? static_cast(atoi(row[138])) : 0; - e.deities14 = row[139] ? static_cast(atoi(row[139])) : 0; - e.deities15 = row[140] ? static_cast(atoi(row[140])) : 0; - e.deities16 = row[141] ? static_cast(atoi(row[141])) : 0; - e.field142 = row[142] ? static_cast(atoi(row[142])) : 100; - e.field143 = row[143] ? static_cast(atoi(row[143])) : 0; - e.new_icon = row[144] ? static_cast(atoi(row[144])) : 161; - e.spellanim = row[145] ? static_cast(atoi(row[145])) : 0; - e.uninterruptable = row[146] ? static_cast(atoi(row[146])) : 0; - e.ResistDiff = row[147] ? static_cast(atoi(row[147])) : -150; - e.dot_stacking_exempt = row[148] ? static_cast(atoi(row[148])) : 0; - e.deleteable = row[149] ? static_cast(atoi(row[149])) : 0; - e.RecourseLink = row[150] ? static_cast(atoi(row[150])) : 0; - e.no_partial_resist = row[151] ? static_cast(atoi(row[151])) : 0; - e.field152 = row[152] ? static_cast(atoi(row[152])) : 0; - e.field153 = row[153] ? static_cast(atoi(row[153])) : 0; - e.short_buff_box = row[154] ? static_cast(atoi(row[154])) : -1; - e.descnum = row[155] ? static_cast(atoi(row[155])) : 0; - e.typedescnum = row[156] ? static_cast(atoi(row[156])) : 0; - e.effectdescnum = row[157] ? static_cast(atoi(row[157])) : 0; - e.effectdescnum2 = row[158] ? static_cast(atoi(row[158])) : 0; - e.npc_no_los = row[159] ? static_cast(atoi(row[159])) : 0; - e.feedbackable = row[160] ? static_cast(atoi(row[160])) : 0; - e.reflectable = row[161] ? static_cast(atoi(row[161])) : 0; - e.bonushate = row[162] ? static_cast(atoi(row[162])) : 0; - e.field163 = row[163] ? static_cast(atoi(row[163])) : 100; - e.field164 = row[164] ? static_cast(atoi(row[164])) : -150; - e.ldon_trap = row[165] ? static_cast(atoi(row[165])) : 0; - e.EndurCost = row[166] ? static_cast(atoi(row[166])) : 0; - e.EndurTimerIndex = row[167] ? static_cast(atoi(row[167])) : 0; - e.IsDiscipline = row[168] ? static_cast(atoi(row[168])) : 0; - e.field169 = row[169] ? static_cast(atoi(row[169])) : 0; - e.field170 = row[170] ? static_cast(atoi(row[170])) : 0; - e.field171 = row[171] ? static_cast(atoi(row[171])) : 0; - e.field172 = row[172] ? static_cast(atoi(row[172])) : 0; - e.HateAdded = row[173] ? static_cast(atoi(row[173])) : 0; - e.EndurUpkeep = row[174] ? static_cast(atoi(row[174])) : 0; - e.numhitstype = row[175] ? static_cast(atoi(row[175])) : 0; - e.numhits = row[176] ? static_cast(atoi(row[176])) : 0; - e.pvpresistbase = row[177] ? static_cast(atoi(row[177])) : -150; - e.pvpresistcalc = row[178] ? static_cast(atoi(row[178])) : 100; - e.pvpresistcap = row[179] ? static_cast(atoi(row[179])) : -150; - e.spell_category = row[180] ? static_cast(atoi(row[180])) : -99; - e.pvp_duration = row[181] ? static_cast(atoi(row[181])) : 0; - e.pvp_duration_cap = row[182] ? static_cast(atoi(row[182])) : 0; - e.pcnpc_only_flag = row[183] ? static_cast(atoi(row[183])) : 0; - e.cast_not_standing = row[184] ? static_cast(atoi(row[184])) : 0; - e.can_mgb = row[185] ? static_cast(atoi(row[185])) : 0; - e.nodispell = row[186] ? static_cast(atoi(row[186])) : -1; - e.npc_category = row[187] ? static_cast(atoi(row[187])) : 0; - e.npc_usefulness = row[188] ? static_cast(atoi(row[188])) : 0; - e.MinResist = row[189] ? static_cast(atoi(row[189])) : 0; - e.MaxResist = row[190] ? static_cast(atoi(row[190])) : 0; - e.viral_targets = row[191] ? static_cast(atoi(row[191])) : 0; - e.viral_timer = row[192] ? static_cast(atoi(row[192])) : 0; - e.nimbuseffect = row[193] ? static_cast(atoi(row[193])) : 0; - e.ConeStartAngle = row[194] ? static_cast(atoi(row[194])) : 0; - e.ConeStopAngle = row[195] ? static_cast(atoi(row[195])) : 0; - e.sneaking = row[196] ? static_cast(atoi(row[196])) : 0; - e.not_extendable = row[197] ? static_cast(atoi(row[197])) : 0; - e.no_detrimental_spell_aggro = row[198] ? static_cast(atoi(row[198])) : 0; - e.field199 = row[199] ? static_cast(atoi(row[199])) : 1; - e.suspendable = row[200] ? static_cast(atoi(row[200])) : 0; - e.viral_range = row[201] ? static_cast(atoi(row[201])) : 0; - e.songcap = row[202] ? static_cast(atoi(row[202])) : 0; - e.field203 = row[203] ? static_cast(atoi(row[203])) : 0; - e.field204 = row[204] ? static_cast(atoi(row[204])) : 0; - e.no_block = row[205] ? static_cast(atoi(row[205])) : 0; - e.field206 = row[206] ? static_cast(atoi(row[206])) : -1; - e.spellgroup = row[207] ? static_cast(atoi(row[207])) : 0; - e.rank_ = row[208] ? static_cast(atoi(row[208])) : 0; - e.no_resist = row[209] ? static_cast(atoi(row[209])) : 0; - e.field210 = row[210] ? static_cast(atoi(row[210])) : 1; - e.CastRestriction = row[211] ? static_cast(atoi(row[211])) : 0; - e.allowrest = row[212] ? static_cast(atoi(row[212])) : 0; - e.InCombat = row[213] ? static_cast(atoi(row[213])) : 0; - e.OutofCombat = row[214] ? static_cast(atoi(row[214])) : 0; - e.field215 = row[215] ? static_cast(atoi(row[215])) : 0; - e.field216 = row[216] ? static_cast(atoi(row[216])) : 0; - e.override_crit_chance = row[217] ? static_cast(atoi(row[217])) : 0; - e.aemaxtargets = row[218] ? static_cast(atoi(row[218])) : 0; - e.maxtargets = row[219] ? static_cast(atoi(row[219])) : 0; - e.no_heal_damage_item_mod = row[220] ? static_cast(atoi(row[220])) : 0; - e.caster_requirement_id = row[221] ? static_cast(atoi(row[221])) : 0; - e.spell_class = row[222] ? static_cast(atoi(row[222])) : 0; - e.spell_subclass = row[223] ? static_cast(atoi(row[223])) : 0; - e.persistdeath = row[224] ? static_cast(atoi(row[224])) : 0; - e.field225 = row[225] ? static_cast(atoi(row[225])) : 0; - e.field226 = row[226] ? static_cast(atoi(row[226])) : 0; - e.min_dist = row[227] ? strtof(row[227], nullptr) : 0; - e.min_dist_mod = row[228] ? strtof(row[228], nullptr) : 0; - e.max_dist = row[229] ? strtof(row[229], nullptr) : 0; - e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0; - e.min_range = row[231] ? static_cast(atoi(row[231])) : 0; - e.no_remove = row[232] ? static_cast(atoi(row[232])) : 0; - e.field233 = row[233] ? static_cast(atoi(row[233])) : 0; - e.field234 = row[234] ? static_cast(atoi(row[234])) : 0; - e.field235 = row[235] ? static_cast(atoi(row[235])) : 0; - e.field236 = row[236] ? static_cast(atoi(row[236])) : 0; + e.id = row[0] ? static_cast(atoi(row[0])) : 0; + e.name = row[1] ? row[1] : ""; + e.player_1 = row[2] ? row[2] : "BLUE_TRAIL"; + e.teleport_zone = row[3] ? row[3] : ""; + e.you_cast = row[4] ? row[4] : ""; + e.other_casts = row[5] ? row[5] : ""; + e.cast_on_you = row[6] ? row[6] : ""; + e.cast_on_other = row[7] ? row[7] : ""; + e.spell_fades = row[8] ? row[8] : ""; + e.range_ = row[9] ? static_cast(atoi(row[9])) : 100; + e.aoerange = row[10] ? static_cast(atoi(row[10])) : 0; + e.pushback = row[11] ? static_cast(atoi(row[11])) : 0; + e.pushup = row[12] ? static_cast(atoi(row[12])) : 0; + e.cast_time = row[13] ? static_cast(atoi(row[13])) : 0; + e.recovery_time = row[14] ? static_cast(atoi(row[14])) : 0; + e.recast_time = row[15] ? static_cast(atoi(row[15])) : 0; + e.buffdurationformula = row[16] ? static_cast(atoi(row[16])) : 7; + e.buffduration = row[17] ? static_cast(atoi(row[17])) : 65; + e.AEDuration = row[18] ? static_cast(atoi(row[18])) : 0; + e.mana = row[19] ? static_cast(atoi(row[19])) : 0; + e.effect_base_value1 = row[20] ? static_cast(atoi(row[20])) : 100; + e.effect_base_value2 = row[21] ? static_cast(atoi(row[21])) : 0; + e.effect_base_value3 = row[22] ? static_cast(atoi(row[22])) : 0; + e.effect_base_value4 = row[23] ? static_cast(atoi(row[23])) : 0; + e.effect_base_value5 = row[24] ? static_cast(atoi(row[24])) : 0; + e.effect_base_value6 = row[25] ? static_cast(atoi(row[25])) : 0; + e.effect_base_value7 = row[26] ? static_cast(atoi(row[26])) : 0; + e.effect_base_value8 = row[27] ? static_cast(atoi(row[27])) : 0; + e.effect_base_value9 = row[28] ? static_cast(atoi(row[28])) : 0; + e.effect_base_value10 = row[29] ? static_cast(atoi(row[29])) : 0; + e.effect_base_value11 = row[30] ? static_cast(atoi(row[30])) : 0; + e.effect_base_value12 = row[31] ? static_cast(atoi(row[31])) : 0; + e.effect_limit_value1 = row[32] ? static_cast(atoi(row[32])) : 0; + e.effect_limit_value2 = row[33] ? static_cast(atoi(row[33])) : 0; + e.effect_limit_value3 = row[34] ? static_cast(atoi(row[34])) : 0; + e.effect_limit_value4 = row[35] ? static_cast(atoi(row[35])) : 0; + e.effect_limit_value5 = row[36] ? static_cast(atoi(row[36])) : 0; + e.effect_limit_value6 = row[37] ? static_cast(atoi(row[37])) : 0; + e.effect_limit_value7 = row[38] ? static_cast(atoi(row[38])) : 0; + e.effect_limit_value8 = row[39] ? static_cast(atoi(row[39])) : 0; + e.effect_limit_value9 = row[40] ? static_cast(atoi(row[40])) : 0; + e.effect_limit_value10 = row[41] ? static_cast(atoi(row[41])) : 0; + e.effect_limit_value11 = row[42] ? static_cast(atoi(row[42])) : 0; + e.effect_limit_value12 = row[43] ? static_cast(atoi(row[43])) : 0; + e.max1 = row[44] ? static_cast(atoi(row[44])) : 0; + e.max2 = row[45] ? static_cast(atoi(row[45])) : 0; + e.max3 = row[46] ? static_cast(atoi(row[46])) : 0; + e.max4 = row[47] ? static_cast(atoi(row[47])) : 0; + e.max5 = row[48] ? static_cast(atoi(row[48])) : 0; + e.max6 = row[49] ? static_cast(atoi(row[49])) : 0; + e.max7 = row[50] ? static_cast(atoi(row[50])) : 0; + e.max8 = row[51] ? static_cast(atoi(row[51])) : 0; + e.max9 = row[52] ? static_cast(atoi(row[52])) : 0; + e.max10 = row[53] ? static_cast(atoi(row[53])) : 0; + e.max11 = row[54] ? static_cast(atoi(row[54])) : 0; + e.max12 = row[55] ? static_cast(atoi(row[55])) : 0; + e.icon = row[56] ? static_cast(atoi(row[56])) : 0; + e.memicon = row[57] ? static_cast(atoi(row[57])) : 0; + e.components1 = row[58] ? static_cast(atoi(row[58])) : -1; + e.components2 = row[59] ? static_cast(atoi(row[59])) : -1; + e.components3 = row[60] ? static_cast(atoi(row[60])) : -1; + e.components4 = row[61] ? static_cast(atoi(row[61])) : -1; + e.component_counts1 = row[62] ? static_cast(atoi(row[62])) : 1; + e.component_counts2 = row[63] ? static_cast(atoi(row[63])) : 1; + e.component_counts3 = row[64] ? static_cast(atoi(row[64])) : 1; + e.component_counts4 = row[65] ? static_cast(atoi(row[65])) : 1; + e.NoexpendReagent1 = row[66] ? static_cast(atoi(row[66])) : -1; + e.NoexpendReagent2 = row[67] ? static_cast(atoi(row[67])) : -1; + e.NoexpendReagent3 = row[68] ? static_cast(atoi(row[68])) : -1; + e.NoexpendReagent4 = row[69] ? static_cast(atoi(row[69])) : -1; + e.formula1 = row[70] ? static_cast(atoi(row[70])) : 100; + e.formula2 = row[71] ? static_cast(atoi(row[71])) : 100; + e.formula3 = row[72] ? static_cast(atoi(row[72])) : 100; + e.formula4 = row[73] ? static_cast(atoi(row[73])) : 100; + e.formula5 = row[74] ? static_cast(atoi(row[74])) : 100; + e.formula6 = row[75] ? static_cast(atoi(row[75])) : 100; + e.formula7 = row[76] ? static_cast(atoi(row[76])) : 100; + e.formula8 = row[77] ? static_cast(atoi(row[77])) : 100; + e.formula9 = row[78] ? static_cast(atoi(row[78])) : 100; + e.formula10 = row[79] ? static_cast(atoi(row[79])) : 100; + e.formula11 = row[80] ? static_cast(atoi(row[80])) : 100; + e.formula12 = row[81] ? static_cast(atoi(row[81])) : 100; + e.LightType = row[82] ? static_cast(atoi(row[82])) : 0; + e.goodEffect = row[83] ? static_cast(atoi(row[83])) : 0; + e.Activated = row[84] ? static_cast(atoi(row[84])) : 0; + e.resisttype = row[85] ? static_cast(atoi(row[85])) : 0; + e.effectid1 = row[86] ? static_cast(atoi(row[86])) : 254; + e.effectid2 = row[87] ? static_cast(atoi(row[87])) : 254; + e.effectid3 = row[88] ? static_cast(atoi(row[88])) : 254; + e.effectid4 = row[89] ? static_cast(atoi(row[89])) : 254; + e.effectid5 = row[90] ? static_cast(atoi(row[90])) : 254; + e.effectid6 = row[91] ? static_cast(atoi(row[91])) : 254; + e.effectid7 = row[92] ? static_cast(atoi(row[92])) : 254; + e.effectid8 = row[93] ? static_cast(atoi(row[93])) : 254; + e.effectid9 = row[94] ? static_cast(atoi(row[94])) : 254; + e.effectid10 = row[95] ? static_cast(atoi(row[95])) : 254; + e.effectid11 = row[96] ? static_cast(atoi(row[96])) : 254; + e.effectid12 = row[97] ? static_cast(atoi(row[97])) : 254; + e.targettype = row[98] ? static_cast(atoi(row[98])) : 2; + e.basediff = row[99] ? static_cast(atoi(row[99])) : 0; + e.skill = row[100] ? static_cast(atoi(row[100])) : 98; + e.zonetype = row[101] ? static_cast(atoi(row[101])) : -1; + e.EnvironmentType = row[102] ? static_cast(atoi(row[102])) : 0; + e.TimeOfDay = row[103] ? static_cast(atoi(row[103])) : 0; + e.classes1 = row[104] ? static_cast(atoi(row[104])) : 255; + e.classes2 = row[105] ? static_cast(atoi(row[105])) : 255; + e.classes3 = row[106] ? static_cast(atoi(row[106])) : 255; + e.classes4 = row[107] ? static_cast(atoi(row[107])) : 255; + e.classes5 = row[108] ? static_cast(atoi(row[108])) : 255; + e.classes6 = row[109] ? static_cast(atoi(row[109])) : 255; + e.classes7 = row[110] ? static_cast(atoi(row[110])) : 255; + e.classes8 = row[111] ? static_cast(atoi(row[111])) : 255; + e.classes9 = row[112] ? static_cast(atoi(row[112])) : 255; + e.classes10 = row[113] ? static_cast(atoi(row[113])) : 255; + e.classes11 = row[114] ? static_cast(atoi(row[114])) : 255; + e.classes12 = row[115] ? static_cast(atoi(row[115])) : 255; + e.classes13 = row[116] ? static_cast(atoi(row[116])) : 255; + e.classes14 = row[117] ? static_cast(atoi(row[117])) : 255; + e.classes15 = row[118] ? static_cast(atoi(row[118])) : 255; + e.classes16 = row[119] ? static_cast(atoi(row[119])) : 255; + e.CastingAnim = row[120] ? static_cast(atoi(row[120])) : 44; + e.TargetAnim = row[121] ? static_cast(atoi(row[121])) : 13; + e.TravelType = row[122] ? static_cast(atoi(row[122])) : 0; + e.SpellAffectIndex = row[123] ? static_cast(atoi(row[123])) : -1; + e.disallow_sit = row[124] ? static_cast(atoi(row[124])) : 0; + e.deities0 = row[125] ? static_cast(atoi(row[125])) : 0; + e.deities1 = row[126] ? static_cast(atoi(row[126])) : 0; + e.deities2 = row[127] ? static_cast(atoi(row[127])) : 0; + e.deities3 = row[128] ? static_cast(atoi(row[128])) : 0; + e.deities4 = row[129] ? static_cast(atoi(row[129])) : 0; + e.deities5 = row[130] ? static_cast(atoi(row[130])) : 0; + e.deities6 = row[131] ? static_cast(atoi(row[131])) : 0; + e.deities7 = row[132] ? static_cast(atoi(row[132])) : 0; + e.deities8 = row[133] ? static_cast(atoi(row[133])) : 0; + e.deities9 = row[134] ? static_cast(atoi(row[134])) : 0; + e.deities10 = row[135] ? static_cast(atoi(row[135])) : 0; + e.deities11 = row[136] ? static_cast(atoi(row[136])) : 0; + e.deities12 = row[137] ? static_cast(atoi(row[137])) : 0; + e.deities13 = row[138] ? static_cast(atoi(row[138])) : 0; + e.deities14 = row[139] ? static_cast(atoi(row[139])) : 0; + e.deities15 = row[140] ? static_cast(atoi(row[140])) : 0; + e.deities16 = row[141] ? static_cast(atoi(row[141])) : 0; + e.field142 = row[142] ? static_cast(atoi(row[142])) : 100; + e.field143 = row[143] ? static_cast(atoi(row[143])) : 0; + e.new_icon = row[144] ? static_cast(atoi(row[144])) : 161; + e.spellanim = row[145] ? static_cast(atoi(row[145])) : 0; + e.uninterruptable = row[146] ? static_cast(atoi(row[146])) : 0; + e.ResistDiff = row[147] ? static_cast(atoi(row[147])) : -150; + e.dot_stacking_exempt = row[148] ? static_cast(atoi(row[148])) : 0; + e.deleteable = row[149] ? static_cast(atoi(row[149])) : 0; + e.RecourseLink = row[150] ? static_cast(atoi(row[150])) : 0; + e.no_partial_resist = row[151] ? static_cast(atoi(row[151])) : 0; + e.field152 = row[152] ? static_cast(atoi(row[152])) : 0; + e.field153 = row[153] ? static_cast(atoi(row[153])) : 0; + e.short_buff_box = row[154] ? static_cast(atoi(row[154])) : -1; + e.descnum = row[155] ? static_cast(atoi(row[155])) : 0; + e.typedescnum = row[156] ? static_cast(atoi(row[156])) : 0; + e.effectdescnum = row[157] ? static_cast(atoi(row[157])) : 0; + e.effectdescnum2 = row[158] ? static_cast(atoi(row[158])) : 0; + e.npc_no_los = row[159] ? static_cast(atoi(row[159])) : 0; + e.field160 = row[160] ? static_cast(atoi(row[160])) : 0; + e.reflectable = row[161] ? static_cast(atoi(row[161])) : 0; + e.bonushate = row[162] ? static_cast(atoi(row[162])) : 0; + e.field163 = row[163] ? static_cast(atoi(row[163])) : 100; + e.field164 = row[164] ? static_cast(atoi(row[164])) : -150; + e.ldon_trap = row[165] ? static_cast(atoi(row[165])) : 0; + e.EndurCost = row[166] ? static_cast(atoi(row[166])) : 0; + e.EndurTimerIndex = row[167] ? static_cast(atoi(row[167])) : 0; + e.IsDiscipline = row[168] ? static_cast(atoi(row[168])) : 0; + e.field169 = row[169] ? static_cast(atoi(row[169])) : 0; + e.field170 = row[170] ? static_cast(atoi(row[170])) : 0; + e.field171 = row[171] ? static_cast(atoi(row[171])) : 0; + e.field172 = row[172] ? static_cast(atoi(row[172])) : 0; + e.HateAdded = row[173] ? static_cast(atoi(row[173])) : 0; + e.EndurUpkeep = row[174] ? static_cast(atoi(row[174])) : 0; + e.numhitstype = row[175] ? static_cast(atoi(row[175])) : 0; + e.numhits = row[176] ? static_cast(atoi(row[176])) : 0; + e.pvpresistbase = row[177] ? static_cast(atoi(row[177])) : -150; + e.pvpresistcalc = row[178] ? static_cast(atoi(row[178])) : 100; + e.pvpresistcap = row[179] ? static_cast(atoi(row[179])) : -150; + e.spell_category = row[180] ? static_cast(atoi(row[180])) : -99; + e.pvp_duration = row[181] ? static_cast(atoi(row[181])) : 0; + e.pvp_duration_cap = row[182] ? static_cast(atoi(row[182])) : 0; + e.pcnpc_only_flag = row[183] ? static_cast(atoi(row[183])) : 0; + e.cast_not_standing = row[184] ? static_cast(atoi(row[184])) : 0; + e.can_mgb = row[185] ? static_cast(atoi(row[185])) : 0; + e.nodispell = row[186] ? static_cast(atoi(row[186])) : -1; + e.npc_category = row[187] ? static_cast(atoi(row[187])) : 0; + e.npc_usefulness = row[188] ? static_cast(atoi(row[188])) : 0; + e.MinResist = row[189] ? static_cast(atoi(row[189])) : 0; + e.MaxResist = row[190] ? static_cast(atoi(row[190])) : 0; + e.viral_targets = row[191] ? static_cast(atoi(row[191])) : 0; + e.viral_timer = row[192] ? static_cast(atoi(row[192])) : 0; + e.nimbuseffect = row[193] ? static_cast(atoi(row[193])) : 0; + e.ConeStartAngle = row[194] ? static_cast(atoi(row[194])) : 0; + e.ConeStopAngle = row[195] ? static_cast(atoi(row[195])) : 0; + e.sneaking = row[196] ? static_cast(atoi(row[196])) : 0; + e.not_extendable = row[197] ? static_cast(atoi(row[197])) : 0; + e.field198 = row[198] ? static_cast(atoi(row[198])) : 0; + e.field199 = row[199] ? static_cast(atoi(row[199])) : 1; + e.suspendable = row[200] ? static_cast(atoi(row[200])) : 0; + e.viral_range = row[201] ? static_cast(atoi(row[201])) : 0; + e.songcap = row[202] ? static_cast(atoi(row[202])) : 0; + e.field203 = row[203] ? static_cast(atoi(row[203])) : 0; + e.field204 = row[204] ? static_cast(atoi(row[204])) : 0; + e.no_block = row[205] ? static_cast(atoi(row[205])) : 0; + e.field206 = row[206] ? static_cast(atoi(row[206])) : -1; + e.spellgroup = row[207] ? static_cast(atoi(row[207])) : 0; + e.rank_ = row[208] ? static_cast(atoi(row[208])) : 0; + e.field209 = row[209] ? static_cast(atoi(row[209])) : 0; + e.field210 = row[210] ? static_cast(atoi(row[210])) : 1; + e.CastRestriction = row[211] ? static_cast(atoi(row[211])) : 0; + e.allowrest = row[212] ? static_cast(atoi(row[212])) : 0; + e.InCombat = row[213] ? static_cast(atoi(row[213])) : 0; + e.OutofCombat = row[214] ? static_cast(atoi(row[214])) : 0; + e.field215 = row[215] ? static_cast(atoi(row[215])) : 0; + e.field216 = row[216] ? static_cast(atoi(row[216])) : 0; + e.field217 = row[217] ? static_cast(atoi(row[217])) : 0; + e.aemaxtargets = row[218] ? static_cast(atoi(row[218])) : 0; + e.maxtargets = row[219] ? static_cast(atoi(row[219])) : 0; + e.field220 = row[220] ? static_cast(atoi(row[220])) : 0; + e.field221 = row[221] ? static_cast(atoi(row[221])) : 0; + e.field222 = row[222] ? static_cast(atoi(row[222])) : 0; + e.field223 = row[223] ? static_cast(atoi(row[223])) : 0; + e.persistdeath = row[224] ? static_cast(atoi(row[224])) : 0; + e.field225 = row[225] ? static_cast(atoi(row[225])) : 0; + e.field226 = row[226] ? static_cast(atoi(row[226])) : 0; + e.min_dist = row[227] ? strtof(row[227], nullptr) : 0; + e.min_dist_mod = row[228] ? strtof(row[228], nullptr) : 0; + e.max_dist = row[229] ? strtof(row[229], nullptr) : 0; + e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0; + e.min_range = row[231] ? static_cast(atoi(row[231])) : 0; + e.field232 = row[232] ? static_cast(atoi(row[232])) : 0; + e.field233 = row[233] ? static_cast(atoi(row[233])) : 0; + e.field234 = row[234] ? static_cast(atoi(row[234])) : 0; + e.field235 = row[235] ? static_cast(atoi(row[235])) : 0; + e.field236 = row[236] ? static_cast(atoi(row[236])) : 0; return e; } @@ -1489,7 +1489,7 @@ public: v.push_back(columns[157] + " = " + std::to_string(e.effectdescnum)); v.push_back(columns[158] + " = " + std::to_string(e.effectdescnum2)); v.push_back(columns[159] + " = " + std::to_string(e.npc_no_los)); - v.push_back(columns[160] + " = " + std::to_string(e.feedbackable)); + v.push_back(columns[160] + " = " + std::to_string(e.field160)); v.push_back(columns[161] + " = " + std::to_string(e.reflectable)); v.push_back(columns[162] + " = " + std::to_string(e.bonushate)); v.push_back(columns[163] + " = " + std::to_string(e.field163)); @@ -1527,7 +1527,7 @@ public: v.push_back(columns[195] + " = " + std::to_string(e.ConeStopAngle)); v.push_back(columns[196] + " = " + std::to_string(e.sneaking)); v.push_back(columns[197] + " = " + std::to_string(e.not_extendable)); - v.push_back(columns[198] + " = " + std::to_string(e.no_detrimental_spell_aggro)); + v.push_back(columns[198] + " = " + std::to_string(e.field198)); v.push_back(columns[199] + " = " + std::to_string(e.field199)); v.push_back(columns[200] + " = " + std::to_string(e.suspendable)); v.push_back(columns[201] + " = " + std::to_string(e.viral_range)); @@ -1538,7 +1538,7 @@ public: v.push_back(columns[206] + " = " + std::to_string(e.field206)); v.push_back(columns[207] + " = " + std::to_string(e.spellgroup)); v.push_back(columns[208] + " = " + std::to_string(e.rank_)); - v.push_back(columns[209] + " = " + std::to_string(e.no_resist)); + v.push_back(columns[209] + " = " + std::to_string(e.field209)); v.push_back(columns[210] + " = " + std::to_string(e.field210)); v.push_back(columns[211] + " = " + std::to_string(e.CastRestriction)); v.push_back(columns[212] + " = " + std::to_string(e.allowrest)); @@ -1546,13 +1546,13 @@ public: v.push_back(columns[214] + " = " + std::to_string(e.OutofCombat)); v.push_back(columns[215] + " = " + std::to_string(e.field215)); v.push_back(columns[216] + " = " + std::to_string(e.field216)); - v.push_back(columns[217] + " = " + std::to_string(e.override_crit_chance)); + v.push_back(columns[217] + " = " + std::to_string(e.field217)); v.push_back(columns[218] + " = " + std::to_string(e.aemaxtargets)); v.push_back(columns[219] + " = " + std::to_string(e.maxtargets)); - v.push_back(columns[220] + " = " + std::to_string(e.no_heal_damage_item_mod)); - v.push_back(columns[221] + " = " + std::to_string(e.caster_requirement_id)); - v.push_back(columns[222] + " = " + std::to_string(e.spell_class)); - v.push_back(columns[223] + " = " + std::to_string(e.spell_subclass)); + v.push_back(columns[220] + " = " + std::to_string(e.field220)); + v.push_back(columns[221] + " = " + std::to_string(e.field221)); + v.push_back(columns[222] + " = " + std::to_string(e.field222)); + v.push_back(columns[223] + " = " + std::to_string(e.field223)); v.push_back(columns[224] + " = " + std::to_string(e.persistdeath)); v.push_back(columns[225] + " = " + std::to_string(e.field225)); v.push_back(columns[226] + " = " + std::to_string(e.field226)); @@ -1561,7 +1561,7 @@ public: v.push_back(columns[229] + " = " + std::to_string(e.max_dist)); v.push_back(columns[230] + " = " + std::to_string(e.max_dist_mod)); v.push_back(columns[231] + " = " + std::to_string(e.min_range)); - v.push_back(columns[232] + " = " + std::to_string(e.no_remove)); + v.push_back(columns[232] + " = " + std::to_string(e.field232)); v.push_back(columns[233] + " = " + std::to_string(e.field233)); v.push_back(columns[234] + " = " + std::to_string(e.field234)); v.push_back(columns[235] + " = " + std::to_string(e.field235)); @@ -1747,7 +1747,7 @@ public: v.push_back(std::to_string(e.effectdescnum)); v.push_back(std::to_string(e.effectdescnum2)); v.push_back(std::to_string(e.npc_no_los)); - v.push_back(std::to_string(e.feedbackable)); + v.push_back(std::to_string(e.field160)); v.push_back(std::to_string(e.reflectable)); v.push_back(std::to_string(e.bonushate)); v.push_back(std::to_string(e.field163)); @@ -1785,7 +1785,7 @@ public: v.push_back(std::to_string(e.ConeStopAngle)); v.push_back(std::to_string(e.sneaking)); v.push_back(std::to_string(e.not_extendable)); - v.push_back(std::to_string(e.no_detrimental_spell_aggro)); + v.push_back(std::to_string(e.field198)); v.push_back(std::to_string(e.field199)); v.push_back(std::to_string(e.suspendable)); v.push_back(std::to_string(e.viral_range)); @@ -1796,7 +1796,7 @@ public: v.push_back(std::to_string(e.field206)); v.push_back(std::to_string(e.spellgroup)); v.push_back(std::to_string(e.rank_)); - v.push_back(std::to_string(e.no_resist)); + v.push_back(std::to_string(e.field209)); v.push_back(std::to_string(e.field210)); v.push_back(std::to_string(e.CastRestriction)); v.push_back(std::to_string(e.allowrest)); @@ -1804,13 +1804,13 @@ public: v.push_back(std::to_string(e.OutofCombat)); v.push_back(std::to_string(e.field215)); v.push_back(std::to_string(e.field216)); - v.push_back(std::to_string(e.override_crit_chance)); + v.push_back(std::to_string(e.field217)); v.push_back(std::to_string(e.aemaxtargets)); v.push_back(std::to_string(e.maxtargets)); - v.push_back(std::to_string(e.no_heal_damage_item_mod)); - v.push_back(std::to_string(e.caster_requirement_id)); - v.push_back(std::to_string(e.spell_class)); - v.push_back(std::to_string(e.spell_subclass)); + v.push_back(std::to_string(e.field220)); + v.push_back(std::to_string(e.field221)); + v.push_back(std::to_string(e.field222)); + v.push_back(std::to_string(e.field223)); v.push_back(std::to_string(e.persistdeath)); v.push_back(std::to_string(e.field225)); v.push_back(std::to_string(e.field226)); @@ -1819,7 +1819,7 @@ public: v.push_back(std::to_string(e.max_dist)); v.push_back(std::to_string(e.max_dist_mod)); v.push_back(std::to_string(e.min_range)); - v.push_back(std::to_string(e.no_remove)); + v.push_back(std::to_string(e.field232)); v.push_back(std::to_string(e.field233)); v.push_back(std::to_string(e.field234)); v.push_back(std::to_string(e.field235)); @@ -2013,7 +2013,7 @@ public: v.push_back(std::to_string(e.effectdescnum)); v.push_back(std::to_string(e.effectdescnum2)); v.push_back(std::to_string(e.npc_no_los)); - v.push_back(std::to_string(e.feedbackable)); + v.push_back(std::to_string(e.field160)); v.push_back(std::to_string(e.reflectable)); v.push_back(std::to_string(e.bonushate)); v.push_back(std::to_string(e.field163)); @@ -2051,7 +2051,7 @@ public: v.push_back(std::to_string(e.ConeStopAngle)); v.push_back(std::to_string(e.sneaking)); v.push_back(std::to_string(e.not_extendable)); - v.push_back(std::to_string(e.no_detrimental_spell_aggro)); + v.push_back(std::to_string(e.field198)); v.push_back(std::to_string(e.field199)); v.push_back(std::to_string(e.suspendable)); v.push_back(std::to_string(e.viral_range)); @@ -2062,7 +2062,7 @@ public: v.push_back(std::to_string(e.field206)); v.push_back(std::to_string(e.spellgroup)); v.push_back(std::to_string(e.rank_)); - v.push_back(std::to_string(e.no_resist)); + v.push_back(std::to_string(e.field209)); v.push_back(std::to_string(e.field210)); v.push_back(std::to_string(e.CastRestriction)); v.push_back(std::to_string(e.allowrest)); @@ -2070,13 +2070,13 @@ public: v.push_back(std::to_string(e.OutofCombat)); v.push_back(std::to_string(e.field215)); v.push_back(std::to_string(e.field216)); - v.push_back(std::to_string(e.override_crit_chance)); + v.push_back(std::to_string(e.field217)); v.push_back(std::to_string(e.aemaxtargets)); v.push_back(std::to_string(e.maxtargets)); - v.push_back(std::to_string(e.no_heal_damage_item_mod)); - v.push_back(std::to_string(e.caster_requirement_id)); - v.push_back(std::to_string(e.spell_class)); - v.push_back(std::to_string(e.spell_subclass)); + v.push_back(std::to_string(e.field220)); + v.push_back(std::to_string(e.field221)); + v.push_back(std::to_string(e.field222)); + v.push_back(std::to_string(e.field223)); v.push_back(std::to_string(e.persistdeath)); v.push_back(std::to_string(e.field225)); v.push_back(std::to_string(e.field226)); @@ -2085,7 +2085,7 @@ public: v.push_back(std::to_string(e.max_dist)); v.push_back(std::to_string(e.max_dist_mod)); v.push_back(std::to_string(e.min_range)); - v.push_back(std::to_string(e.no_remove)); + v.push_back(std::to_string(e.field232)); v.push_back(std::to_string(e.field233)); v.push_back(std::to_string(e.field234)); v.push_back(std::to_string(e.field235)); @@ -2123,243 +2123,243 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpellsNew e{}; - e.id = row[0] ? static_cast(atoi(row[0])) : 0; - e.name = row[1] ? row[1] : ""; - e.player_1 = row[2] ? row[2] : "BLUE_TRAIL"; - e.teleport_zone = row[3] ? row[3] : ""; - e.you_cast = row[4] ? row[4] : ""; - e.other_casts = row[5] ? row[5] : ""; - e.cast_on_you = row[6] ? row[6] : ""; - e.cast_on_other = row[7] ? row[7] : ""; - e.spell_fades = row[8] ? row[8] : ""; - e.range_ = row[9] ? static_cast(atoi(row[9])) : 100; - e.aoerange = row[10] ? static_cast(atoi(row[10])) : 0; - e.pushback = row[11] ? static_cast(atoi(row[11])) : 0; - e.pushup = row[12] ? static_cast(atoi(row[12])) : 0; - e.cast_time = row[13] ? static_cast(atoi(row[13])) : 0; - e.recovery_time = row[14] ? static_cast(atoi(row[14])) : 0; - e.recast_time = row[15] ? static_cast(atoi(row[15])) : 0; - e.buffdurationformula = row[16] ? static_cast(atoi(row[16])) : 7; - e.buffduration = row[17] ? static_cast(atoi(row[17])) : 65; - e.AEDuration = row[18] ? static_cast(atoi(row[18])) : 0; - e.mana = row[19] ? static_cast(atoi(row[19])) : 0; - e.effect_base_value1 = row[20] ? static_cast(atoi(row[20])) : 100; - e.effect_base_value2 = row[21] ? static_cast(atoi(row[21])) : 0; - e.effect_base_value3 = row[22] ? static_cast(atoi(row[22])) : 0; - e.effect_base_value4 = row[23] ? static_cast(atoi(row[23])) : 0; - e.effect_base_value5 = row[24] ? static_cast(atoi(row[24])) : 0; - e.effect_base_value6 = row[25] ? static_cast(atoi(row[25])) : 0; - e.effect_base_value7 = row[26] ? static_cast(atoi(row[26])) : 0; - e.effect_base_value8 = row[27] ? static_cast(atoi(row[27])) : 0; - e.effect_base_value9 = row[28] ? static_cast(atoi(row[28])) : 0; - e.effect_base_value10 = row[29] ? static_cast(atoi(row[29])) : 0; - e.effect_base_value11 = row[30] ? static_cast(atoi(row[30])) : 0; - e.effect_base_value12 = row[31] ? static_cast(atoi(row[31])) : 0; - e.effect_limit_value1 = row[32] ? static_cast(atoi(row[32])) : 0; - e.effect_limit_value2 = row[33] ? static_cast(atoi(row[33])) : 0; - e.effect_limit_value3 = row[34] ? static_cast(atoi(row[34])) : 0; - e.effect_limit_value4 = row[35] ? static_cast(atoi(row[35])) : 0; - e.effect_limit_value5 = row[36] ? static_cast(atoi(row[36])) : 0; - e.effect_limit_value6 = row[37] ? static_cast(atoi(row[37])) : 0; - e.effect_limit_value7 = row[38] ? static_cast(atoi(row[38])) : 0; - e.effect_limit_value8 = row[39] ? static_cast(atoi(row[39])) : 0; - e.effect_limit_value9 = row[40] ? static_cast(atoi(row[40])) : 0; - e.effect_limit_value10 = row[41] ? static_cast(atoi(row[41])) : 0; - e.effect_limit_value11 = row[42] ? static_cast(atoi(row[42])) : 0; - e.effect_limit_value12 = row[43] ? static_cast(atoi(row[43])) : 0; - e.max1 = row[44] ? static_cast(atoi(row[44])) : 0; - e.max2 = row[45] ? static_cast(atoi(row[45])) : 0; - e.max3 = row[46] ? static_cast(atoi(row[46])) : 0; - e.max4 = row[47] ? static_cast(atoi(row[47])) : 0; - e.max5 = row[48] ? static_cast(atoi(row[48])) : 0; - e.max6 = row[49] ? static_cast(atoi(row[49])) : 0; - e.max7 = row[50] ? static_cast(atoi(row[50])) : 0; - e.max8 = row[51] ? static_cast(atoi(row[51])) : 0; - e.max9 = row[52] ? static_cast(atoi(row[52])) : 0; - e.max10 = row[53] ? static_cast(atoi(row[53])) : 0; - e.max11 = row[54] ? static_cast(atoi(row[54])) : 0; - e.max12 = row[55] ? static_cast(atoi(row[55])) : 0; - e.icon = row[56] ? static_cast(atoi(row[56])) : 0; - e.memicon = row[57] ? static_cast(atoi(row[57])) : 0; - e.components1 = row[58] ? static_cast(atoi(row[58])) : -1; - e.components2 = row[59] ? static_cast(atoi(row[59])) : -1; - e.components3 = row[60] ? static_cast(atoi(row[60])) : -1; - e.components4 = row[61] ? static_cast(atoi(row[61])) : -1; - e.component_counts1 = row[62] ? static_cast(atoi(row[62])) : 1; - e.component_counts2 = row[63] ? static_cast(atoi(row[63])) : 1; - e.component_counts3 = row[64] ? static_cast(atoi(row[64])) : 1; - e.component_counts4 = row[65] ? static_cast(atoi(row[65])) : 1; - e.NoexpendReagent1 = row[66] ? static_cast(atoi(row[66])) : -1; - e.NoexpendReagent2 = row[67] ? static_cast(atoi(row[67])) : -1; - e.NoexpendReagent3 = row[68] ? static_cast(atoi(row[68])) : -1; - e.NoexpendReagent4 = row[69] ? static_cast(atoi(row[69])) : -1; - e.formula1 = row[70] ? static_cast(atoi(row[70])) : 100; - e.formula2 = row[71] ? static_cast(atoi(row[71])) : 100; - e.formula3 = row[72] ? static_cast(atoi(row[72])) : 100; - e.formula4 = row[73] ? static_cast(atoi(row[73])) : 100; - e.formula5 = row[74] ? static_cast(atoi(row[74])) : 100; - e.formula6 = row[75] ? static_cast(atoi(row[75])) : 100; - e.formula7 = row[76] ? static_cast(atoi(row[76])) : 100; - e.formula8 = row[77] ? static_cast(atoi(row[77])) : 100; - e.formula9 = row[78] ? static_cast(atoi(row[78])) : 100; - e.formula10 = row[79] ? static_cast(atoi(row[79])) : 100; - e.formula11 = row[80] ? static_cast(atoi(row[80])) : 100; - e.formula12 = row[81] ? static_cast(atoi(row[81])) : 100; - e.LightType = row[82] ? static_cast(atoi(row[82])) : 0; - e.goodEffect = row[83] ? static_cast(atoi(row[83])) : 0; - e.Activated = row[84] ? static_cast(atoi(row[84])) : 0; - e.resisttype = row[85] ? static_cast(atoi(row[85])) : 0; - e.effectid1 = row[86] ? static_cast(atoi(row[86])) : 254; - e.effectid2 = row[87] ? static_cast(atoi(row[87])) : 254; - e.effectid3 = row[88] ? static_cast(atoi(row[88])) : 254; - e.effectid4 = row[89] ? static_cast(atoi(row[89])) : 254; - e.effectid5 = row[90] ? static_cast(atoi(row[90])) : 254; - e.effectid6 = row[91] ? static_cast(atoi(row[91])) : 254; - e.effectid7 = row[92] ? static_cast(atoi(row[92])) : 254; - e.effectid8 = row[93] ? static_cast(atoi(row[93])) : 254; - e.effectid9 = row[94] ? static_cast(atoi(row[94])) : 254; - e.effectid10 = row[95] ? static_cast(atoi(row[95])) : 254; - e.effectid11 = row[96] ? static_cast(atoi(row[96])) : 254; - e.effectid12 = row[97] ? static_cast(atoi(row[97])) : 254; - e.targettype = row[98] ? static_cast(atoi(row[98])) : 2; - e.basediff = row[99] ? static_cast(atoi(row[99])) : 0; - e.skill = row[100] ? static_cast(atoi(row[100])) : 98; - e.zonetype = row[101] ? static_cast(atoi(row[101])) : -1; - e.EnvironmentType = row[102] ? static_cast(atoi(row[102])) : 0; - e.TimeOfDay = row[103] ? static_cast(atoi(row[103])) : 0; - e.classes1 = row[104] ? static_cast(atoi(row[104])) : 255; - e.classes2 = row[105] ? static_cast(atoi(row[105])) : 255; - e.classes3 = row[106] ? static_cast(atoi(row[106])) : 255; - e.classes4 = row[107] ? static_cast(atoi(row[107])) : 255; - e.classes5 = row[108] ? static_cast(atoi(row[108])) : 255; - e.classes6 = row[109] ? static_cast(atoi(row[109])) : 255; - e.classes7 = row[110] ? static_cast(atoi(row[110])) : 255; - e.classes8 = row[111] ? static_cast(atoi(row[111])) : 255; - e.classes9 = row[112] ? static_cast(atoi(row[112])) : 255; - e.classes10 = row[113] ? static_cast(atoi(row[113])) : 255; - e.classes11 = row[114] ? static_cast(atoi(row[114])) : 255; - e.classes12 = row[115] ? static_cast(atoi(row[115])) : 255; - e.classes13 = row[116] ? static_cast(atoi(row[116])) : 255; - e.classes14 = row[117] ? static_cast(atoi(row[117])) : 255; - e.classes15 = row[118] ? static_cast(atoi(row[118])) : 255; - e.classes16 = row[119] ? static_cast(atoi(row[119])) : 255; - e.CastingAnim = row[120] ? static_cast(atoi(row[120])) : 44; - e.TargetAnim = row[121] ? static_cast(atoi(row[121])) : 13; - e.TravelType = row[122] ? static_cast(atoi(row[122])) : 0; - e.SpellAffectIndex = row[123] ? static_cast(atoi(row[123])) : -1; - e.disallow_sit = row[124] ? static_cast(atoi(row[124])) : 0; - e.deities0 = row[125] ? static_cast(atoi(row[125])) : 0; - e.deities1 = row[126] ? static_cast(atoi(row[126])) : 0; - e.deities2 = row[127] ? static_cast(atoi(row[127])) : 0; - e.deities3 = row[128] ? static_cast(atoi(row[128])) : 0; - e.deities4 = row[129] ? static_cast(atoi(row[129])) : 0; - e.deities5 = row[130] ? static_cast(atoi(row[130])) : 0; - e.deities6 = row[131] ? static_cast(atoi(row[131])) : 0; - e.deities7 = row[132] ? static_cast(atoi(row[132])) : 0; - e.deities8 = row[133] ? static_cast(atoi(row[133])) : 0; - e.deities9 = row[134] ? static_cast(atoi(row[134])) : 0; - e.deities10 = row[135] ? static_cast(atoi(row[135])) : 0; - e.deities11 = row[136] ? static_cast(atoi(row[136])) : 0; - e.deities12 = row[137] ? static_cast(atoi(row[137])) : 0; - e.deities13 = row[138] ? static_cast(atoi(row[138])) : 0; - e.deities14 = row[139] ? static_cast(atoi(row[139])) : 0; - e.deities15 = row[140] ? static_cast(atoi(row[140])) : 0; - e.deities16 = row[141] ? static_cast(atoi(row[141])) : 0; - e.field142 = row[142] ? static_cast(atoi(row[142])) : 100; - e.field143 = row[143] ? static_cast(atoi(row[143])) : 0; - e.new_icon = row[144] ? static_cast(atoi(row[144])) : 161; - e.spellanim = row[145] ? static_cast(atoi(row[145])) : 0; - e.uninterruptable = row[146] ? static_cast(atoi(row[146])) : 0; - e.ResistDiff = row[147] ? static_cast(atoi(row[147])) : -150; - e.dot_stacking_exempt = row[148] ? static_cast(atoi(row[148])) : 0; - e.deleteable = row[149] ? static_cast(atoi(row[149])) : 0; - e.RecourseLink = row[150] ? static_cast(atoi(row[150])) : 0; - e.no_partial_resist = row[151] ? static_cast(atoi(row[151])) : 0; - e.field152 = row[152] ? static_cast(atoi(row[152])) : 0; - e.field153 = row[153] ? static_cast(atoi(row[153])) : 0; - e.short_buff_box = row[154] ? static_cast(atoi(row[154])) : -1; - e.descnum = row[155] ? static_cast(atoi(row[155])) : 0; - e.typedescnum = row[156] ? static_cast(atoi(row[156])) : 0; - e.effectdescnum = row[157] ? static_cast(atoi(row[157])) : 0; - e.effectdescnum2 = row[158] ? static_cast(atoi(row[158])) : 0; - e.npc_no_los = row[159] ? static_cast(atoi(row[159])) : 0; - e.feedbackable = row[160] ? static_cast(atoi(row[160])) : 0; - e.reflectable = row[161] ? static_cast(atoi(row[161])) : 0; - e.bonushate = row[162] ? static_cast(atoi(row[162])) : 0; - e.field163 = row[163] ? static_cast(atoi(row[163])) : 100; - e.field164 = row[164] ? static_cast(atoi(row[164])) : -150; - e.ldon_trap = row[165] ? static_cast(atoi(row[165])) : 0; - e.EndurCost = row[166] ? static_cast(atoi(row[166])) : 0; - e.EndurTimerIndex = row[167] ? static_cast(atoi(row[167])) : 0; - e.IsDiscipline = row[168] ? static_cast(atoi(row[168])) : 0; - e.field169 = row[169] ? static_cast(atoi(row[169])) : 0; - e.field170 = row[170] ? static_cast(atoi(row[170])) : 0; - e.field171 = row[171] ? static_cast(atoi(row[171])) : 0; - e.field172 = row[172] ? static_cast(atoi(row[172])) : 0; - e.HateAdded = row[173] ? static_cast(atoi(row[173])) : 0; - e.EndurUpkeep = row[174] ? static_cast(atoi(row[174])) : 0; - e.numhitstype = row[175] ? static_cast(atoi(row[175])) : 0; - e.numhits = row[176] ? static_cast(atoi(row[176])) : 0; - e.pvpresistbase = row[177] ? static_cast(atoi(row[177])) : -150; - e.pvpresistcalc = row[178] ? static_cast(atoi(row[178])) : 100; - e.pvpresistcap = row[179] ? static_cast(atoi(row[179])) : -150; - e.spell_category = row[180] ? static_cast(atoi(row[180])) : -99; - e.pvp_duration = row[181] ? static_cast(atoi(row[181])) : 0; - e.pvp_duration_cap = row[182] ? static_cast(atoi(row[182])) : 0; - e.pcnpc_only_flag = row[183] ? static_cast(atoi(row[183])) : 0; - e.cast_not_standing = row[184] ? static_cast(atoi(row[184])) : 0; - e.can_mgb = row[185] ? static_cast(atoi(row[185])) : 0; - e.nodispell = row[186] ? static_cast(atoi(row[186])) : -1; - e.npc_category = row[187] ? static_cast(atoi(row[187])) : 0; - e.npc_usefulness = row[188] ? static_cast(atoi(row[188])) : 0; - e.MinResist = row[189] ? static_cast(atoi(row[189])) : 0; - e.MaxResist = row[190] ? static_cast(atoi(row[190])) : 0; - e.viral_targets = row[191] ? static_cast(atoi(row[191])) : 0; - e.viral_timer = row[192] ? static_cast(atoi(row[192])) : 0; - e.nimbuseffect = row[193] ? static_cast(atoi(row[193])) : 0; - e.ConeStartAngle = row[194] ? static_cast(atoi(row[194])) : 0; - e.ConeStopAngle = row[195] ? static_cast(atoi(row[195])) : 0; - e.sneaking = row[196] ? static_cast(atoi(row[196])) : 0; - e.not_extendable = row[197] ? static_cast(atoi(row[197])) : 0; - e.no_detrimental_spell_aggro = row[198] ? static_cast(atoi(row[198])) : 0; - e.field199 = row[199] ? static_cast(atoi(row[199])) : 1; - e.suspendable = row[200] ? static_cast(atoi(row[200])) : 0; - e.viral_range = row[201] ? static_cast(atoi(row[201])) : 0; - e.songcap = row[202] ? static_cast(atoi(row[202])) : 0; - e.field203 = row[203] ? static_cast(atoi(row[203])) : 0; - e.field204 = row[204] ? static_cast(atoi(row[204])) : 0; - e.no_block = row[205] ? static_cast(atoi(row[205])) : 0; - e.field206 = row[206] ? static_cast(atoi(row[206])) : -1; - e.spellgroup = row[207] ? static_cast(atoi(row[207])) : 0; - e.rank_ = row[208] ? static_cast(atoi(row[208])) : 0; - e.no_resist = row[209] ? static_cast(atoi(row[209])) : 0; - e.field210 = row[210] ? static_cast(atoi(row[210])) : 1; - e.CastRestriction = row[211] ? static_cast(atoi(row[211])) : 0; - e.allowrest = row[212] ? static_cast(atoi(row[212])) : 0; - e.InCombat = row[213] ? static_cast(atoi(row[213])) : 0; - e.OutofCombat = row[214] ? static_cast(atoi(row[214])) : 0; - e.field215 = row[215] ? static_cast(atoi(row[215])) : 0; - e.field216 = row[216] ? static_cast(atoi(row[216])) : 0; - e.override_crit_chance = row[217] ? static_cast(atoi(row[217])) : 0; - e.aemaxtargets = row[218] ? static_cast(atoi(row[218])) : 0; - e.maxtargets = row[219] ? static_cast(atoi(row[219])) : 0; - e.no_heal_damage_item_mod = row[220] ? static_cast(atoi(row[220])) : 0; - e.caster_requirement_id = row[221] ? static_cast(atoi(row[221])) : 0; - e.spell_class = row[222] ? static_cast(atoi(row[222])) : 0; - e.spell_subclass = row[223] ? static_cast(atoi(row[223])) : 0; - e.persistdeath = row[224] ? static_cast(atoi(row[224])) : 0; - e.field225 = row[225] ? static_cast(atoi(row[225])) : 0; - e.field226 = row[226] ? static_cast(atoi(row[226])) : 0; - e.min_dist = row[227] ? strtof(row[227], nullptr) : 0; - e.min_dist_mod = row[228] ? strtof(row[228], nullptr) : 0; - e.max_dist = row[229] ? strtof(row[229], nullptr) : 0; - e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0; - e.min_range = row[231] ? static_cast(atoi(row[231])) : 0; - e.no_remove = row[232] ? static_cast(atoi(row[232])) : 0; - e.field233 = row[233] ? static_cast(atoi(row[233])) : 0; - e.field234 = row[234] ? static_cast(atoi(row[234])) : 0; - e.field235 = row[235] ? static_cast(atoi(row[235])) : 0; - e.field236 = row[236] ? static_cast(atoi(row[236])) : 0; + e.id = row[0] ? static_cast(atoi(row[0])) : 0; + e.name = row[1] ? row[1] : ""; + e.player_1 = row[2] ? row[2] : "BLUE_TRAIL"; + e.teleport_zone = row[3] ? row[3] : ""; + e.you_cast = row[4] ? row[4] : ""; + e.other_casts = row[5] ? row[5] : ""; + e.cast_on_you = row[6] ? row[6] : ""; + e.cast_on_other = row[7] ? row[7] : ""; + e.spell_fades = row[8] ? row[8] : ""; + e.range_ = row[9] ? static_cast(atoi(row[9])) : 100; + e.aoerange = row[10] ? static_cast(atoi(row[10])) : 0; + e.pushback = row[11] ? static_cast(atoi(row[11])) : 0; + e.pushup = row[12] ? static_cast(atoi(row[12])) : 0; + e.cast_time = row[13] ? static_cast(atoi(row[13])) : 0; + e.recovery_time = row[14] ? static_cast(atoi(row[14])) : 0; + e.recast_time = row[15] ? static_cast(atoi(row[15])) : 0; + e.buffdurationformula = row[16] ? static_cast(atoi(row[16])) : 7; + e.buffduration = row[17] ? static_cast(atoi(row[17])) : 65; + e.AEDuration = row[18] ? static_cast(atoi(row[18])) : 0; + e.mana = row[19] ? static_cast(atoi(row[19])) : 0; + e.effect_base_value1 = row[20] ? static_cast(atoi(row[20])) : 100; + e.effect_base_value2 = row[21] ? static_cast(atoi(row[21])) : 0; + e.effect_base_value3 = row[22] ? static_cast(atoi(row[22])) : 0; + e.effect_base_value4 = row[23] ? static_cast(atoi(row[23])) : 0; + e.effect_base_value5 = row[24] ? static_cast(atoi(row[24])) : 0; + e.effect_base_value6 = row[25] ? static_cast(atoi(row[25])) : 0; + e.effect_base_value7 = row[26] ? static_cast(atoi(row[26])) : 0; + e.effect_base_value8 = row[27] ? static_cast(atoi(row[27])) : 0; + e.effect_base_value9 = row[28] ? static_cast(atoi(row[28])) : 0; + e.effect_base_value10 = row[29] ? static_cast(atoi(row[29])) : 0; + e.effect_base_value11 = row[30] ? static_cast(atoi(row[30])) : 0; + e.effect_base_value12 = row[31] ? static_cast(atoi(row[31])) : 0; + e.effect_limit_value1 = row[32] ? static_cast(atoi(row[32])) : 0; + e.effect_limit_value2 = row[33] ? static_cast(atoi(row[33])) : 0; + e.effect_limit_value3 = row[34] ? static_cast(atoi(row[34])) : 0; + e.effect_limit_value4 = row[35] ? static_cast(atoi(row[35])) : 0; + e.effect_limit_value5 = row[36] ? static_cast(atoi(row[36])) : 0; + e.effect_limit_value6 = row[37] ? static_cast(atoi(row[37])) : 0; + e.effect_limit_value7 = row[38] ? static_cast(atoi(row[38])) : 0; + e.effect_limit_value8 = row[39] ? static_cast(atoi(row[39])) : 0; + e.effect_limit_value9 = row[40] ? static_cast(atoi(row[40])) : 0; + e.effect_limit_value10 = row[41] ? static_cast(atoi(row[41])) : 0; + e.effect_limit_value11 = row[42] ? static_cast(atoi(row[42])) : 0; + e.effect_limit_value12 = row[43] ? static_cast(atoi(row[43])) : 0; + e.max1 = row[44] ? static_cast(atoi(row[44])) : 0; + e.max2 = row[45] ? static_cast(atoi(row[45])) : 0; + e.max3 = row[46] ? static_cast(atoi(row[46])) : 0; + e.max4 = row[47] ? static_cast(atoi(row[47])) : 0; + e.max5 = row[48] ? static_cast(atoi(row[48])) : 0; + e.max6 = row[49] ? static_cast(atoi(row[49])) : 0; + e.max7 = row[50] ? static_cast(atoi(row[50])) : 0; + e.max8 = row[51] ? static_cast(atoi(row[51])) : 0; + e.max9 = row[52] ? static_cast(atoi(row[52])) : 0; + e.max10 = row[53] ? static_cast(atoi(row[53])) : 0; + e.max11 = row[54] ? static_cast(atoi(row[54])) : 0; + e.max12 = row[55] ? static_cast(atoi(row[55])) : 0; + e.icon = row[56] ? static_cast(atoi(row[56])) : 0; + e.memicon = row[57] ? static_cast(atoi(row[57])) : 0; + e.components1 = row[58] ? static_cast(atoi(row[58])) : -1; + e.components2 = row[59] ? static_cast(atoi(row[59])) : -1; + e.components3 = row[60] ? static_cast(atoi(row[60])) : -1; + e.components4 = row[61] ? static_cast(atoi(row[61])) : -1; + e.component_counts1 = row[62] ? static_cast(atoi(row[62])) : 1; + e.component_counts2 = row[63] ? static_cast(atoi(row[63])) : 1; + e.component_counts3 = row[64] ? static_cast(atoi(row[64])) : 1; + e.component_counts4 = row[65] ? static_cast(atoi(row[65])) : 1; + e.NoexpendReagent1 = row[66] ? static_cast(atoi(row[66])) : -1; + e.NoexpendReagent2 = row[67] ? static_cast(atoi(row[67])) : -1; + e.NoexpendReagent3 = row[68] ? static_cast(atoi(row[68])) : -1; + e.NoexpendReagent4 = row[69] ? static_cast(atoi(row[69])) : -1; + e.formula1 = row[70] ? static_cast(atoi(row[70])) : 100; + e.formula2 = row[71] ? static_cast(atoi(row[71])) : 100; + e.formula3 = row[72] ? static_cast(atoi(row[72])) : 100; + e.formula4 = row[73] ? static_cast(atoi(row[73])) : 100; + e.formula5 = row[74] ? static_cast(atoi(row[74])) : 100; + e.formula6 = row[75] ? static_cast(atoi(row[75])) : 100; + e.formula7 = row[76] ? static_cast(atoi(row[76])) : 100; + e.formula8 = row[77] ? static_cast(atoi(row[77])) : 100; + e.formula9 = row[78] ? static_cast(atoi(row[78])) : 100; + e.formula10 = row[79] ? static_cast(atoi(row[79])) : 100; + e.formula11 = row[80] ? static_cast(atoi(row[80])) : 100; + e.formula12 = row[81] ? static_cast(atoi(row[81])) : 100; + e.LightType = row[82] ? static_cast(atoi(row[82])) : 0; + e.goodEffect = row[83] ? static_cast(atoi(row[83])) : 0; + e.Activated = row[84] ? static_cast(atoi(row[84])) : 0; + e.resisttype = row[85] ? static_cast(atoi(row[85])) : 0; + e.effectid1 = row[86] ? static_cast(atoi(row[86])) : 254; + e.effectid2 = row[87] ? static_cast(atoi(row[87])) : 254; + e.effectid3 = row[88] ? static_cast(atoi(row[88])) : 254; + e.effectid4 = row[89] ? static_cast(atoi(row[89])) : 254; + e.effectid5 = row[90] ? static_cast(atoi(row[90])) : 254; + e.effectid6 = row[91] ? static_cast(atoi(row[91])) : 254; + e.effectid7 = row[92] ? static_cast(atoi(row[92])) : 254; + e.effectid8 = row[93] ? static_cast(atoi(row[93])) : 254; + e.effectid9 = row[94] ? static_cast(atoi(row[94])) : 254; + e.effectid10 = row[95] ? static_cast(atoi(row[95])) : 254; + e.effectid11 = row[96] ? static_cast(atoi(row[96])) : 254; + e.effectid12 = row[97] ? static_cast(atoi(row[97])) : 254; + e.targettype = row[98] ? static_cast(atoi(row[98])) : 2; + e.basediff = row[99] ? static_cast(atoi(row[99])) : 0; + e.skill = row[100] ? static_cast(atoi(row[100])) : 98; + e.zonetype = row[101] ? static_cast(atoi(row[101])) : -1; + e.EnvironmentType = row[102] ? static_cast(atoi(row[102])) : 0; + e.TimeOfDay = row[103] ? static_cast(atoi(row[103])) : 0; + e.classes1 = row[104] ? static_cast(atoi(row[104])) : 255; + e.classes2 = row[105] ? static_cast(atoi(row[105])) : 255; + e.classes3 = row[106] ? static_cast(atoi(row[106])) : 255; + e.classes4 = row[107] ? static_cast(atoi(row[107])) : 255; + e.classes5 = row[108] ? static_cast(atoi(row[108])) : 255; + e.classes6 = row[109] ? static_cast(atoi(row[109])) : 255; + e.classes7 = row[110] ? static_cast(atoi(row[110])) : 255; + e.classes8 = row[111] ? static_cast(atoi(row[111])) : 255; + e.classes9 = row[112] ? static_cast(atoi(row[112])) : 255; + e.classes10 = row[113] ? static_cast(atoi(row[113])) : 255; + e.classes11 = row[114] ? static_cast(atoi(row[114])) : 255; + e.classes12 = row[115] ? static_cast(atoi(row[115])) : 255; + e.classes13 = row[116] ? static_cast(atoi(row[116])) : 255; + e.classes14 = row[117] ? static_cast(atoi(row[117])) : 255; + e.classes15 = row[118] ? static_cast(atoi(row[118])) : 255; + e.classes16 = row[119] ? static_cast(atoi(row[119])) : 255; + e.CastingAnim = row[120] ? static_cast(atoi(row[120])) : 44; + e.TargetAnim = row[121] ? static_cast(atoi(row[121])) : 13; + e.TravelType = row[122] ? static_cast(atoi(row[122])) : 0; + e.SpellAffectIndex = row[123] ? static_cast(atoi(row[123])) : -1; + e.disallow_sit = row[124] ? static_cast(atoi(row[124])) : 0; + e.deities0 = row[125] ? static_cast(atoi(row[125])) : 0; + e.deities1 = row[126] ? static_cast(atoi(row[126])) : 0; + e.deities2 = row[127] ? static_cast(atoi(row[127])) : 0; + e.deities3 = row[128] ? static_cast(atoi(row[128])) : 0; + e.deities4 = row[129] ? static_cast(atoi(row[129])) : 0; + e.deities5 = row[130] ? static_cast(atoi(row[130])) : 0; + e.deities6 = row[131] ? static_cast(atoi(row[131])) : 0; + e.deities7 = row[132] ? static_cast(atoi(row[132])) : 0; + e.deities8 = row[133] ? static_cast(atoi(row[133])) : 0; + e.deities9 = row[134] ? static_cast(atoi(row[134])) : 0; + e.deities10 = row[135] ? static_cast(atoi(row[135])) : 0; + e.deities11 = row[136] ? static_cast(atoi(row[136])) : 0; + e.deities12 = row[137] ? static_cast(atoi(row[137])) : 0; + e.deities13 = row[138] ? static_cast(atoi(row[138])) : 0; + e.deities14 = row[139] ? static_cast(atoi(row[139])) : 0; + e.deities15 = row[140] ? static_cast(atoi(row[140])) : 0; + e.deities16 = row[141] ? static_cast(atoi(row[141])) : 0; + e.field142 = row[142] ? static_cast(atoi(row[142])) : 100; + e.field143 = row[143] ? static_cast(atoi(row[143])) : 0; + e.new_icon = row[144] ? static_cast(atoi(row[144])) : 161; + e.spellanim = row[145] ? static_cast(atoi(row[145])) : 0; + e.uninterruptable = row[146] ? static_cast(atoi(row[146])) : 0; + e.ResistDiff = row[147] ? static_cast(atoi(row[147])) : -150; + e.dot_stacking_exempt = row[148] ? static_cast(atoi(row[148])) : 0; + e.deleteable = row[149] ? static_cast(atoi(row[149])) : 0; + e.RecourseLink = row[150] ? static_cast(atoi(row[150])) : 0; + e.no_partial_resist = row[151] ? static_cast(atoi(row[151])) : 0; + e.field152 = row[152] ? static_cast(atoi(row[152])) : 0; + e.field153 = row[153] ? static_cast(atoi(row[153])) : 0; + e.short_buff_box = row[154] ? static_cast(atoi(row[154])) : -1; + e.descnum = row[155] ? static_cast(atoi(row[155])) : 0; + e.typedescnum = row[156] ? static_cast(atoi(row[156])) : 0; + e.effectdescnum = row[157] ? static_cast(atoi(row[157])) : 0; + e.effectdescnum2 = row[158] ? static_cast(atoi(row[158])) : 0; + e.npc_no_los = row[159] ? static_cast(atoi(row[159])) : 0; + e.field160 = row[160] ? static_cast(atoi(row[160])) : 0; + e.reflectable = row[161] ? static_cast(atoi(row[161])) : 0; + e.bonushate = row[162] ? static_cast(atoi(row[162])) : 0; + e.field163 = row[163] ? static_cast(atoi(row[163])) : 100; + e.field164 = row[164] ? static_cast(atoi(row[164])) : -150; + e.ldon_trap = row[165] ? static_cast(atoi(row[165])) : 0; + e.EndurCost = row[166] ? static_cast(atoi(row[166])) : 0; + e.EndurTimerIndex = row[167] ? static_cast(atoi(row[167])) : 0; + e.IsDiscipline = row[168] ? static_cast(atoi(row[168])) : 0; + e.field169 = row[169] ? static_cast(atoi(row[169])) : 0; + e.field170 = row[170] ? static_cast(atoi(row[170])) : 0; + e.field171 = row[171] ? static_cast(atoi(row[171])) : 0; + e.field172 = row[172] ? static_cast(atoi(row[172])) : 0; + e.HateAdded = row[173] ? static_cast(atoi(row[173])) : 0; + e.EndurUpkeep = row[174] ? static_cast(atoi(row[174])) : 0; + e.numhitstype = row[175] ? static_cast(atoi(row[175])) : 0; + e.numhits = row[176] ? static_cast(atoi(row[176])) : 0; + e.pvpresistbase = row[177] ? static_cast(atoi(row[177])) : -150; + e.pvpresistcalc = row[178] ? static_cast(atoi(row[178])) : 100; + e.pvpresistcap = row[179] ? static_cast(atoi(row[179])) : -150; + e.spell_category = row[180] ? static_cast(atoi(row[180])) : -99; + e.pvp_duration = row[181] ? static_cast(atoi(row[181])) : 0; + e.pvp_duration_cap = row[182] ? static_cast(atoi(row[182])) : 0; + e.pcnpc_only_flag = row[183] ? static_cast(atoi(row[183])) : 0; + e.cast_not_standing = row[184] ? static_cast(atoi(row[184])) : 0; + e.can_mgb = row[185] ? static_cast(atoi(row[185])) : 0; + e.nodispell = row[186] ? static_cast(atoi(row[186])) : -1; + e.npc_category = row[187] ? static_cast(atoi(row[187])) : 0; + e.npc_usefulness = row[188] ? static_cast(atoi(row[188])) : 0; + e.MinResist = row[189] ? static_cast(atoi(row[189])) : 0; + e.MaxResist = row[190] ? static_cast(atoi(row[190])) : 0; + e.viral_targets = row[191] ? static_cast(atoi(row[191])) : 0; + e.viral_timer = row[192] ? static_cast(atoi(row[192])) : 0; + e.nimbuseffect = row[193] ? static_cast(atoi(row[193])) : 0; + e.ConeStartAngle = row[194] ? static_cast(atoi(row[194])) : 0; + e.ConeStopAngle = row[195] ? static_cast(atoi(row[195])) : 0; + e.sneaking = row[196] ? static_cast(atoi(row[196])) : 0; + e.not_extendable = row[197] ? static_cast(atoi(row[197])) : 0; + e.field198 = row[198] ? static_cast(atoi(row[198])) : 0; + e.field199 = row[199] ? static_cast(atoi(row[199])) : 1; + e.suspendable = row[200] ? static_cast(atoi(row[200])) : 0; + e.viral_range = row[201] ? static_cast(atoi(row[201])) : 0; + e.songcap = row[202] ? static_cast(atoi(row[202])) : 0; + e.field203 = row[203] ? static_cast(atoi(row[203])) : 0; + e.field204 = row[204] ? static_cast(atoi(row[204])) : 0; + e.no_block = row[205] ? static_cast(atoi(row[205])) : 0; + e.field206 = row[206] ? static_cast(atoi(row[206])) : -1; + e.spellgroup = row[207] ? static_cast(atoi(row[207])) : 0; + e.rank_ = row[208] ? static_cast(atoi(row[208])) : 0; + e.field209 = row[209] ? static_cast(atoi(row[209])) : 0; + e.field210 = row[210] ? static_cast(atoi(row[210])) : 1; + e.CastRestriction = row[211] ? static_cast(atoi(row[211])) : 0; + e.allowrest = row[212] ? static_cast(atoi(row[212])) : 0; + e.InCombat = row[213] ? static_cast(atoi(row[213])) : 0; + e.OutofCombat = row[214] ? static_cast(atoi(row[214])) : 0; + e.field215 = row[215] ? static_cast(atoi(row[215])) : 0; + e.field216 = row[216] ? static_cast(atoi(row[216])) : 0; + e.field217 = row[217] ? static_cast(atoi(row[217])) : 0; + e.aemaxtargets = row[218] ? static_cast(atoi(row[218])) : 0; + e.maxtargets = row[219] ? static_cast(atoi(row[219])) : 0; + e.field220 = row[220] ? static_cast(atoi(row[220])) : 0; + e.field221 = row[221] ? static_cast(atoi(row[221])) : 0; + e.field222 = row[222] ? static_cast(atoi(row[222])) : 0; + e.field223 = row[223] ? static_cast(atoi(row[223])) : 0; + e.persistdeath = row[224] ? static_cast(atoi(row[224])) : 0; + e.field225 = row[225] ? static_cast(atoi(row[225])) : 0; + e.field226 = row[226] ? static_cast(atoi(row[226])) : 0; + e.min_dist = row[227] ? strtof(row[227], nullptr) : 0; + e.min_dist_mod = row[228] ? strtof(row[228], nullptr) : 0; + e.max_dist = row[229] ? strtof(row[229], nullptr) : 0; + e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0; + e.min_range = row[231] ? static_cast(atoi(row[231])) : 0; + e.field232 = row[232] ? static_cast(atoi(row[232])) : 0; + e.field233 = row[233] ? static_cast(atoi(row[233])) : 0; + e.field234 = row[234] ? static_cast(atoi(row[234])) : 0; + e.field235 = row[235] ? static_cast(atoi(row[235])) : 0; + e.field236 = row[236] ? static_cast(atoi(row[236])) : 0; all_entries.push_back(e); } @@ -2384,243 +2384,243 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpellsNew e{}; - e.id = row[0] ? static_cast(atoi(row[0])) : 0; - e.name = row[1] ? row[1] : ""; - e.player_1 = row[2] ? row[2] : "BLUE_TRAIL"; - e.teleport_zone = row[3] ? row[3] : ""; - e.you_cast = row[4] ? row[4] : ""; - e.other_casts = row[5] ? row[5] : ""; - e.cast_on_you = row[6] ? row[6] : ""; - e.cast_on_other = row[7] ? row[7] : ""; - e.spell_fades = row[8] ? row[8] : ""; - e.range_ = row[9] ? static_cast(atoi(row[9])) : 100; - e.aoerange = row[10] ? static_cast(atoi(row[10])) : 0; - e.pushback = row[11] ? static_cast(atoi(row[11])) : 0; - e.pushup = row[12] ? static_cast(atoi(row[12])) : 0; - e.cast_time = row[13] ? static_cast(atoi(row[13])) : 0; - e.recovery_time = row[14] ? static_cast(atoi(row[14])) : 0; - e.recast_time = row[15] ? static_cast(atoi(row[15])) : 0; - e.buffdurationformula = row[16] ? static_cast(atoi(row[16])) : 7; - e.buffduration = row[17] ? static_cast(atoi(row[17])) : 65; - e.AEDuration = row[18] ? static_cast(atoi(row[18])) : 0; - e.mana = row[19] ? static_cast(atoi(row[19])) : 0; - e.effect_base_value1 = row[20] ? static_cast(atoi(row[20])) : 100; - e.effect_base_value2 = row[21] ? static_cast(atoi(row[21])) : 0; - e.effect_base_value3 = row[22] ? static_cast(atoi(row[22])) : 0; - e.effect_base_value4 = row[23] ? static_cast(atoi(row[23])) : 0; - e.effect_base_value5 = row[24] ? static_cast(atoi(row[24])) : 0; - e.effect_base_value6 = row[25] ? static_cast(atoi(row[25])) : 0; - e.effect_base_value7 = row[26] ? static_cast(atoi(row[26])) : 0; - e.effect_base_value8 = row[27] ? static_cast(atoi(row[27])) : 0; - e.effect_base_value9 = row[28] ? static_cast(atoi(row[28])) : 0; - e.effect_base_value10 = row[29] ? static_cast(atoi(row[29])) : 0; - e.effect_base_value11 = row[30] ? static_cast(atoi(row[30])) : 0; - e.effect_base_value12 = row[31] ? static_cast(atoi(row[31])) : 0; - e.effect_limit_value1 = row[32] ? static_cast(atoi(row[32])) : 0; - e.effect_limit_value2 = row[33] ? static_cast(atoi(row[33])) : 0; - e.effect_limit_value3 = row[34] ? static_cast(atoi(row[34])) : 0; - e.effect_limit_value4 = row[35] ? static_cast(atoi(row[35])) : 0; - e.effect_limit_value5 = row[36] ? static_cast(atoi(row[36])) : 0; - e.effect_limit_value6 = row[37] ? static_cast(atoi(row[37])) : 0; - e.effect_limit_value7 = row[38] ? static_cast(atoi(row[38])) : 0; - e.effect_limit_value8 = row[39] ? static_cast(atoi(row[39])) : 0; - e.effect_limit_value9 = row[40] ? static_cast(atoi(row[40])) : 0; - e.effect_limit_value10 = row[41] ? static_cast(atoi(row[41])) : 0; - e.effect_limit_value11 = row[42] ? static_cast(atoi(row[42])) : 0; - e.effect_limit_value12 = row[43] ? static_cast(atoi(row[43])) : 0; - e.max1 = row[44] ? static_cast(atoi(row[44])) : 0; - e.max2 = row[45] ? static_cast(atoi(row[45])) : 0; - e.max3 = row[46] ? static_cast(atoi(row[46])) : 0; - e.max4 = row[47] ? static_cast(atoi(row[47])) : 0; - e.max5 = row[48] ? static_cast(atoi(row[48])) : 0; - e.max6 = row[49] ? static_cast(atoi(row[49])) : 0; - e.max7 = row[50] ? static_cast(atoi(row[50])) : 0; - e.max8 = row[51] ? static_cast(atoi(row[51])) : 0; - e.max9 = row[52] ? static_cast(atoi(row[52])) : 0; - e.max10 = row[53] ? static_cast(atoi(row[53])) : 0; - e.max11 = row[54] ? static_cast(atoi(row[54])) : 0; - e.max12 = row[55] ? static_cast(atoi(row[55])) : 0; - e.icon = row[56] ? static_cast(atoi(row[56])) : 0; - e.memicon = row[57] ? static_cast(atoi(row[57])) : 0; - e.components1 = row[58] ? static_cast(atoi(row[58])) : -1; - e.components2 = row[59] ? static_cast(atoi(row[59])) : -1; - e.components3 = row[60] ? static_cast(atoi(row[60])) : -1; - e.components4 = row[61] ? static_cast(atoi(row[61])) : -1; - e.component_counts1 = row[62] ? static_cast(atoi(row[62])) : 1; - e.component_counts2 = row[63] ? static_cast(atoi(row[63])) : 1; - e.component_counts3 = row[64] ? static_cast(atoi(row[64])) : 1; - e.component_counts4 = row[65] ? static_cast(atoi(row[65])) : 1; - e.NoexpendReagent1 = row[66] ? static_cast(atoi(row[66])) : -1; - e.NoexpendReagent2 = row[67] ? static_cast(atoi(row[67])) : -1; - e.NoexpendReagent3 = row[68] ? static_cast(atoi(row[68])) : -1; - e.NoexpendReagent4 = row[69] ? static_cast(atoi(row[69])) : -1; - e.formula1 = row[70] ? static_cast(atoi(row[70])) : 100; - e.formula2 = row[71] ? static_cast(atoi(row[71])) : 100; - e.formula3 = row[72] ? static_cast(atoi(row[72])) : 100; - e.formula4 = row[73] ? static_cast(atoi(row[73])) : 100; - e.formula5 = row[74] ? static_cast(atoi(row[74])) : 100; - e.formula6 = row[75] ? static_cast(atoi(row[75])) : 100; - e.formula7 = row[76] ? static_cast(atoi(row[76])) : 100; - e.formula8 = row[77] ? static_cast(atoi(row[77])) : 100; - e.formula9 = row[78] ? static_cast(atoi(row[78])) : 100; - e.formula10 = row[79] ? static_cast(atoi(row[79])) : 100; - e.formula11 = row[80] ? static_cast(atoi(row[80])) : 100; - e.formula12 = row[81] ? static_cast(atoi(row[81])) : 100; - e.LightType = row[82] ? static_cast(atoi(row[82])) : 0; - e.goodEffect = row[83] ? static_cast(atoi(row[83])) : 0; - e.Activated = row[84] ? static_cast(atoi(row[84])) : 0; - e.resisttype = row[85] ? static_cast(atoi(row[85])) : 0; - e.effectid1 = row[86] ? static_cast(atoi(row[86])) : 254; - e.effectid2 = row[87] ? static_cast(atoi(row[87])) : 254; - e.effectid3 = row[88] ? static_cast(atoi(row[88])) : 254; - e.effectid4 = row[89] ? static_cast(atoi(row[89])) : 254; - e.effectid5 = row[90] ? static_cast(atoi(row[90])) : 254; - e.effectid6 = row[91] ? static_cast(atoi(row[91])) : 254; - e.effectid7 = row[92] ? static_cast(atoi(row[92])) : 254; - e.effectid8 = row[93] ? static_cast(atoi(row[93])) : 254; - e.effectid9 = row[94] ? static_cast(atoi(row[94])) : 254; - e.effectid10 = row[95] ? static_cast(atoi(row[95])) : 254; - e.effectid11 = row[96] ? static_cast(atoi(row[96])) : 254; - e.effectid12 = row[97] ? static_cast(atoi(row[97])) : 254; - e.targettype = row[98] ? static_cast(atoi(row[98])) : 2; - e.basediff = row[99] ? static_cast(atoi(row[99])) : 0; - e.skill = row[100] ? static_cast(atoi(row[100])) : 98; - e.zonetype = row[101] ? static_cast(atoi(row[101])) : -1; - e.EnvironmentType = row[102] ? static_cast(atoi(row[102])) : 0; - e.TimeOfDay = row[103] ? static_cast(atoi(row[103])) : 0; - e.classes1 = row[104] ? static_cast(atoi(row[104])) : 255; - e.classes2 = row[105] ? static_cast(atoi(row[105])) : 255; - e.classes3 = row[106] ? static_cast(atoi(row[106])) : 255; - e.classes4 = row[107] ? static_cast(atoi(row[107])) : 255; - e.classes5 = row[108] ? static_cast(atoi(row[108])) : 255; - e.classes6 = row[109] ? static_cast(atoi(row[109])) : 255; - e.classes7 = row[110] ? static_cast(atoi(row[110])) : 255; - e.classes8 = row[111] ? static_cast(atoi(row[111])) : 255; - e.classes9 = row[112] ? static_cast(atoi(row[112])) : 255; - e.classes10 = row[113] ? static_cast(atoi(row[113])) : 255; - e.classes11 = row[114] ? static_cast(atoi(row[114])) : 255; - e.classes12 = row[115] ? static_cast(atoi(row[115])) : 255; - e.classes13 = row[116] ? static_cast(atoi(row[116])) : 255; - e.classes14 = row[117] ? static_cast(atoi(row[117])) : 255; - e.classes15 = row[118] ? static_cast(atoi(row[118])) : 255; - e.classes16 = row[119] ? static_cast(atoi(row[119])) : 255; - e.CastingAnim = row[120] ? static_cast(atoi(row[120])) : 44; - e.TargetAnim = row[121] ? static_cast(atoi(row[121])) : 13; - e.TravelType = row[122] ? static_cast(atoi(row[122])) : 0; - e.SpellAffectIndex = row[123] ? static_cast(atoi(row[123])) : -1; - e.disallow_sit = row[124] ? static_cast(atoi(row[124])) : 0; - e.deities0 = row[125] ? static_cast(atoi(row[125])) : 0; - e.deities1 = row[126] ? static_cast(atoi(row[126])) : 0; - e.deities2 = row[127] ? static_cast(atoi(row[127])) : 0; - e.deities3 = row[128] ? static_cast(atoi(row[128])) : 0; - e.deities4 = row[129] ? static_cast(atoi(row[129])) : 0; - e.deities5 = row[130] ? static_cast(atoi(row[130])) : 0; - e.deities6 = row[131] ? static_cast(atoi(row[131])) : 0; - e.deities7 = row[132] ? static_cast(atoi(row[132])) : 0; - e.deities8 = row[133] ? static_cast(atoi(row[133])) : 0; - e.deities9 = row[134] ? static_cast(atoi(row[134])) : 0; - e.deities10 = row[135] ? static_cast(atoi(row[135])) : 0; - e.deities11 = row[136] ? static_cast(atoi(row[136])) : 0; - e.deities12 = row[137] ? static_cast(atoi(row[137])) : 0; - e.deities13 = row[138] ? static_cast(atoi(row[138])) : 0; - e.deities14 = row[139] ? static_cast(atoi(row[139])) : 0; - e.deities15 = row[140] ? static_cast(atoi(row[140])) : 0; - e.deities16 = row[141] ? static_cast(atoi(row[141])) : 0; - e.field142 = row[142] ? static_cast(atoi(row[142])) : 100; - e.field143 = row[143] ? static_cast(atoi(row[143])) : 0; - e.new_icon = row[144] ? static_cast(atoi(row[144])) : 161; - e.spellanim = row[145] ? static_cast(atoi(row[145])) : 0; - e.uninterruptable = row[146] ? static_cast(atoi(row[146])) : 0; - e.ResistDiff = row[147] ? static_cast(atoi(row[147])) : -150; - e.dot_stacking_exempt = row[148] ? static_cast(atoi(row[148])) : 0; - e.deleteable = row[149] ? static_cast(atoi(row[149])) : 0; - e.RecourseLink = row[150] ? static_cast(atoi(row[150])) : 0; - e.no_partial_resist = row[151] ? static_cast(atoi(row[151])) : 0; - e.field152 = row[152] ? static_cast(atoi(row[152])) : 0; - e.field153 = row[153] ? static_cast(atoi(row[153])) : 0; - e.short_buff_box = row[154] ? static_cast(atoi(row[154])) : -1; - e.descnum = row[155] ? static_cast(atoi(row[155])) : 0; - e.typedescnum = row[156] ? static_cast(atoi(row[156])) : 0; - e.effectdescnum = row[157] ? static_cast(atoi(row[157])) : 0; - e.effectdescnum2 = row[158] ? static_cast(atoi(row[158])) : 0; - e.npc_no_los = row[159] ? static_cast(atoi(row[159])) : 0; - e.feedbackable = row[160] ? static_cast(atoi(row[160])) : 0; - e.reflectable = row[161] ? static_cast(atoi(row[161])) : 0; - e.bonushate = row[162] ? static_cast(atoi(row[162])) : 0; - e.field163 = row[163] ? static_cast(atoi(row[163])) : 100; - e.field164 = row[164] ? static_cast(atoi(row[164])) : -150; - e.ldon_trap = row[165] ? static_cast(atoi(row[165])) : 0; - e.EndurCost = row[166] ? static_cast(atoi(row[166])) : 0; - e.EndurTimerIndex = row[167] ? static_cast(atoi(row[167])) : 0; - e.IsDiscipline = row[168] ? static_cast(atoi(row[168])) : 0; - e.field169 = row[169] ? static_cast(atoi(row[169])) : 0; - e.field170 = row[170] ? static_cast(atoi(row[170])) : 0; - e.field171 = row[171] ? static_cast(atoi(row[171])) : 0; - e.field172 = row[172] ? static_cast(atoi(row[172])) : 0; - e.HateAdded = row[173] ? static_cast(atoi(row[173])) : 0; - e.EndurUpkeep = row[174] ? static_cast(atoi(row[174])) : 0; - e.numhitstype = row[175] ? static_cast(atoi(row[175])) : 0; - e.numhits = row[176] ? static_cast(atoi(row[176])) : 0; - e.pvpresistbase = row[177] ? static_cast(atoi(row[177])) : -150; - e.pvpresistcalc = row[178] ? static_cast(atoi(row[178])) : 100; - e.pvpresistcap = row[179] ? static_cast(atoi(row[179])) : -150; - e.spell_category = row[180] ? static_cast(atoi(row[180])) : -99; - e.pvp_duration = row[181] ? static_cast(atoi(row[181])) : 0; - e.pvp_duration_cap = row[182] ? static_cast(atoi(row[182])) : 0; - e.pcnpc_only_flag = row[183] ? static_cast(atoi(row[183])) : 0; - e.cast_not_standing = row[184] ? static_cast(atoi(row[184])) : 0; - e.can_mgb = row[185] ? static_cast(atoi(row[185])) : 0; - e.nodispell = row[186] ? static_cast(atoi(row[186])) : -1; - e.npc_category = row[187] ? static_cast(atoi(row[187])) : 0; - e.npc_usefulness = row[188] ? static_cast(atoi(row[188])) : 0; - e.MinResist = row[189] ? static_cast(atoi(row[189])) : 0; - e.MaxResist = row[190] ? static_cast(atoi(row[190])) : 0; - e.viral_targets = row[191] ? static_cast(atoi(row[191])) : 0; - e.viral_timer = row[192] ? static_cast(atoi(row[192])) : 0; - e.nimbuseffect = row[193] ? static_cast(atoi(row[193])) : 0; - e.ConeStartAngle = row[194] ? static_cast(atoi(row[194])) : 0; - e.ConeStopAngle = row[195] ? static_cast(atoi(row[195])) : 0; - e.sneaking = row[196] ? static_cast(atoi(row[196])) : 0; - e.not_extendable = row[197] ? static_cast(atoi(row[197])) : 0; - e.no_detrimental_spell_aggro = row[198] ? static_cast(atoi(row[198])) : 0; - e.field199 = row[199] ? static_cast(atoi(row[199])) : 1; - e.suspendable = row[200] ? static_cast(atoi(row[200])) : 0; - e.viral_range = row[201] ? static_cast(atoi(row[201])) : 0; - e.songcap = row[202] ? static_cast(atoi(row[202])) : 0; - e.field203 = row[203] ? static_cast(atoi(row[203])) : 0; - e.field204 = row[204] ? static_cast(atoi(row[204])) : 0; - e.no_block = row[205] ? static_cast(atoi(row[205])) : 0; - e.field206 = row[206] ? static_cast(atoi(row[206])) : -1; - e.spellgroup = row[207] ? static_cast(atoi(row[207])) : 0; - e.rank_ = row[208] ? static_cast(atoi(row[208])) : 0; - e.no_resist = row[209] ? static_cast(atoi(row[209])) : 0; - e.field210 = row[210] ? static_cast(atoi(row[210])) : 1; - e.CastRestriction = row[211] ? static_cast(atoi(row[211])) : 0; - e.allowrest = row[212] ? static_cast(atoi(row[212])) : 0; - e.InCombat = row[213] ? static_cast(atoi(row[213])) : 0; - e.OutofCombat = row[214] ? static_cast(atoi(row[214])) : 0; - e.field215 = row[215] ? static_cast(atoi(row[215])) : 0; - e.field216 = row[216] ? static_cast(atoi(row[216])) : 0; - e.override_crit_chance = row[217] ? static_cast(atoi(row[217])) : 0; - e.aemaxtargets = row[218] ? static_cast(atoi(row[218])) : 0; - e.maxtargets = row[219] ? static_cast(atoi(row[219])) : 0; - e.no_heal_damage_item_mod = row[220] ? static_cast(atoi(row[220])) : 0; - e.caster_requirement_id = row[221] ? static_cast(atoi(row[221])) : 0; - e.spell_class = row[222] ? static_cast(atoi(row[222])) : 0; - e.spell_subclass = row[223] ? static_cast(atoi(row[223])) : 0; - e.persistdeath = row[224] ? static_cast(atoi(row[224])) : 0; - e.field225 = row[225] ? static_cast(atoi(row[225])) : 0; - e.field226 = row[226] ? static_cast(atoi(row[226])) : 0; - e.min_dist = row[227] ? strtof(row[227], nullptr) : 0; - e.min_dist_mod = row[228] ? strtof(row[228], nullptr) : 0; - e.max_dist = row[229] ? strtof(row[229], nullptr) : 0; - e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0; - e.min_range = row[231] ? static_cast(atoi(row[231])) : 0; - e.no_remove = row[232] ? static_cast(atoi(row[232])) : 0; - e.field233 = row[233] ? static_cast(atoi(row[233])) : 0; - e.field234 = row[234] ? static_cast(atoi(row[234])) : 0; - e.field235 = row[235] ? static_cast(atoi(row[235])) : 0; - e.field236 = row[236] ? static_cast(atoi(row[236])) : 0; + e.id = row[0] ? static_cast(atoi(row[0])) : 0; + e.name = row[1] ? row[1] : ""; + e.player_1 = row[2] ? row[2] : "BLUE_TRAIL"; + e.teleport_zone = row[3] ? row[3] : ""; + e.you_cast = row[4] ? row[4] : ""; + e.other_casts = row[5] ? row[5] : ""; + e.cast_on_you = row[6] ? row[6] : ""; + e.cast_on_other = row[7] ? row[7] : ""; + e.spell_fades = row[8] ? row[8] : ""; + e.range_ = row[9] ? static_cast(atoi(row[9])) : 100; + e.aoerange = row[10] ? static_cast(atoi(row[10])) : 0; + e.pushback = row[11] ? static_cast(atoi(row[11])) : 0; + e.pushup = row[12] ? static_cast(atoi(row[12])) : 0; + e.cast_time = row[13] ? static_cast(atoi(row[13])) : 0; + e.recovery_time = row[14] ? static_cast(atoi(row[14])) : 0; + e.recast_time = row[15] ? static_cast(atoi(row[15])) : 0; + e.buffdurationformula = row[16] ? static_cast(atoi(row[16])) : 7; + e.buffduration = row[17] ? static_cast(atoi(row[17])) : 65; + e.AEDuration = row[18] ? static_cast(atoi(row[18])) : 0; + e.mana = row[19] ? static_cast(atoi(row[19])) : 0; + e.effect_base_value1 = row[20] ? static_cast(atoi(row[20])) : 100; + e.effect_base_value2 = row[21] ? static_cast(atoi(row[21])) : 0; + e.effect_base_value3 = row[22] ? static_cast(atoi(row[22])) : 0; + e.effect_base_value4 = row[23] ? static_cast(atoi(row[23])) : 0; + e.effect_base_value5 = row[24] ? static_cast(atoi(row[24])) : 0; + e.effect_base_value6 = row[25] ? static_cast(atoi(row[25])) : 0; + e.effect_base_value7 = row[26] ? static_cast(atoi(row[26])) : 0; + e.effect_base_value8 = row[27] ? static_cast(atoi(row[27])) : 0; + e.effect_base_value9 = row[28] ? static_cast(atoi(row[28])) : 0; + e.effect_base_value10 = row[29] ? static_cast(atoi(row[29])) : 0; + e.effect_base_value11 = row[30] ? static_cast(atoi(row[30])) : 0; + e.effect_base_value12 = row[31] ? static_cast(atoi(row[31])) : 0; + e.effect_limit_value1 = row[32] ? static_cast(atoi(row[32])) : 0; + e.effect_limit_value2 = row[33] ? static_cast(atoi(row[33])) : 0; + e.effect_limit_value3 = row[34] ? static_cast(atoi(row[34])) : 0; + e.effect_limit_value4 = row[35] ? static_cast(atoi(row[35])) : 0; + e.effect_limit_value5 = row[36] ? static_cast(atoi(row[36])) : 0; + e.effect_limit_value6 = row[37] ? static_cast(atoi(row[37])) : 0; + e.effect_limit_value7 = row[38] ? static_cast(atoi(row[38])) : 0; + e.effect_limit_value8 = row[39] ? static_cast(atoi(row[39])) : 0; + e.effect_limit_value9 = row[40] ? static_cast(atoi(row[40])) : 0; + e.effect_limit_value10 = row[41] ? static_cast(atoi(row[41])) : 0; + e.effect_limit_value11 = row[42] ? static_cast(atoi(row[42])) : 0; + e.effect_limit_value12 = row[43] ? static_cast(atoi(row[43])) : 0; + e.max1 = row[44] ? static_cast(atoi(row[44])) : 0; + e.max2 = row[45] ? static_cast(atoi(row[45])) : 0; + e.max3 = row[46] ? static_cast(atoi(row[46])) : 0; + e.max4 = row[47] ? static_cast(atoi(row[47])) : 0; + e.max5 = row[48] ? static_cast(atoi(row[48])) : 0; + e.max6 = row[49] ? static_cast(atoi(row[49])) : 0; + e.max7 = row[50] ? static_cast(atoi(row[50])) : 0; + e.max8 = row[51] ? static_cast(atoi(row[51])) : 0; + e.max9 = row[52] ? static_cast(atoi(row[52])) : 0; + e.max10 = row[53] ? static_cast(atoi(row[53])) : 0; + e.max11 = row[54] ? static_cast(atoi(row[54])) : 0; + e.max12 = row[55] ? static_cast(atoi(row[55])) : 0; + e.icon = row[56] ? static_cast(atoi(row[56])) : 0; + e.memicon = row[57] ? static_cast(atoi(row[57])) : 0; + e.components1 = row[58] ? static_cast(atoi(row[58])) : -1; + e.components2 = row[59] ? static_cast(atoi(row[59])) : -1; + e.components3 = row[60] ? static_cast(atoi(row[60])) : -1; + e.components4 = row[61] ? static_cast(atoi(row[61])) : -1; + e.component_counts1 = row[62] ? static_cast(atoi(row[62])) : 1; + e.component_counts2 = row[63] ? static_cast(atoi(row[63])) : 1; + e.component_counts3 = row[64] ? static_cast(atoi(row[64])) : 1; + e.component_counts4 = row[65] ? static_cast(atoi(row[65])) : 1; + e.NoexpendReagent1 = row[66] ? static_cast(atoi(row[66])) : -1; + e.NoexpendReagent2 = row[67] ? static_cast(atoi(row[67])) : -1; + e.NoexpendReagent3 = row[68] ? static_cast(atoi(row[68])) : -1; + e.NoexpendReagent4 = row[69] ? static_cast(atoi(row[69])) : -1; + e.formula1 = row[70] ? static_cast(atoi(row[70])) : 100; + e.formula2 = row[71] ? static_cast(atoi(row[71])) : 100; + e.formula3 = row[72] ? static_cast(atoi(row[72])) : 100; + e.formula4 = row[73] ? static_cast(atoi(row[73])) : 100; + e.formula5 = row[74] ? static_cast(atoi(row[74])) : 100; + e.formula6 = row[75] ? static_cast(atoi(row[75])) : 100; + e.formula7 = row[76] ? static_cast(atoi(row[76])) : 100; + e.formula8 = row[77] ? static_cast(atoi(row[77])) : 100; + e.formula9 = row[78] ? static_cast(atoi(row[78])) : 100; + e.formula10 = row[79] ? static_cast(atoi(row[79])) : 100; + e.formula11 = row[80] ? static_cast(atoi(row[80])) : 100; + e.formula12 = row[81] ? static_cast(atoi(row[81])) : 100; + e.LightType = row[82] ? static_cast(atoi(row[82])) : 0; + e.goodEffect = row[83] ? static_cast(atoi(row[83])) : 0; + e.Activated = row[84] ? static_cast(atoi(row[84])) : 0; + e.resisttype = row[85] ? static_cast(atoi(row[85])) : 0; + e.effectid1 = row[86] ? static_cast(atoi(row[86])) : 254; + e.effectid2 = row[87] ? static_cast(atoi(row[87])) : 254; + e.effectid3 = row[88] ? static_cast(atoi(row[88])) : 254; + e.effectid4 = row[89] ? static_cast(atoi(row[89])) : 254; + e.effectid5 = row[90] ? static_cast(atoi(row[90])) : 254; + e.effectid6 = row[91] ? static_cast(atoi(row[91])) : 254; + e.effectid7 = row[92] ? static_cast(atoi(row[92])) : 254; + e.effectid8 = row[93] ? static_cast(atoi(row[93])) : 254; + e.effectid9 = row[94] ? static_cast(atoi(row[94])) : 254; + e.effectid10 = row[95] ? static_cast(atoi(row[95])) : 254; + e.effectid11 = row[96] ? static_cast(atoi(row[96])) : 254; + e.effectid12 = row[97] ? static_cast(atoi(row[97])) : 254; + e.targettype = row[98] ? static_cast(atoi(row[98])) : 2; + e.basediff = row[99] ? static_cast(atoi(row[99])) : 0; + e.skill = row[100] ? static_cast(atoi(row[100])) : 98; + e.zonetype = row[101] ? static_cast(atoi(row[101])) : -1; + e.EnvironmentType = row[102] ? static_cast(atoi(row[102])) : 0; + e.TimeOfDay = row[103] ? static_cast(atoi(row[103])) : 0; + e.classes1 = row[104] ? static_cast(atoi(row[104])) : 255; + e.classes2 = row[105] ? static_cast(atoi(row[105])) : 255; + e.classes3 = row[106] ? static_cast(atoi(row[106])) : 255; + e.classes4 = row[107] ? static_cast(atoi(row[107])) : 255; + e.classes5 = row[108] ? static_cast(atoi(row[108])) : 255; + e.classes6 = row[109] ? static_cast(atoi(row[109])) : 255; + e.classes7 = row[110] ? static_cast(atoi(row[110])) : 255; + e.classes8 = row[111] ? static_cast(atoi(row[111])) : 255; + e.classes9 = row[112] ? static_cast(atoi(row[112])) : 255; + e.classes10 = row[113] ? static_cast(atoi(row[113])) : 255; + e.classes11 = row[114] ? static_cast(atoi(row[114])) : 255; + e.classes12 = row[115] ? static_cast(atoi(row[115])) : 255; + e.classes13 = row[116] ? static_cast(atoi(row[116])) : 255; + e.classes14 = row[117] ? static_cast(atoi(row[117])) : 255; + e.classes15 = row[118] ? static_cast(atoi(row[118])) : 255; + e.classes16 = row[119] ? static_cast(atoi(row[119])) : 255; + e.CastingAnim = row[120] ? static_cast(atoi(row[120])) : 44; + e.TargetAnim = row[121] ? static_cast(atoi(row[121])) : 13; + e.TravelType = row[122] ? static_cast(atoi(row[122])) : 0; + e.SpellAffectIndex = row[123] ? static_cast(atoi(row[123])) : -1; + e.disallow_sit = row[124] ? static_cast(atoi(row[124])) : 0; + e.deities0 = row[125] ? static_cast(atoi(row[125])) : 0; + e.deities1 = row[126] ? static_cast(atoi(row[126])) : 0; + e.deities2 = row[127] ? static_cast(atoi(row[127])) : 0; + e.deities3 = row[128] ? static_cast(atoi(row[128])) : 0; + e.deities4 = row[129] ? static_cast(atoi(row[129])) : 0; + e.deities5 = row[130] ? static_cast(atoi(row[130])) : 0; + e.deities6 = row[131] ? static_cast(atoi(row[131])) : 0; + e.deities7 = row[132] ? static_cast(atoi(row[132])) : 0; + e.deities8 = row[133] ? static_cast(atoi(row[133])) : 0; + e.deities9 = row[134] ? static_cast(atoi(row[134])) : 0; + e.deities10 = row[135] ? static_cast(atoi(row[135])) : 0; + e.deities11 = row[136] ? static_cast(atoi(row[136])) : 0; + e.deities12 = row[137] ? static_cast(atoi(row[137])) : 0; + e.deities13 = row[138] ? static_cast(atoi(row[138])) : 0; + e.deities14 = row[139] ? static_cast(atoi(row[139])) : 0; + e.deities15 = row[140] ? static_cast(atoi(row[140])) : 0; + e.deities16 = row[141] ? static_cast(atoi(row[141])) : 0; + e.field142 = row[142] ? static_cast(atoi(row[142])) : 100; + e.field143 = row[143] ? static_cast(atoi(row[143])) : 0; + e.new_icon = row[144] ? static_cast(atoi(row[144])) : 161; + e.spellanim = row[145] ? static_cast(atoi(row[145])) : 0; + e.uninterruptable = row[146] ? static_cast(atoi(row[146])) : 0; + e.ResistDiff = row[147] ? static_cast(atoi(row[147])) : -150; + e.dot_stacking_exempt = row[148] ? static_cast(atoi(row[148])) : 0; + e.deleteable = row[149] ? static_cast(atoi(row[149])) : 0; + e.RecourseLink = row[150] ? static_cast(atoi(row[150])) : 0; + e.no_partial_resist = row[151] ? static_cast(atoi(row[151])) : 0; + e.field152 = row[152] ? static_cast(atoi(row[152])) : 0; + e.field153 = row[153] ? static_cast(atoi(row[153])) : 0; + e.short_buff_box = row[154] ? static_cast(atoi(row[154])) : -1; + e.descnum = row[155] ? static_cast(atoi(row[155])) : 0; + e.typedescnum = row[156] ? static_cast(atoi(row[156])) : 0; + e.effectdescnum = row[157] ? static_cast(atoi(row[157])) : 0; + e.effectdescnum2 = row[158] ? static_cast(atoi(row[158])) : 0; + e.npc_no_los = row[159] ? static_cast(atoi(row[159])) : 0; + e.field160 = row[160] ? static_cast(atoi(row[160])) : 0; + e.reflectable = row[161] ? static_cast(atoi(row[161])) : 0; + e.bonushate = row[162] ? static_cast(atoi(row[162])) : 0; + e.field163 = row[163] ? static_cast(atoi(row[163])) : 100; + e.field164 = row[164] ? static_cast(atoi(row[164])) : -150; + e.ldon_trap = row[165] ? static_cast(atoi(row[165])) : 0; + e.EndurCost = row[166] ? static_cast(atoi(row[166])) : 0; + e.EndurTimerIndex = row[167] ? static_cast(atoi(row[167])) : 0; + e.IsDiscipline = row[168] ? static_cast(atoi(row[168])) : 0; + e.field169 = row[169] ? static_cast(atoi(row[169])) : 0; + e.field170 = row[170] ? static_cast(atoi(row[170])) : 0; + e.field171 = row[171] ? static_cast(atoi(row[171])) : 0; + e.field172 = row[172] ? static_cast(atoi(row[172])) : 0; + e.HateAdded = row[173] ? static_cast(atoi(row[173])) : 0; + e.EndurUpkeep = row[174] ? static_cast(atoi(row[174])) : 0; + e.numhitstype = row[175] ? static_cast(atoi(row[175])) : 0; + e.numhits = row[176] ? static_cast(atoi(row[176])) : 0; + e.pvpresistbase = row[177] ? static_cast(atoi(row[177])) : -150; + e.pvpresistcalc = row[178] ? static_cast(atoi(row[178])) : 100; + e.pvpresistcap = row[179] ? static_cast(atoi(row[179])) : -150; + e.spell_category = row[180] ? static_cast(atoi(row[180])) : -99; + e.pvp_duration = row[181] ? static_cast(atoi(row[181])) : 0; + e.pvp_duration_cap = row[182] ? static_cast(atoi(row[182])) : 0; + e.pcnpc_only_flag = row[183] ? static_cast(atoi(row[183])) : 0; + e.cast_not_standing = row[184] ? static_cast(atoi(row[184])) : 0; + e.can_mgb = row[185] ? static_cast(atoi(row[185])) : 0; + e.nodispell = row[186] ? static_cast(atoi(row[186])) : -1; + e.npc_category = row[187] ? static_cast(atoi(row[187])) : 0; + e.npc_usefulness = row[188] ? static_cast(atoi(row[188])) : 0; + e.MinResist = row[189] ? static_cast(atoi(row[189])) : 0; + e.MaxResist = row[190] ? static_cast(atoi(row[190])) : 0; + e.viral_targets = row[191] ? static_cast(atoi(row[191])) : 0; + e.viral_timer = row[192] ? static_cast(atoi(row[192])) : 0; + e.nimbuseffect = row[193] ? static_cast(atoi(row[193])) : 0; + e.ConeStartAngle = row[194] ? static_cast(atoi(row[194])) : 0; + e.ConeStopAngle = row[195] ? static_cast(atoi(row[195])) : 0; + e.sneaking = row[196] ? static_cast(atoi(row[196])) : 0; + e.not_extendable = row[197] ? static_cast(atoi(row[197])) : 0; + e.field198 = row[198] ? static_cast(atoi(row[198])) : 0; + e.field199 = row[199] ? static_cast(atoi(row[199])) : 1; + e.suspendable = row[200] ? static_cast(atoi(row[200])) : 0; + e.viral_range = row[201] ? static_cast(atoi(row[201])) : 0; + e.songcap = row[202] ? static_cast(atoi(row[202])) : 0; + e.field203 = row[203] ? static_cast(atoi(row[203])) : 0; + e.field204 = row[204] ? static_cast(atoi(row[204])) : 0; + e.no_block = row[205] ? static_cast(atoi(row[205])) : 0; + e.field206 = row[206] ? static_cast(atoi(row[206])) : -1; + e.spellgroup = row[207] ? static_cast(atoi(row[207])) : 0; + e.rank_ = row[208] ? static_cast(atoi(row[208])) : 0; + e.field209 = row[209] ? static_cast(atoi(row[209])) : 0; + e.field210 = row[210] ? static_cast(atoi(row[210])) : 1; + e.CastRestriction = row[211] ? static_cast(atoi(row[211])) : 0; + e.allowrest = row[212] ? static_cast(atoi(row[212])) : 0; + e.InCombat = row[213] ? static_cast(atoi(row[213])) : 0; + e.OutofCombat = row[214] ? static_cast(atoi(row[214])) : 0; + e.field215 = row[215] ? static_cast(atoi(row[215])) : 0; + e.field216 = row[216] ? static_cast(atoi(row[216])) : 0; + e.field217 = row[217] ? static_cast(atoi(row[217])) : 0; + e.aemaxtargets = row[218] ? static_cast(atoi(row[218])) : 0; + e.maxtargets = row[219] ? static_cast(atoi(row[219])) : 0; + e.field220 = row[220] ? static_cast(atoi(row[220])) : 0; + e.field221 = row[221] ? static_cast(atoi(row[221])) : 0; + e.field222 = row[222] ? static_cast(atoi(row[222])) : 0; + e.field223 = row[223] ? static_cast(atoi(row[223])) : 0; + e.persistdeath = row[224] ? static_cast(atoi(row[224])) : 0; + e.field225 = row[225] ? static_cast(atoi(row[225])) : 0; + e.field226 = row[226] ? static_cast(atoi(row[226])) : 0; + e.min_dist = row[227] ? strtof(row[227], nullptr) : 0; + e.min_dist_mod = row[228] ? strtof(row[228], nullptr) : 0; + e.max_dist = row[229] ? strtof(row[229], nullptr) : 0; + e.max_dist_mod = row[230] ? strtof(row[230], nullptr) : 0; + e.min_range = row[231] ? static_cast(atoi(row[231])) : 0; + e.field232 = row[232] ? static_cast(atoi(row[232])) : 0; + e.field233 = row[233] ? static_cast(atoi(row[233])) : 0; + e.field234 = row[234] ? static_cast(atoi(row[234])) : 0; + e.field235 = row[235] ? static_cast(atoi(row[235])) : 0; + e.field236 = row[236] ? static_cast(atoi(row[236])) : 0; all_entries.push_back(e); } @@ -2855,7 +2855,7 @@ public: v.push_back(std::to_string(e.effectdescnum)); v.push_back(std::to_string(e.effectdescnum2)); v.push_back(std::to_string(e.npc_no_los)); - v.push_back(std::to_string(e.feedbackable)); + v.push_back(std::to_string(e.field160)); v.push_back(std::to_string(e.reflectable)); v.push_back(std::to_string(e.bonushate)); v.push_back(std::to_string(e.field163)); @@ -2893,7 +2893,7 @@ public: v.push_back(std::to_string(e.ConeStopAngle)); v.push_back(std::to_string(e.sneaking)); v.push_back(std::to_string(e.not_extendable)); - v.push_back(std::to_string(e.no_detrimental_spell_aggro)); + v.push_back(std::to_string(e.field198)); v.push_back(std::to_string(e.field199)); v.push_back(std::to_string(e.suspendable)); v.push_back(std::to_string(e.viral_range)); @@ -2904,7 +2904,7 @@ public: v.push_back(std::to_string(e.field206)); v.push_back(std::to_string(e.spellgroup)); v.push_back(std::to_string(e.rank_)); - v.push_back(std::to_string(e.no_resist)); + v.push_back(std::to_string(e.field209)); v.push_back(std::to_string(e.field210)); v.push_back(std::to_string(e.CastRestriction)); v.push_back(std::to_string(e.allowrest)); @@ -2912,13 +2912,13 @@ public: v.push_back(std::to_string(e.OutofCombat)); v.push_back(std::to_string(e.field215)); v.push_back(std::to_string(e.field216)); - v.push_back(std::to_string(e.override_crit_chance)); + v.push_back(std::to_string(e.field217)); v.push_back(std::to_string(e.aemaxtargets)); v.push_back(std::to_string(e.maxtargets)); - v.push_back(std::to_string(e.no_heal_damage_item_mod)); - v.push_back(std::to_string(e.caster_requirement_id)); - v.push_back(std::to_string(e.spell_class)); - v.push_back(std::to_string(e.spell_subclass)); + v.push_back(std::to_string(e.field220)); + v.push_back(std::to_string(e.field221)); + v.push_back(std::to_string(e.field222)); + v.push_back(std::to_string(e.field223)); v.push_back(std::to_string(e.persistdeath)); v.push_back(std::to_string(e.field225)); v.push_back(std::to_string(e.field226)); @@ -2927,7 +2927,7 @@ public: v.push_back(std::to_string(e.max_dist)); v.push_back(std::to_string(e.max_dist_mod)); v.push_back(std::to_string(e.min_range)); - v.push_back(std::to_string(e.no_remove)); + v.push_back(std::to_string(e.field232)); v.push_back(std::to_string(e.field233)); v.push_back(std::to_string(e.field234)); v.push_back(std::to_string(e.field235)); @@ -3114,7 +3114,7 @@ public: v.push_back(std::to_string(e.effectdescnum)); v.push_back(std::to_string(e.effectdescnum2)); v.push_back(std::to_string(e.npc_no_los)); - v.push_back(std::to_string(e.feedbackable)); + v.push_back(std::to_string(e.field160)); v.push_back(std::to_string(e.reflectable)); v.push_back(std::to_string(e.bonushate)); v.push_back(std::to_string(e.field163)); @@ -3152,7 +3152,7 @@ public: v.push_back(std::to_string(e.ConeStopAngle)); v.push_back(std::to_string(e.sneaking)); v.push_back(std::to_string(e.not_extendable)); - v.push_back(std::to_string(e.no_detrimental_spell_aggro)); + v.push_back(std::to_string(e.field198)); v.push_back(std::to_string(e.field199)); v.push_back(std::to_string(e.suspendable)); v.push_back(std::to_string(e.viral_range)); @@ -3163,7 +3163,7 @@ public: v.push_back(std::to_string(e.field206)); v.push_back(std::to_string(e.spellgroup)); v.push_back(std::to_string(e.rank_)); - v.push_back(std::to_string(e.no_resist)); + v.push_back(std::to_string(e.field209)); v.push_back(std::to_string(e.field210)); v.push_back(std::to_string(e.CastRestriction)); v.push_back(std::to_string(e.allowrest)); @@ -3171,13 +3171,13 @@ public: v.push_back(std::to_string(e.OutofCombat)); v.push_back(std::to_string(e.field215)); v.push_back(std::to_string(e.field216)); - v.push_back(std::to_string(e.override_crit_chance)); + v.push_back(std::to_string(e.field217)); v.push_back(std::to_string(e.aemaxtargets)); v.push_back(std::to_string(e.maxtargets)); - v.push_back(std::to_string(e.no_heal_damage_item_mod)); - v.push_back(std::to_string(e.caster_requirement_id)); - v.push_back(std::to_string(e.spell_class)); - v.push_back(std::to_string(e.spell_subclass)); + v.push_back(std::to_string(e.field220)); + v.push_back(std::to_string(e.field221)); + v.push_back(std::to_string(e.field222)); + v.push_back(std::to_string(e.field223)); v.push_back(std::to_string(e.persistdeath)); v.push_back(std::to_string(e.field225)); v.push_back(std::to_string(e.field226)); @@ -3186,7 +3186,7 @@ public: v.push_back(std::to_string(e.max_dist)); v.push_back(std::to_string(e.max_dist_mod)); v.push_back(std::to_string(e.min_range)); - v.push_back(std::to_string(e.no_remove)); + v.push_back(std::to_string(e.field232)); v.push_back(std::to_string(e.field233)); v.push_back(std::to_string(e.field234)); v.push_back(std::to_string(e.field235)); diff --git a/common/repositories/character_data_repository.h b/common/repositories/character_data_repository.h index d95ac2fda..68390fc35 100644 --- a/common/repositories/character_data_repository.h +++ b/common/repositories/character_data_repository.h @@ -191,6 +191,22 @@ public: return character_ids; } + + static uint32_t GetTotalTimePlayed(Database& db, uint32_t account_id) + { + auto query = fmt::format( + "SELECT SUM(time_played) FROM `character_data` WHERE `account_id` = {}", + account_id + ); + + auto results = db.QueryDatabase(query); + if (!results.Success()) { + return 0; + } + + auto row = results.begin(); + return Strings::ToUnsignedInt(row[0]); + } }; #endif //EQEMU_CHARACTER_DATA_REPOSITORY_H diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 89c48daa1..0ef0cbe4e 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -122,66 +122,41 @@ bool SharedDatabase::SetGMFlymode(uint32 account_id, uint8 flymode) return a.id > 0; } -uint32 SharedDatabase::GetTotalTimeEntitledOnAccount(uint32 AccountID) { - uint32 EntitledTime = 0; - const std::string query = StringFormat("SELECT `time_played` FROM `character_data` WHERE `account_id` = %u", AccountID); - auto results = QueryDatabase(query); - for (auto& row = results.begin(); row != results.end(); ++row) { - EntitledTime += Strings::ToUnsignedInt(row[0]); - } - return EntitledTime; -} - -void SharedDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) +void SharedDatabase::SetMailKey(uint32 character_id, uint32 ip_address, uint32 mail_key) { - char mail_key[17]; + std::string full_mail_key; - if (RuleB(Chat, EnableMailKeyIPVerification) == true) { - sprintf(mail_key, "%08X%08X", IPAddress, MailKey); - } - else { - sprintf(mail_key, "%08X", MailKey); + if (RuleB(Chat, EnableMailKeyIPVerification)) { + full_mail_key = fmt::format("{:08X}{:08X}", ip_address, mail_key); + } else { + full_mail_key = fmt::format("{:08X}", mail_key); } - const std::string query = StringFormat( - "UPDATE character_data SET mailkey = '%s' WHERE id = '%i'", - mail_key, CharID - ); + auto e = CharacterDataRepository::FindOne(*this, character_id); + if (!e.id) { + LogError("Failed to find character_id [{}] when setting mailkey", character_id); + return; + } - const auto results = QueryDatabase(query); - if (!results.Success()) { - LogError("SharedDatabase::SetMailKey({}, {}) : {}", CharID, mail_key, results.ErrorMessage().c_str()); + e.mailkey = full_mail_key; + + if (!CharacterDataRepository::UpdateOne(*this, e)) { + LogError("Failed to set mailkey to [{}] for character_id [{}]", full_mail_key, character_id); } } -SharedDatabase::MailKeys SharedDatabase::GetMailKey(int character_id) +SharedDatabase::MailKeys SharedDatabase::GetMailKey(uint32 character_id) { - const std::string query = StringFormat("SELECT `mailkey` FROM `character_data` WHERE `id`='%i' LIMIT 1", character_id); - auto results = QueryDatabase(query); - if (!results.Success()) { - return MailKeys{}; + auto e = CharacterDataRepository::FindOne(*this, character_id); + + if (!e.id) { + return MailKeys{ }; } - if (!results.RowCount()) { - Log(Logs::General, - Logs::ClientLogin, - "Error: Mailkey for character id [%i] does not exist or could not be found", - character_id - ); - return MailKeys{}; - } - - auto &row = results.begin(); - if (row != results.end()) { - std::string mail_key = row[0]; - - return MailKeys{ - .mail_key = mail_key.substr(8), - .mail_key_full = mail_key - }; - } - - return MailKeys{}; + return MailKeys{ + .mail_key = e.mailkey.substr(8), + .mail_key_full = e.mailkey + }; } bool SharedDatabase::SaveCursor( @@ -448,27 +423,20 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) ); } - int32 SharedDatabase::GetSharedPlatinum(uint32 account_id) { - const auto query = fmt::format("SELECT sharedplat FROM account WHERE id = {}", account_id); - auto results = QueryDatabase(query); - if (!results.Success() || !results.RowCount()) { - return 0; - } + const auto& e = AccountRepository::FindOne(*this, account_id); - auto row = results.begin(); - return Strings::ToInt(row[0]); + return e.sharedplat; } -bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) { - const std::string query = StringFormat("UPDATE account SET sharedplat = sharedplat + %i WHERE id = %i", amount_to_add, account_id); - const auto results = QueryDatabase(query); - if (!results.Success()) { - return false; - } +bool SharedDatabase::AddSharedPlatinum(uint32 account_id, int amount) +{ + auto e = AccountRepository::FindOne(*this, account_id); - return true; + e.sharedplat += amount; + + return AccountRepository::UpdateOne(*this, e); } bool SharedDatabase::SetStartingItems( @@ -1662,9 +1630,16 @@ const EvolveInfo* SharedDatabase::GetEvolveInfo(uint32 loregroup) { return nullptr; // nothing here for now... database and/or sharemem pulls later } -int SharedDatabase::GetMaxSpellID() -{ - return SpellsNewRepository::GetMaxId(*this); +int SharedDatabase::GetMaxSpellID() { + const std::string query = "SELECT MAX(id) FROM spells_new"; + auto results = QueryDatabase(query); + if (!results.Success()) { + return -1; + } + + auto& row = results.begin(); + + return Strings::ToInt(row[0]); } bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const SPDat_Spell_Struct **sp) { @@ -1696,247 +1671,173 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { *static_cast(data) = max_spells; SPDat_Spell_Struct *sp = reinterpret_cast(static_cast(data) + sizeof(uint32)); - const auto& l = SpellsNewRepository::All(*this); + const std::string query = "SELECT * FROM spells_new ORDER BY id ASC"; + auto results = QueryDatabase(query); + if (!results.Success()) { + return; + } - if (l.empty()) { + if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) { + LogSpells("Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT([{}])", SPELL_LOAD_FIELD_COUNT); return; - } + } - for (const auto& e : l) { - if (e.id >= max_spells) { + int counter = 0; + + for (auto& row = results.begin(); row != results.end(); ++row) { + const int tempid = Strings::ToInt(row[0]); + if(tempid >= max_spells) { LogSpells("Non fatal error: spell.id >= max_spells, ignoring"); continue; } - sp[e.id].id = e.id; + ++counter; + sp[tempid].id = tempid; + strn0cpy(sp[tempid].name, row[1], sizeof(sp[tempid].name)); + strn0cpy(sp[tempid].player_1, row[2], sizeof(sp[tempid].player_1)); + strn0cpy(sp[tempid].teleport_zone, row[3], sizeof(sp[tempid].teleport_zone)); + strn0cpy(sp[tempid].you_cast, row[4], sizeof(sp[tempid].you_cast)); + strn0cpy(sp[tempid].other_casts, row[5], sizeof(sp[tempid].other_casts)); + strn0cpy(sp[tempid].cast_on_you, row[6], sizeof(sp[tempid].cast_on_you)); + strn0cpy(sp[tempid].cast_on_other, row[7], sizeof(sp[tempid].cast_on_other)); + strn0cpy(sp[tempid].spell_fades, row[8], sizeof(sp[tempid].spell_fades)); - strn0cpy(sp[e.id].name, e.name.c_str(), sizeof(sp[e.id].name)); - strn0cpy(sp[e.id].player_1, e.player_1.c_str(), sizeof(sp[e.id].player_1)); - strn0cpy(sp[e.id].teleport_zone, e.teleport_zone.c_str(), sizeof(sp[e.id].teleport_zone)); - strn0cpy(sp[e.id].you_cast, e.you_cast.c_str(), sizeof(sp[e.id].you_cast)); - strn0cpy(sp[e.id].other_casts, e.other_casts.c_str(), sizeof(sp[e.id].other_casts)); - strn0cpy(sp[e.id].cast_on_you, e.cast_on_you.c_str(), sizeof(sp[e.id].cast_on_you)); - strn0cpy(sp[e.id].cast_on_other, e.cast_on_other.c_str(), sizeof(sp[e.id].cast_on_other)); - strn0cpy(sp[e.id].spell_fades, e.spell_fades.c_str(), sizeof(sp[e.id].spell_fades)); + sp[tempid].range = Strings::ToFloat(row[9]); + sp[tempid].aoe_range = Strings::ToFloat(row[10]); + sp[tempid].push_back = Strings::ToFloat(row[11]); + sp[tempid].push_up = Strings::ToFloat(row[12]); + sp[tempid].cast_time=Strings::ToUnsignedInt(row[13]); + sp[tempid].recovery_time=Strings::ToUnsignedInt(row[14]); + sp[tempid].recast_time=Strings::ToUnsignedInt(row[15]); + sp[tempid].buff_duration_formula=Strings::ToUnsignedInt(row[16]); + sp[tempid].buff_duration=Strings::ToUnsignedInt(row[17]); + sp[tempid].aoe_duration=Strings::ToUnsignedInt(row[18]); + sp[tempid].mana=Strings::ToInt(row[19]); - sp[e.id].range = e.range_; - sp[e.id].aoe_range = e.aoerange; - sp[e.id].push_back = e.pushback; - sp[e.id].push_up = e.pushup; - sp[e.id].cast_time = e.cast_time; - sp[e.id].recovery_time = e.recovery_time; - sp[e.id].recast_time = e.recast_time; - sp[e.id].buff_duration_formula = e.buffdurationformula; - sp[e.id].buff_duration = e.buffduration; - sp[e.id].aoe_duration = e.AEDuration; - sp[e.id].mana = e.mana; + int y=0; + for(y=0; y< EFFECT_COUNT;y++) + sp[tempid].base_value[y]=Strings::ToInt(row[20+y]); // effect_base_value - sp[e.id].base_value[0] = e.effect_base_value1; - sp[e.id].base_value[1] = e.effect_base_value2; - sp[e.id].base_value[2] = e.effect_base_value3; - sp[e.id].base_value[3] = e.effect_base_value4; - sp[e.id].base_value[4] = e.effect_base_value5; - sp[e.id].base_value[5] = e.effect_base_value6; - sp[e.id].base_value[6] = e.effect_base_value7; - sp[e.id].base_value[7] = e.effect_base_value8; - sp[e.id].base_value[8] = e.effect_base_value9; - sp[e.id].base_value[9] = e.effect_base_value10; - sp[e.id].base_value[10] = e.effect_base_value11; - sp[e.id].base_value[11] = e.effect_base_value12; + for(y=0; y < EFFECT_COUNT; y++) + sp[tempid].limit_value[y]=Strings::ToInt(row[32+y]); // effect_limit_value - sp[e.id].limit_value[0] = e.effect_limit_value1; - sp[e.id].limit_value[1] = e.effect_limit_value2; - sp[e.id].limit_value[2] = e.effect_limit_value3; - sp[e.id].limit_value[3] = e.effect_limit_value4; - sp[e.id].limit_value[4] = e.effect_limit_value5; - sp[e.id].limit_value[5] = e.effect_limit_value6; - sp[e.id].limit_value[6] = e.effect_limit_value7; - sp[e.id].limit_value[7] = e.effect_limit_value8; - sp[e.id].limit_value[8] = e.effect_limit_value9; - sp[e.id].limit_value[9] = e.effect_limit_value10; - sp[e.id].limit_value[10] = e.effect_limit_value11; - sp[e.id].limit_value[11] = e.effect_limit_value12; + for(y=0; y< EFFECT_COUNT;y++) + sp[tempid].max_value[y]=Strings::ToInt(row[44+y]); - sp[e.id].max_value[0] = e.max1; - sp[e.id].max_value[1] = e.max2; - sp[e.id].max_value[2] = e.max3; - sp[e.id].max_value[3] = e.max4; - sp[e.id].max_value[4] = e.max5; - sp[e.id].max_value[5] = e.max6; - sp[e.id].max_value[6] = e.max7; - sp[e.id].max_value[7] = e.max8; - sp[e.id].max_value[8] = e.max9; - sp[e.id].max_value[9] = e.max10; - sp[e.id].max_value[10] = e.max11; - sp[e.id].max_value[11] = e.max12; + for(y=0; y< 4;y++) + sp[tempid].component[y]=Strings::ToInt(row[58+y]); - sp[e.id].component[0] = e.components1; - sp[e.id].component[1] = e.components2; - sp[e.id].component[2] = e.components3; - sp[e.id].component[3] = e.components4; + for(y=0; y< 4;y++) + sp[tempid].component_count[y]=Strings::ToInt(row[62+y]); - sp[e.id].component_count[0] = e.component_counts1; - sp[e.id].component_count[1] = e.component_counts2; - sp[e.id].component_count[2] = e.component_counts3; - sp[e.id].component_count[3] = e.component_counts4; + for(y=0; y< 4;y++) + sp[tempid].no_expend_reagent[y]=Strings::ToInt(row[66+y]); - sp[e.id].no_expend_reagent[0] = e.NoexpendReagent1; - sp[e.id].no_expend_reagent[1] = e.NoexpendReagent2; - sp[e.id].no_expend_reagent[2] = e.NoexpendReagent3; - sp[e.id].no_expend_reagent[3] = e.NoexpendReagent4; + for(y=0; y< EFFECT_COUNT;y++) + sp[tempid].formula[y]=Strings::ToUnsignedInt(row[70+y]); - sp[e.id].formula[0] = e.formula1; - sp[e.id].formula[1] = e.formula2; - sp[e.id].formula[2] = e.formula3; - sp[e.id].formula[3] = e.formula4; - sp[e.id].formula[4] = e.formula5; - sp[e.id].formula[5] = e.formula6; - sp[e.id].formula[6] = e.formula7; - sp[e.id].formula[7] = e.formula8; - sp[e.id].formula[8] = e.formula9; - sp[e.id].formula[9] = e.formula10; - sp[e.id].formula[10] = e.formula11; - sp[e.id].formula[11] = e.formula12; + sp[tempid].good_effect=Strings::ToInt(row[83]); + sp[tempid].activated=Strings::ToInt(row[84]); + sp[tempid].resist_type=Strings::ToInt(row[85]); - sp[e.id].good_effect = e.goodEffect; - sp[e.id].activated = e.Activated; - sp[e.id].resist_type = e.resisttype; + for(y=0; y< EFFECT_COUNT;y++) + sp[tempid].effect_id[y]=Strings::ToInt(row[86+y]); - sp[e.id].effect_id[0] = e.effectid1; - sp[e.id].effect_id[1] = e.effectid2; - sp[e.id].effect_id[2] = e.effectid3; - sp[e.id].effect_id[3] = e.effectid4; - sp[e.id].effect_id[4] = e.effectid5; - sp[e.id].effect_id[5] = e.effectid6; - sp[e.id].effect_id[6] = e.effectid7; - sp[e.id].effect_id[7] = e.effectid8; - sp[e.id].effect_id[8] = e.effectid9; - sp[e.id].effect_id[9] = e.effectid10; - sp[e.id].effect_id[10] = e.effectid11; - sp[e.id].effect_id[11] = e.effectid12; + sp[tempid].target_type = static_cast(Strings::ToInt(row[98])); + sp[tempid].base_difficulty=Strings::ToInt(row[99]); - sp[e.id].target_type = static_cast(e.targettype); + int tmp_skill = Strings::ToInt(row[100]); - sp[e.id].base_difficulty = e.basediff; + if (tmp_skill < 0 || tmp_skill > EQ::skills::HIGHEST_SKILL) + sp[tempid].skill = EQ::skills::SkillBegging; /* not much better we can do. */ // can probably be changed to client-based 'SkillNone' once activated + else + sp[tempid].skill = static_cast(tmp_skill); - sp[e.id].skill = ( - EQ::ValueWithin(e.skill, 0, EQ::skills::HIGHEST_SKILL) ? - static_cast(e.skill) : - EQ::skills::SkillBegging - ); + sp[tempid].zone_type=Strings::ToInt(row[101]); + sp[tempid].environment_type=Strings::ToInt(row[102]); + sp[tempid].time_of_day=Strings::ToInt(row[103]); - sp[e.id].zone_type = e.zonetype; - sp[e.id].environment_type = e.EnvironmentType; - sp[e.id].time_of_day = e.TimeOfDay; + for(y=0; y < Class::PLAYER_CLASS_COUNT;y++) + sp[tempid].classes[y]=Strings::ToInt(row[104+y]); - sp[e.id].classes[0] = e.classes1; - sp[e.id].classes[1] = e.classes2; - sp[e.id].classes[2] = e.classes3; - sp[e.id].classes[3] = e.classes4; - sp[e.id].classes[4] = e.classes5; - sp[e.id].classes[5] = e.classes6; - sp[e.id].classes[6] = e.classes7; - sp[e.id].classes[7] = e.classes8; - sp[e.id].classes[8] = e.classes9; - sp[e.id].classes[9] = e.classes10; - sp[e.id].classes[10] = e.classes11; - sp[e.id].classes[11] = e.classes12; - sp[e.id].classes[12] = e.classes13; - sp[e.id].classes[13] = e.classes14; - sp[e.id].classes[14] = e.classes15; - sp[e.id].classes[15] = e.classes16; + sp[tempid].casting_animation=Strings::ToInt(row[120]); + sp[tempid].spell_affect_index=Strings::ToInt(row[123]); + sp[tempid].disallow_sit=Strings::ToInt(row[124]); + sp[tempid].deity_agnostic=Strings::ToInt(row[125]); - sp[e.id].casting_animation = e.CastingAnim; - sp[e.id].spell_affect_index = e.SpellAffectIndex; - sp[e.id].disallow_sit = e.disallow_sit; + for (y = 0; y < 16; y++) + sp[tempid].deities[y]=Strings::ToInt(row[126+y]); - sp[e.id].deity_agnostic = e.deities0; // Agnostic - sp[e.id].deities[0] = e.deities1; // Bertoxxulous - sp[e.id].deities[1] = e.deities2; // Brell Serilis - sp[e.id].deities[2] = e.deities3; // Cazic Thule - sp[e.id].deities[3] = e.deities4; // Erollsi Marr - sp[e.id].deities[4] = e.deities5; // Bristlebane - sp[e.id].deities[5] = e.deities6; // Innoruuk - sp[e.id].deities[6] = e.deities7; // Karana - sp[e.id].deities[7] = e.deities8; // Mithaniel Marr - sp[e.id].deities[8] = e.deities9; // Prexius - sp[e.id].deities[9] = e.deities10; // Quellious - sp[e.id].deities[10] = e.deities11; // Rallos Zek - sp[e.id].deities[11] = e.deities12; // Rodcet Nife - sp[e.id].deities[12] = e.deities13; // Solusek Ro - sp[e.id].deities[13] = e.deities14; // The Tribunal - sp[e.id].deities[14] = e.deities15; // Tunare - sp[e.id].deities[15] = e.deities16; // Veeshan + sp[tempid].new_icon=Strings::ToInt(row[144]); + sp[tempid].uninterruptable=Strings::ToBool(row[146]); + sp[tempid].resist_difficulty=Strings::ToInt(row[147]); + sp[tempid].unstackable_dot = Strings::ToBool(row[148]); + sp[tempid].recourse_link = Strings::ToUnsignedInt(row[150]); + sp[tempid].no_partial_resist = Strings::ToBool(row[151]); - sp[e.id].new_icon = e.new_icon; - sp[e.id].uninterruptable = e.uninterruptable; - sp[e.id].resist_difficulty = e.ResistDiff; - sp[e.id].unstackable_dot = e.dot_stacking_exempt; - sp[e.id].recourse_link = e.RecourseLink; - sp[e.id].no_partial_resist = e.no_partial_resist; - sp[e.id].short_buff_box = e.short_buff_box; - sp[e.id].description_id = e.descnum; - sp[e.id].type_description_id = e.typedescnum; - sp[e.id].effect_description_id = e.effectdescnum; - sp[e.id].npc_no_los = e.npc_no_los; - sp[e.id].feedbackable = e.feedbackable; - sp[e.id].reflectable = e.reflectable; - sp[e.id].bonus_hate = e.bonushate; - sp[e.id].ldon_trap = e.ldon_trap; - sp[e.id].endurance_cost = e.EndurCost; - sp[e.id].timer_id = e.EndurTimerIndex; - sp[e.id].is_discipline = e.IsDiscipline; - sp[e.id].hate_added = e.HateAdded; - sp[e.id].endurance_upkeep = e.EndurUpkeep; - sp[e.id].hit_number_type = e.numhits; - sp[e.id].hit_number = e.numhitstype; - sp[e.id].pvp_resist_base = e.pvpresistbase; - sp[e.id].pvp_resist_per_level = e.pvpresistcalc; - sp[e.id].pvp_resist_cap = e.pvpresistcap; - sp[e.id].spell_category = e.spell_category; - sp[e.id].pvp_duration = e.pvp_duration; - sp[e.id].pvp_duration_cap = e.pvp_duration_cap; - sp[e.id].pcnpc_only_flag = e.pcnpc_only_flag; - sp[e.id].cast_not_standing = e.cast_not_standing; - sp[e.id].can_mgb = e.can_mgb; - sp[e.id].dispel_flag = e.nodispell; - sp[e.id].min_resist = e.MinResist; - sp[e.id].max_resist = e.MaxResist; - sp[e.id].viral_targets = e.viral_targets; - sp[e.id].viral_timer = e.viral_timer; - sp[e.id].nimbus_effect = e.nimbuseffect; - sp[e.id].directional_start = e.ConeStartAngle; - sp[e.id].directional_end = e.ConeStopAngle; - sp[e.id].sneak = e.sneaking; - sp[e.id].not_focusable = e.not_extendable; + sp[tempid].short_buff_box = Strings::ToInt(row[154]); + sp[tempid].description_id = Strings::ToInt(row[155]); + sp[tempid].type_description_id = Strings::ToInt(row[156]); + sp[tempid].effect_description_id = Strings::ToInt(row[157]); - sp[e.id].no_detrimental_spell_aggro = e.no_detrimental_spell_aggro; + sp[tempid].npc_no_los = Strings::ToBool(row[159]); + sp[tempid].feedbackable = Strings::ToBool(row[160]); + sp[tempid].reflectable = Strings::ToBool(row[161]); + sp[tempid].bonus_hate=Strings::ToInt(row[162]); - sp[e.id].suspendable = e.suspendable; - sp[e.id].viral_range = e.viral_range; - sp[e.id].song_cap = e.songcap; - sp[e.id].no_block = e.no_block; - sp[e.id].spell_group = e.spellgroup; - sp[e.id].rank = e.rank_; - sp[e.id].no_resist = e.no_resist; - sp[e.id].cast_restriction = e.CastRestriction; - sp[e.id].allow_rest = e.allowrest; - sp[e.id].can_cast_in_combat = e.InCombat; - sp[e.id].can_cast_out_of_combat = e.OutofCombat; - sp[e.id].override_crit_chance = e.override_crit_chance; - sp[e.id].aoe_max_targets = e.aemaxtargets; - sp[e.id].no_heal_damage_item_mod = e.no_heal_damage_item_mod; - sp[e.id].caster_requirement_id = e.caster_requirement_id; - sp[e.id].spell_class = e.spell_class; - sp[e.id].spell_subclass = e.spell_subclass; - sp[e.id].persist_death = e.persistdeath; - sp[e.id].min_distance = e.min_dist; - sp[e.id].min_distance_mod = e.min_dist_mod; - sp[e.id].max_distance = e.max_dist; - sp[e.id].max_distance_mod = e.max_dist_mod; - sp[e.id].min_range = e.min_range; - sp[e.id].no_remove = e.no_remove; - sp[e.id].damage_shield_type = 0; + sp[tempid].ldon_trap = Strings::ToBool(row[165]); + sp[tempid].endurance_cost= Strings::ToInt(row[166]); + sp[tempid].timer_id= Strings::ToInt(row[167]); + sp[tempid].is_discipline = Strings::ToBool(row[168]); + sp[tempid].hate_added= Strings::ToInt(row[173]); + sp[tempid].endurance_upkeep=Strings::ToInt(row[174]); + sp[tempid].hit_number_type = Strings::ToInt(row[175]); + sp[tempid].hit_number = Strings::ToInt(row[176]); + sp[tempid].pvp_resist_base= Strings::ToInt(row[177]); + sp[tempid].pvp_resist_per_level= Strings::ToInt(row[178]); + sp[tempid].pvp_resist_cap= Strings::ToInt(row[179]); + sp[tempid].spell_category= Strings::ToInt(row[180]); + sp[tempid].pvp_duration = Strings::ToInt(row[181]); + sp[tempid].pvp_duration_cap = Strings::ToInt(row[182]); + sp[tempid].pcnpc_only_flag= Strings::ToInt(row[183]); + sp[tempid].cast_not_standing = Strings::ToInt(row[184]) != 0; + sp[tempid].can_mgb= Strings::ToBool(row[185]); + sp[tempid].dispel_flag = Strings::ToInt(row[186]); + sp[tempid].min_resist = Strings::ToInt(row[189]); + sp[tempid].max_resist = Strings::ToInt(row[190]); + sp[tempid].viral_targets = Strings::ToInt(row[191]); + sp[tempid].viral_timer = Strings::ToInt(row[192]); + sp[tempid].nimbus_effect = Strings::ToInt(row[193]); + sp[tempid].directional_start = Strings::ToFloat(row[194]); + sp[tempid].directional_end = Strings::ToFloat(row[195]); + sp[tempid].sneak = Strings::ToBool(row[196]); + sp[tempid].not_focusable = Strings::ToBool(row[197]); + sp[tempid].no_detrimental_spell_aggro = Strings::ToBool(row[198]); + sp[tempid].suspendable = Strings::ToBool(row[200]); + sp[tempid].viral_range = Strings::ToInt(row[201]); + sp[tempid].song_cap = Strings::ToInt(row[202]); + sp[tempid].no_block = Strings::ToInt(row[205]); + sp[tempid].spell_group=Strings::ToInt(row[207]); + sp[tempid].rank = Strings::ToInt(row[208]); + sp[tempid].no_resist=Strings::ToInt(row[209]); + sp[tempid].cast_restriction = Strings::ToInt(row[211]); + sp[tempid].allow_rest = Strings::ToBool(row[212]); + sp[tempid].can_cast_in_combat = Strings::ToBool(row[213]); + sp[tempid].can_cast_out_of_combat = Strings::ToBool(row[214]); + sp[tempid].override_crit_chance = Strings::ToInt(row[217]); + sp[tempid].aoe_max_targets = Strings::ToInt(row[218]); + sp[tempid].no_heal_damage_item_mod = Strings::ToInt(row[219]); + sp[tempid].caster_requirement_id = Strings::ToInt(row[220]); + sp[tempid].spell_class = Strings::ToInt(row[221]); + sp[tempid].spell_subclass = Strings::ToInt(row[222]); + sp[tempid].persist_death = Strings::ToBool(row[224]); + sp[tempid].min_distance = Strings::ToFloat(row[227]); + sp[tempid].min_distance_mod = Strings::ToFloat(row[228]); + sp[tempid].max_distance = Strings::ToFloat(row[229]); + sp[tempid].max_distance_mod = Strings::ToFloat(row[230]); + sp[tempid].min_range = Strings::ToFloat(row[231]); + sp[tempid].no_remove = Strings::ToBool(row[232]); + sp[tempid].damage_shield_type = 0; } LoadDamageShieldTypes(sp); @@ -1969,7 +1870,18 @@ void SharedDatabase::SaveCharacterInspectMessage(uint32 character_id, const Insp uint32 SharedDatabase::GetSpellsCount() { - return SpellsNewRepository::Count(*this); + auto results = QueryDatabase("SELECT count(*) FROM spells_new"); + if (!results.Success() || !results.RowCount()) { + return 0; + } + + auto& row = results.begin(); + + if (row[0]) { + return Strings::ToUnsignedInt(row[0]); + } + + return 0; } uint32 SharedDatabase::GetItemsCount() diff --git a/common/shareddb.h b/common/shareddb.h index 873b8e1a0..2a78be670 100644 --- a/common/shareddb.h +++ b/common/shareddb.h @@ -82,15 +82,14 @@ public: bool UpdateInjectedCommandSettings(const std::vector> &injected); bool UpdateOrphanedCommandSettings(const std::vector &orphaned); bool GetCommandSubSettings(std::vector &command_subsettings); - uint32 GetTotalTimeEntitledOnAccount(uint32 AccountID); bool SetGMInvul(uint32 account_id, bool gminvul); bool SetGMFlymode(uint32 account_id, uint8 flymode); - void SetMailKey(int CharID, int IPAddress, int MailKey); + void SetMailKey(uint32 character_id, uint32 ip_address, uint32 mail_key); struct MailKeys { std::string mail_key; std::string mail_key_full; }; - MailKeys GetMailKey(int character_id); + MailKeys GetMailKey(uint32 character_id); bool SaveCursor( uint32 char_id, std::list::const_iterator &start, @@ -104,7 +103,7 @@ public: bool VerifyInventory(uint32 account_id, int16 slot_id, const EQ::ItemInstance *inst); bool GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is_charid); int32 GetSharedPlatinum(uint32 account_id); - bool SetSharedPlatinum(uint32 account_id, int32 amount_to_add); + bool AddSharedPlatinum(uint32 account_id, int amount); bool GetInventory(Client* c); bool GetInventory(uint32 account_id, char *name, EQ::InventoryProfile *inv); // deprecated std::map GetItemRecastTimestamps(uint32 char_id); diff --git a/common/spdat.h b/common/spdat.h index 9df894d35..11130d6a4 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -1600,6 +1600,7 @@ namespace SpellEffect { // number. note that the id field is counted as 0, this way the numbers // here match the numbers given to sep in the loading function net.cpp // +#define SPELL_LOAD_FIELD_COUNT 236 struct SPDat_Spell_Struct { diff --git a/common/version.h b/common/version.h index af74568c6..c119346d4 100644 --- a/common/version.h +++ b/common/version.h @@ -25,7 +25,7 @@ // Build variables // these get injected during the build pipeline -#define CURRENT_VERSION "23.9.1-dev" // always append -dev to the current version for custom-builds +#define CURRENT_VERSION "23.10.3-dev" // always append -dev to the current version for custom-builds #define LOGIN_VERSION "0.8.0" #define COMPILE_DATE __DATE__ #define COMPILE_TIME __TIME__ diff --git a/package.json b/package.json index d148cc68b..985a21c38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eqemu-server", - "version": "23.9.1", + "version": "23.10.3", "repository": { "type": "git", "url": "https://github.com/EQEmu/Server.git" diff --git a/world/client.cpp b/world/client.cpp index 52244e531..a2d35a485 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -985,7 +985,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { safe_delete(outapp); // set mailkey - used for duration of character session - int mail_key = EQ::Random::Instance()->Int(1, INT_MAX); + uint32 mail_key = EQ::Random::Instance()->Int(1, INT_MAX); database.SetMailKey(charid, GetIP(), mail_key); if (UCSServerAvailable_) { diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 42f0b8bbe..a059bef65 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1713,7 +1713,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) if (zone->IsPVPZone()) m_pp.pvp = 1; /* Time entitled on Account: Move to account */ - m_pp.timeentitledonaccount = database.GetTotalTimeEntitledOnAccount(AccountID()) / 1440; + m_pp.timeentitledonaccount = CharacterDataRepository::GetTotalTimePlayed(database, AccountID()) / 1440; /* Reset rest timer if the durations have been lowered in the database */ if ((m_pp.RestTimer > RuleI(Character, RestRegenTimeToActivate)) && (m_pp.RestTimer > RuleI(Character, RestRegenRaidTimeToActivate))) m_pp.RestTimer = 0; @@ -7988,7 +7988,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) if ((Admin() < RuleI(Guild, PlayerCreationRequiredStatus)) || (GetLevel() < RuleI(Guild, PlayerCreationRequiredLevel)) || - (database.GetTotalTimeEntitledOnAccount(AccountID()) < (unsigned int)RuleI(Guild, PlayerCreationRequiredTime))) + (CharacterDataRepository::GetTotalTimePlayed(database, AccountID()) < (unsigned int)RuleI(Guild, PlayerCreationRequiredTime))) { Message(Chat::Red, "Your status, level or time playing on this account are insufficient to use this feature."); return; @@ -11080,909 +11080,657 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) LogError("Wrong size: OP_PetCommands, size=[{}], expected [{}]", app->size, sizeof(PetCommand_Struct)); return; } - - auto* s = (PetCommand_Struct*) app->pBuffer; - char val1[20] = { 0 }; + PetCommand_Struct* pet = (PetCommand_Struct*)app->pBuffer; + Mob* mypet = GetPet(); + Mob *target = entity_list.GetMob(pet->target); - Mob* pet = GetPet(); - Mob* t = entity_list.GetMob(s->target); - - if (!pet || s->command == PetCommand::Leader) { - if (s->command == PetCommand::Leader) { + if (!mypet || pet->command == PET_LEADER) { + if (pet->command == PET_LEADER) { // we either send the ID of an NPC we're interested in or no ID for our own pet - if (t) { - Mob* owner = t->GetOwner(); - if (owner) { - t->SayString(PET_LEADERIS, owner->GetCleanName()); - } else { - t->SayString(I_FOLLOW_NOONE); - } - } else if (pet) { - pet->SayString(PET_LEADERIS, GetName()); + if (target) { + auto owner = target->GetOwner(); + if (owner) + target->SayString(PET_LEADERIS, owner->GetCleanName()); + else + target->SayString(I_FOLLOW_NOONE); + } else if (mypet) { + mypet->SayString(PET_LEADERIS, GetName()); } } return; } - if (!pet->IsNPC()) { + if (mypet->GetPetType() == petTargetLock && (pet->command != PET_HEALTHREPORT && pet->command != PET_GETLOST)) return; - } - - if ( - pet->GetPetType() == PetType::TargetLock && - s->command != PetCommand::HealthReport && - s->command != PetCommand::GetLost - ) { - return; - } // just let the command "/pet get lost" work for familiars - if (pet->GetPetType() == PetType::Familiar && s->command != PetCommand::GetLost) { + if (mypet->GetPetType() == petFamiliar && pet->command != PET_GETLOST) return; + + uint32 PetCommand = pet->command; + + // Handle Sit/Stand toggle in UF and later. + /* + if (GetClientVersion() >= EQClientUnderfoot) + { + if (PetCommand == PET_SITDOWN) + if (mypet->GetPetOrder() == SPO_Sit) + PetCommand = PET_STANDUP; } + */ - const bool can_use_command = ( - (pet->GetPetType() == PetType::Animation && aabonuses.PetCommands[s->command]) || - pet->GetPetType() != PetType::Animation - ); + switch (PetCommand) + { + case PET_ATTACK: { + if (!target) + break; - switch (s->command) { - case PetCommand::Attack: { - if ( - !t || - pet->IsFeared() || - !can_use_command || - t == this || - !( - DistanceSquaredNoZ(pet->GetPosition(), GetTarget()->GetPosition()) <= - (RuleR(Pets, AttackCommandRange) * RuleR(Pets, AttackCommandRange)) - ) || - DistanceSquared(pet->GetPosition(), t->GetPosition()) >= RuleR(Aggro, PetAttackRange) - ) { - break; + if (RuleB(Pets, PetsRequireLoS) && !DoLosChecks(target)) { + mypet->SayString(this, NOT_LEGAL_TARGET); + break; + } + + if (target->IsMezzed()) { + MessageString(Chat::NPCQuestSay, CANNOT_WAKE, mypet->GetCleanName(), target->GetCleanName()); + break; + } + + if (mypet->IsFeared()) + break; //prevent pet from attacking stuff while feared + + if (!mypet->IsAttackAllowed(target)) { + mypet->SayString(this, NOT_LEGAL_TARGET); + break; + } + + // default range is 200, takes Z into account + // really they do something weird where they're added to the aggro list then remove them + // and will attack if they come in range -- too lazy, lets remove exploits for now + if (DistanceSquared(mypet->GetPosition(), target->GetPosition()) >= RuleR(Aggro, PetAttackRange)) { + // they say they're attacking then remove on live ... so they don't really say anything in this case ... + break; + } + + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + if (target != this && DistanceSquared(mypet->GetPosition(), target->GetPosition()) <= (RuleR(Pets, AttackCommandRange)*RuleR(Pets, AttackCommandRange))) { + mypet->SetFeigned(false); + if (mypet->IsPetStop()) { + mypet->SetPetStop(false); + SetPetCommandState(PET_BUTTON_STOP, 0); + } + if (mypet->IsPetRegroup()) { + mypet->SetPetRegroup(false); + SetPetCommandState(PET_BUTTON_REGROUP, 0); + } + + // fix GUI sit button to be unpressed and stop sitting regen + SetPetCommandState(PET_BUTTON_SIT, 0); + if (mypet->GetPetOrder() == SPO_Sit || mypet->GetPetOrder() == SPO_FeignDeath) { + mypet->SetPetOrder(mypet->GetPreviousPetOrder()); + mypet->SetAppearance(eaStanding); + } + + zone->AddAggroMob(); + // classic acts like qattack + int hate = 1; + if (mypet->IsEngaged()) { + auto top = mypet->GetHateMost(); + if (top && top != target) + hate += mypet->GetHateAmount(top) - mypet->GetHateAmount(target) + 100; // should be enough to cause target change + } + mypet->AddToHateList(target, hate, 0, true, false, false, SPELL_UNKNOWN, true); + MessageString(Chat::PetResponse, PET_ATTACKING, mypet->GetCleanName(), target->GetCleanName()); + SetTarget(target); } + } + break; + } + case PET_QATTACK: { + if (mypet->IsFeared()) + break; //prevent pet from attacking stuff while feared - if (RuleB(Pets, PetsRequireLoS) && !DoLosChecks(t)) { - pet->SayString(this, NOT_LEGAL_TARGET); - break; + if (!GetTarget()) { + break; + } + + if (RuleB(Pets, PetsRequireLoS) && !DoLosChecks(GetTarget())) { + mypet->SayString(this, NOT_LEGAL_TARGET); + break; + } + + if (GetTarget()->IsMezzed()) { + MessageString(Chat::NPCQuestSay, CANNOT_WAKE, mypet->GetCleanName(), GetTarget()->GetCleanName()); + break; + } + + if (!mypet->IsAttackAllowed(GetTarget())) { + mypet->SayString(this, NOT_LEGAL_TARGET); + break; + } + + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + if (GetTarget() != this && DistanceSquaredNoZ(mypet->GetPosition(), GetTarget()->GetPosition()) <= (RuleR(Pets, AttackCommandRange)*RuleR(Pets, AttackCommandRange))) { + mypet->SetFeigned(false); + if (mypet->IsPetStop()) { + mypet->SetPetStop(false); + SetPetCommandState(PET_BUTTON_STOP, 0); + } + if (mypet->IsPetRegroup()) { + mypet->SetPetRegroup(false); + SetPetCommandState(PET_BUTTON_REGROUP, 0); + } + + // fix GUI sit button to be unpressed and stop sitting regen + SetPetCommandState(PET_BUTTON_SIT, 0); + if (mypet->GetPetOrder() == SPO_Sit || mypet->GetPetOrder() == SPO_FeignDeath) { + mypet->SetPetOrder(mypet->GetPreviousPetOrder()); + mypet->SetAppearance(eaStanding); + } + + zone->AddAggroMob(); + mypet->AddToHateList(GetTarget(), 1, 0, true, false, false, SPELL_UNKNOWN, true); + MessageString(Chat::PetResponse, PET_ATTACKING, mypet->GetCleanName(), GetTarget()->GetCleanName()); } + } + break; + } + case PET_BACKOFF: { + if (mypet->IsFeared()) break; //keeps pet running while feared - if (t->IsMezzed()) { - MessageString(Chat::NPCQuestSay, CANNOT_WAKE, pet->GetCleanName(), t->GetCleanName()); - break; + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + mypet->SayString(this, Chat::PetResponse, PET_CALMING); + mypet->WipeHateList(); + mypet->SetTarget(nullptr); + if (mypet->IsPetStop()) { + mypet->SetPetStop(false); + SetPetCommandState(PET_BUTTON_STOP, 0); } + } + break; + } + case PET_HEALTHREPORT: { + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + MessageString(Chat::PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1)); + mypet->ShowBuffs(this); + } + break; + } + case PET_GETLOST: { + if (mypet->Charmed()) + break; + if (mypet->GetPetType() == petCharmed || !mypet->IsNPC()) { + // eqlive ignores this command + // we could just remove the charm + // and continue + mypet->BuffFadeByEffect(SpellEffect::Charm); + break; + } + else { + SetPet(nullptr); + } - if (!pet->IsAttackAllowed(t)) { - pet->SayString(this, NOT_LEGAL_TARGET); - break; - } + mypet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); + mypet->CastToNPC()->Depop(); - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; + //Oddly, the client (Titanium) will still allow "/pet get lost" command despite me adding the code below. If someone can figure that out, you can uncomment this code and use it. + /* + if((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 2) || mypet->GetPetType() != petAnimation) { + mypet->SayString(PET_GETLOST_STRING); + mypet->CastToNPC()->Depop(); + } + */ - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); + break; + } + case PET_GUARDHERE: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF - pet->SetFeigned(false); + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + if (mypet->IsNPC()) { - if (pet->IsPetStop()) { - pet->SetPetStop(false); - SetPetCommandState(PetButton::Stop, PetButtonState::Off); - } + // Set Sit button to unpressed - send stand anim/end hpregen + mypet->SetFeigned(false); + SetPetCommandState(PET_BUTTON_SIT, 0); + mypet->SetAppearance(eaStanding); - if (pet->IsPetRegroup()) { - pet->SetPetRegroup(false); - SetPetCommandState(PetButton::Regroup, PetButtonState::Off); - } - - SetPetCommandState(PetButton::Sit, PetButtonState::Off); - - if (pet->GetPetOrder() == PetOrder::Sit || pet->GetPetOrder() == PetOrder::Feign) { - pet->SetPetOrder(pet->GetPreviousPetOrder()); - pet->SetAppearance(eaStanding); - } - - zone->AddAggroMob(); - - int hate = 1; // classic acts like qattack - if (pet->IsEngaged()) { - Mob* top = pet->GetHateMost(); - if (top && top != t) { - hate += pet->GetHateAmount(top) - pet->GetHateAmount(t) + 100; + mypet->SayString(this, Chat::PetResponse, PET_GUARDINGLIFE); + mypet->SetPetOrder(SPO_Guard); + mypet->CastToNPC()->SaveGuardSpot(mypet->GetPosition()); + if (!mypet->GetTarget()) // want them to not twitch if they're chasing something down + mypet->StopNavigation(); + if (mypet->IsPetStop()) { + mypet->SetPetStop(false); + SetPetCommandState(PET_BUTTON_STOP, 0); } } - - pet->AddToHateList(t, hate, 0, true, false, false, SPELL_UNKNOWN, true); - MessageString(Chat::PetResponse, PET_ATTACKING, pet->GetCleanName(), t->GetCleanName()); - SetTarget(t); - break; } - case PetCommand::QAttack: { - if ( - pet->IsFeared() || - !GetTarget() || - GetTarget() == this || - !can_use_command || - !( - DistanceSquaredNoZ(pet->GetPosition(), GetTarget()->GetPosition()) <= - (RuleR(Pets, AttackCommandRange) * RuleR(Pets, AttackCommandRange)) - ) - ) { - break; + break; + } + case PET_FOLLOWME: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF + + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + mypet->SetFeigned(false); + mypet->SayString(this, Chat::PetResponse, PET_FOLLOWING); + mypet->SetPetOrder(SPO_Follow); + + // fix GUI sit button to be unpressed - send stand anim/end hpregen + SetPetCommandState(PET_BUTTON_SIT, 0); + mypet->SetAppearance(eaStanding); + + if (mypet->IsPetStop()) { + mypet->SetPetStop(false); + SetPetCommandState(PET_BUTTON_STOP, 0); } - - if (RuleB(Pets, PetsRequireLoS) && !DoLosChecks(GetTarget())) { - pet->SayString(this, NOT_LEGAL_TARGET); - break; - } - - if (GetTarget()->IsMezzed()) { - MessageString(Chat::NPCQuestSay, CANNOT_WAKE, pet->GetCleanName(), GetTarget()->GetCleanName()); - break; - } - - if (!pet->IsAttackAllowed(GetTarget())) { - pet->SayString(this, NOT_LEGAL_TARGET); - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetFeigned(false); - - if (pet->IsPetStop()) { - pet->SetPetStop(false); - SetPetCommandState(PetButton::Stop, PetButtonState::Off); - } - - if (pet->IsPetRegroup()) { - pet->SetPetRegroup(false); - SetPetCommandState(PetButton::Regroup, PetButtonState::Off); - } - - SetPetCommandState(PetButton::Sit, PetButtonState::Off); - - if (pet->GetPetOrder() == PetOrder::Sit || pet->GetPetOrder() == PetOrder::Feign) { - pet->SetPetOrder(pet->GetPreviousPetOrder()); - pet->SetAppearance(eaStanding); - } - - zone->AddAggroMob(); - pet->AddToHateList(GetTarget(), 1, 0, true, false, false, SPELL_UNKNOWN, true); - MessageString(Chat::PetResponse, PET_ATTACKING, pet->GetCleanName(), GetTarget()->GetCleanName()); - break; } - case PetCommand::BackOff: { - if (pet->IsFeared() || !can_use_command) { - break; + break; + } + case PET_TAUNT: { + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + if (mypet->CastToNPC()->IsTaunting()) + { + MessageString(Chat::PetResponse, PET_NO_TAUNT); + mypet->CastToNPC()->SetTaunting(false); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SayString(this, Chat::PetResponse, PET_CALMING); - pet->WipeHateList(); - pet->SetTarget(nullptr); - - if (pet->IsPetStop()) { - pet->SetPetStop(false); - SetPetCommandState(PetButton::Stop, PetButtonState::Off); + else + { + MessageString(Chat::PetResponse, PET_DO_TAUNT); + mypet->CastToNPC()->SetTaunting(true); } - - break; } - case PetCommand::HealthReport: { - if (!can_use_command) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - MessageString(Chat::PetResponse, PET_REPORT_HP, ConvertArrayF(pet->GetHPRatio(), val1)); - pet->ShowBuffs(this); - break; - } - case PetCommand::GetLost: { - if (pet->Charmed()) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - if (pet->GetPetType() == PetType::Charmed) { - pet->BuffFadeByEffect(SpellEffect::Charm); - break; - } else { - SetPet(nullptr); - } - - pet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); - pet->CastToNPC()->Depop(); - break; - } - case PetCommand::GuardHere: { - if (pet->IsFeared() || !can_use_command) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetFeigned(false); - SetPetCommandState(PetButton::Sit, PetButtonState::Off); - pet->SetAppearance(eaStanding); - pet->SayString(this, Chat::PetResponse, PET_GUARDINGLIFE); - pet->SetPetOrder(PetOrder::Guard); - pet->CastToNPC()->SaveGuardSpot(pet->GetPosition()); - - if (!pet->GetTarget()) { - pet->StopNavigation(); - } - - if (pet->IsPetStop()) { - pet->SetPetStop(false); - SetPetCommandState(PetButton::Stop, PetButtonState::Off); - } - - break; - } - case PetCommand::FollowMe: { - if (pet->IsFeared() || !can_use_command) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetFeigned(false); - pet->SayString(this, Chat::PetResponse, PET_FOLLOWING); - pet->SetPetOrder(PetOrder::Follow); - SetPetCommandState(PetButton::Sit, PetButtonState::Off); - pet->SetAppearance(eaStanding); - - if (pet->IsPetStop()) { - pet->SetPetStop(false); - SetPetCommandState(PetButton::Stop, PetButtonState::Off); - } - - break; - } - case PetCommand::Taunt: { - if (!can_use_command) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - MessageString(Chat::PetResponse, pet->CastToNPC()->IsTaunting() ? PET_NO_TAUNT : PET_DO_TAUNT); - pet->CastToNPC()->SetTaunting(!pet->CastToNPC()->IsTaunting()); - break; - } - case PetCommand::TauntOn: { - if (!can_use_command) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - + break; + } + case PET_TAUNT_ON: { + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { MessageString(Chat::PetResponse, PET_DO_TAUNT); - pet->CastToNPC()->SetTaunting(true); - break; + mypet->CastToNPC()->SetTaunting(true); } - case PetCommand::TauntOff: { - if (!can_use_command) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - + break; + } + case PET_TAUNT_OFF: { + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { MessageString(Chat::PetResponse, PET_NO_TAUNT); - pet->CastToNPC()->SetTaunting(false); - break; + mypet->CastToNPC()->SetTaunting(false); } - case PetCommand::GuardMe: { - if (pet->IsFeared() || can_use_command) { - break; + break; + } + case PET_GUARDME: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF + + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + mypet->SetFeigned(false); + mypet->SayString(this, Chat::PetResponse, PET_GUARDME_STRING); + mypet->SetPetOrder(SPO_Follow); + + // Set Sit button to unpressed - send stand anim/end hpregen + SetPetCommandState(PET_BUTTON_SIT, 0); + mypet->SetAppearance(eaStanding); + + if (mypet->IsPetStop()) { + mypet->SetPetStop(false); + SetPetCommandState(PET_BUTTON_STOP, 0); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetFeigned(false); - pet->SayString(this, Chat::PetResponse, PET_GUARDME_STRING); - pet->SetPetOrder(PetOrder::Follow); - SetPetCommandState(PetButton::Sit, PetButtonState::Off); - pet->SetAppearance(eaStanding); - - if (pet->IsPetStop()) { - pet->SetPetStop(false); - SetPetCommandState(PetButton::Stop, PetButtonState::Off); - } - - break; } - case PetCommand::Sit: { - if (pet->IsFeared() || !can_use_command) { - break; + break; + } + case PET_SIT: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF + + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + if (mypet->GetPetOrder() == SPO_Sit) + { + mypet->SetFeigned(false); + mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING); + mypet->SetPetOrder(mypet->GetPreviousPetOrder()); + mypet->SetAppearance(eaStanding); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetFeigned(false); - pet->SayString(this, Chat::PetResponse, PET_SIT_STRING); - pet->SetPetOrder(pet->GetPetOrder() == PetOrder::Sit ? pet->GetPreviousPetOrder() : PetOrder::Sit); - pet->SetAppearance(pet->GetPetOrder() == PetOrder::Sit ? eaStanding : eaSitting); - - if (pet->GetPetOrder() != PetOrder::Sit) { - pet->SetRunAnimSpeed(0); - - if (!pet->UseBardSpellLogic()) { - pet->InterruptSpell(); - } + else + { + mypet->SetFeigned(false); + mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING); + mypet->SetPetOrder(SPO_Sit); + mypet->SetRunAnimSpeed(0); + if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet + mypet->InterruptSpell(); //No cast 4 u. //i guess the pet should start casting + mypet->SetAppearance(eaSitting); } - - break; } - case PetCommand::StandUp: { - if (pet->IsFeared() || !can_use_command) { - break; - } + break; + } + case PET_STANDUP: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetFeigned(false); - pet->SayString(this, Chat::PetResponse, PET_SIT_STRING); - SetPetCommandState(PetButton::Sit, PetButtonState::Off); - pet->SetPetOrder(pet->GetPreviousPetOrder()); - pet->SetAppearance(eaStanding); - break; + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + mypet->SetFeigned(false); + mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING); + SetPetCommandState(PET_BUTTON_SIT, 0); + mypet->SetPetOrder(mypet->GetPreviousPetOrder()); + mypet->SetAppearance(eaStanding); } - case PetCommand::SitDown: { - if (pet->IsFeared() || !can_use_command) { - break; - } + break; + } + case PET_SITDOWN: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetFeigned(false); - pet->SayString(this, Chat::PetResponse, PET_SIT_STRING); - SetPetCommandState(PetButton::Sit, PetButtonState::On); - pet->SetPetOrder(PetOrder::Sit); - pet->SetRunAnimSpeed(0); - - if (!pet->UseBardSpellLogic()){ - pet->InterruptSpell(); - } - - pet->SetAppearance(eaSitting); - break; + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + mypet->SetFeigned(false); + mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING); + SetPetCommandState(PET_BUTTON_SIT, 1); + mypet->SetPetOrder(SPO_Sit); + mypet->SetRunAnimSpeed(0); + if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet + mypet->InterruptSpell(); //No cast 4 u. //i guess the pet should start casting + mypet->SetAppearance(eaSitting); } - case PetCommand::Hold: { - if (!aabonuses.PetCommands[s->command]) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - if (pet->IsHeld()) { - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { + break; + } + case PET_HOLD: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { + if (mypet->IsHeld()) + { + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) MessageString(Chat::PetResponse, PET_HOLD_SET_OFF); - } - - pet->SetHeld(false); - } else { - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { + mypet->SetHeld(false); + } + else + { + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) MessageString(Chat::PetResponse, PET_HOLD_SET_ON); - } - if (m_ClientVersionBit & EQ::versions::maskUFAndLater) { - pet->SayString(this, Chat::PetResponse, PET_NOW_HOLDING); - } else { - pet->SayString(this, Chat::PetResponse, PET_ON_HOLD); - } + if (m_ClientVersionBit & EQ::versions::maskUFAndLater) + mypet->SayString(this, Chat::PetResponse, PET_NOW_HOLDING); + else + mypet->SayString(this, Chat::PetResponse, PET_ON_HOLD); - pet->SetHeld(true); + mypet->SetHeld(true); } - - pet->SetGHeld(false); - SetPetCommandState(PetButton::GreaterHold, PetButtonState::Off); - break; + mypet->SetGHeld(false); + SetPetCommandState(PET_BUTTON_GHOLD, 0); } - case PetCommand::HoldOn: { - if (!pet->IsHeld() || !aabonuses.PetCommands[s->command]) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { + break; + } + case PET_HOLD_ON: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && !mypet->IsHeld()) { + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) MessageString(Chat::PetResponse, PET_HOLD_SET_ON); - } - if (m_ClientVersionBit & EQ::versions::maskUFAndLater) { - pet->SayString(this, Chat::PetResponse, PET_NOW_HOLDING); - } else { - pet->SayString(this, Chat::PetResponse, PET_ON_HOLD); - } - - pet->SetHeld(true); - pet->SetGHeld(false); - SetPetCommandState(PetButton::GreaterHold, PetButtonState::Off); - break; + if (m_ClientVersionBit & EQ::versions::maskUFAndLater) + mypet->SayString(this, Chat::PetResponse, PET_NOW_HOLDING); + else + mypet->SayString(this, Chat::PetResponse, PET_ON_HOLD); + mypet->SetHeld(true); + mypet->SetGHeld(false); + SetPetCommandState(PET_BUTTON_GHOLD, 0); } - case PetCommand::HoldOff: { - if (!pet->IsHeld() || !aabonuses.PetCommands[s->command]) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { + break; + } + case PET_HOLD_OFF: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && mypet->IsHeld()) { + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) MessageString(Chat::PetResponse, PET_HOLD_SET_OFF); - } - - pet->SetHeld(false); - break; + mypet->SetHeld(false); } - case PetCommand::GreaterHold: { - if (!aabonuses.PetCommands[s->command]) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - if (pet->IsGHeld()) { - if (m_ClientVersionBit & EQ::versions::maskUFAndLater) { + break; + } + case PET_GHOLD: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { + if (mypet->IsGHeld()) + { + if (m_ClientVersionBit & EQ::versions::maskUFAndLater) MessageString(Chat::PetResponse, PET_OFF_GHOLD); - } - - pet->SetGHeld(false); - } else { + mypet->SetGHeld(false); + } + else + { if (m_ClientVersionBit & EQ::versions::maskUFAndLater) { MessageString(Chat::PetResponse, PET_ON_GHOLD); - pet->SayString(this, Chat::PetResponse, PET_GHOLD_ON_MSG); + mypet->SayString(this, Chat::PetResponse, PET_GHOLD_ON_MSG); } else { - pet->SayString(this, Chat::PetResponse, PET_ON_HOLD); + mypet->SayString(this, Chat::PetResponse, PET_ON_HOLD); } - - pet->SetGHeld(true); + mypet->SetGHeld(true); } - - pet->SetHeld(false); - SetPetCommandState(PetButton::Hold, PetButtonState::Off); - break; + mypet->SetHeld(false); + SetPetCommandState(PET_BUTTON_HOLD, 0); } - case PetCommand::GreaterHoldOn: { - if (!aabonuses.PetCommands[s->command]) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - + break; + } + case PET_GHOLD_ON: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { if (m_ClientVersionBit & EQ::versions::maskUFAndLater) { MessageString(Chat::PetResponse, PET_ON_GHOLD); - pet->SayString(this, Chat::PetResponse, PET_GHOLD_ON_MSG); + mypet->SayString(this, Chat::PetResponse, PET_GHOLD_ON_MSG); } else { - pet->SayString(this, Chat::PetResponse, PET_ON_HOLD); + mypet->SayString(this, Chat::PetResponse, PET_ON_HOLD); } - - pet->SetGHeld(true); - pet->SetHeld(false); - SetPetCommandState(PetButton::Hold, PetButtonState::Off); - break; + mypet->SetGHeld(true); + mypet->SetHeld(false); + SetPetCommandState(PET_BUTTON_HOLD, 0); } - case PetCommand::GreaterHoldOff: { - if (!pet->IsGHeld() || !aabonuses.PetCommands[s->command]) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - if (m_ClientVersionBit & EQ::versions::maskUFAndLater) { + break; + } + case PET_GHOLD_OFF: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && mypet->IsGHeld()) { + if (m_ClientVersionBit & EQ::versions::maskUFAndLater) MessageString(Chat::PetResponse, PET_OFF_GHOLD); - } - - pet->SetGHeld(false); - break; + mypet->SetGHeld(false); } - case PetCommand::SpellHold: { - if (pet->IsFeared() || !aabonuses.PetCommands[s->command]) { + break; + } + case PET_SPELLHOLD: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { + if (mypet->IsFeared()) break; + if (mypet->IsNoCast()) { + MessageString(Chat::PetResponse, PET_CASTING); + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) + MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_OFF); + mypet->SetNoCast(false); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - MessageString(Chat::PetResponse, pet->IsNoCast() ? PET_CASTING : PET_NOT_CASTING); - - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { - MessageString(Chat::PetResponse, pet->IsNoCast() ? PET_SPELLHOLD_SET_OFF : PET_SPELLHOLD_SET_ON); + else { + MessageString(Chat::PetResponse, PET_NOT_CASTING); + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) + MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_ON); + mypet->SetNoCast(true); } - - pet->SetNoCast(!pet->IsNoCast()); - break; } - case PetCommand::SpellHoldOn: { - if (pet->IsFeared() || pet->IsNoCast() || !aabonuses.PetCommands[s->command]) { + break; + } + case PET_SPELLHOLD_ON: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { + if (mypet->IsFeared()) break; + if (!mypet->IsNoCast()) { + MessageString(Chat::PetResponse, PET_NOT_CASTING); + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) + MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_ON); + mypet->SetNoCast(true); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - MessageString(Chat::PetResponse, PET_NOT_CASTING); - - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { - MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_ON); - } - - pet->SetNoCast(true); - break; } - case PetCommand::SpellHoldOff: { - if (pet->IsFeared() || !pet->IsNoCast() || !aabonuses.PetCommands[s->command]) { + break; + } + case PET_SPELLHOLD_OFF: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { + if (mypet->IsFeared()) break; + if (mypet->IsNoCast()) { + MessageString(Chat::PetResponse, PET_CASTING); + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) + MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_OFF); + mypet->SetNoCast(false); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - MessageString(Chat::PetResponse, PET_CASTING); - - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { - MessageString(Chat::PetResponse, PET_SPELLHOLD_SET_OFF); - } - - pet->SetNoCast(false); - break; } - case PetCommand::Focus: { - if (pet->IsFeared() || !aabonuses.PetCommands[s->command]) { + break; + } + case PET_FOCUS: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { + if (mypet->IsFeared()) break; + if (mypet->IsFocused()) { + MessageString(Chat::PetResponse, PET_NOT_FOCUSING); + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) + MessageString(Chat::PetResponse, PET_FOCUS_SET_OFF); + mypet->SetFocused(false); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - MessageString(Chat::PetResponse, pet->IsFocused() ? PET_NOT_FOCUSING : PET_NOW_FOCUSING); - - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { - MessageString(Chat::PetResponse, pet->IsFocused() ? PET_FOCUS_SET_OFF : PET_FOCUS_SET_ON); + else { + MessageString(Chat::PetResponse, PET_NOW_FOCUSING); + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) + MessageString(Chat::PetResponse, PET_FOCUS_SET_ON); + mypet->SetFocused(true); } - - pet->SetFocused(!pet->IsFocused()); - break; } - case PetCommand::FocusOn: { - if (pet->IsFeared() || pet->IsFocused() || !aabonuses.PetCommands[s->command]) { + break; + } + case PET_FOCUS_ON: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { + if (mypet->IsFeared()) break; + if (!mypet->IsFocused()) { + MessageString(Chat::PetResponse, PET_NOW_FOCUSING); + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) + MessageString(Chat::PetResponse, PET_FOCUS_SET_ON); + mypet->SetFocused(true); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - MessageString(Chat::PetResponse, PET_NOW_FOCUSING); - - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { - MessageString(Chat::PetResponse, PET_FOCUS_SET_ON); - } - - pet->SetFocused(true); - break; } - case PetCommand::FocusOff: { - if (pet->IsFeared() || !pet->IsFocused() || !aabonuses.PetCommands[s->command]) { + break; + } + case PET_FOCUS_OFF: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { + if (mypet->IsFeared()) break; + if (mypet->IsFocused()) { + MessageString(Chat::PetResponse, PET_NOT_FOCUSING); + if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) + MessageString(Chat::PetResponse, PET_FOCUS_SET_OFF); + mypet->SetFocused(false); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - MessageString(Chat::PetResponse, PET_NOT_FOCUSING); - - if (m_ClientVersionBit & EQ::versions::maskSoDAndLater) { - MessageString(Chat::PetResponse, PET_FOCUS_SET_OFF); - } - - pet->SetFocused(false); - break; } - case PetCommand::Feign: { - if (pet->IsFeared() || !aabonuses.PetCommands[s->command]) { + break; + } + + case PET_FEIGN: { + if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) { + if (mypet->IsFeared()) break; + + int pet_fd_chance = aabonuses.FeignedMinionChance; + if (zone->random.Int(0, 99) > pet_fd_chance) { + mypet->SetFeigned(false); + entity_list.MessageCloseString(this, false, 200, 10, STRING_FEIGNFAILED, mypet->GetCleanName()); } + else { + bool has_aggro_immunity = GetSpecialAbility(SpecialAbility::AggroImmunity); + mypet->SetSpecialAbility(SpecialAbility::AggroImmunity, 1); + mypet->WipeHateList(); + mypet->SetPetOrder(SPO_FeignDeath); + mypet->SetRunAnimSpeed(0); + mypet->StopNavigation(); + mypet->SetAppearance(eaDead); + mypet->SetFeigned(true); + mypet->SetTarget(nullptr); + if (!mypet->UseBardSpellLogic()) { + mypet->InterruptSpell(); + } - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; + if (!has_aggro_immunity) { + mypet->SetSpecialAbility(SpecialAbility::AggroImmunity, 0); + } + } + } + break; + } + case PET_STOP: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - if (zone->random.Int(0, 99) > aabonuses.FeignedMinionChance) { - pet->SetFeigned(false); - entity_list.MessageCloseString(this, false, 200, 10, STRING_FEIGNFAILED, pet->GetCleanName()); + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + if (mypet->IsPetStop()) { + mypet->SetPetStop(false); } else { - pet->SetSpecialAbility(SpecialAbility::AggroImmunity, 1); - pet->WipeHateList(); - pet->SetPetOrder(PetOrder::Feign); - pet->SetRunAnimSpeed(0); - pet->StopNavigation(); - pet->SetAppearance(eaDead); - pet->SetFeigned(true); - pet->SetTarget(nullptr); - - if (!pet->UseBardSpellLogic()) { - pet->InterruptSpell(); - } - - if (!GetSpecialAbility(SpecialAbility::AggroImmunity)) { - pet->SetSpecialAbility(SpecialAbility::AggroImmunity, 0); + mypet->SetPetStop(true); + mypet->StopNavigation(); + mypet->SetTarget(nullptr); + if (mypet->IsPetRegroup()) { + mypet->SetPetRegroup(false); + SetPetCommandState(PET_BUTTON_REGROUP, 0); } } - - break; + mypet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); } - case PetCommand::Stop: { - if (pet->IsFeared() || !can_use_command) { - break; + break; + } + case PET_STOP_ON: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF + + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + mypet->SetPetStop(true); + mypet->StopNavigation(); + mypet->SetTarget(nullptr); + mypet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); + if (mypet->IsPetRegroup()) { + mypet->SetPetRegroup(false); + SetPetCommandState(PET_BUTTON_REGROUP, 0); } + } + break; + } + case PET_STOP_OFF: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; + if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) { + mypet->SetPetStop(false); + mypet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); + } + break; + } + case PET_REGROUP: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - if (pet->IsPetStop()) { - pet->SetPetStop(false); + if (aabonuses.PetCommands[PetCommand]) { + if (mypet->IsPetRegroup()) { + mypet->SetPetRegroup(false); + mypet->SayString(this, Chat::PetResponse, PET_OFF_REGROUPING); } else { - pet->SetPetStop(true); - pet->StopNavigation(); - pet->SetTarget(nullptr); - - if (pet->IsPetRegroup()) { - pet->SetPetRegroup(false); - SetPetCommandState(PetButton::Regroup, PetButtonState::Off); + mypet->SetPetRegroup(true); + mypet->SetTarget(nullptr); + mypet->SayString(this, Chat::PetResponse, PET_ON_REGROUPING); + if (mypet->IsPetStop()) { + mypet->SetPetStop(false); + SetPetCommandState(PET_BUTTON_STOP, 0); } } - - pet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); - break; } - case PetCommand::StopOn: { - if (pet->IsFeared() || pet->IsPetStop() || !can_use_command) { - break; + break; + } + case PET_REGROUP_ON: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF + + if (aabonuses.PetCommands[PetCommand]) { + mypet->SetPetRegroup(true); + mypet->SetTarget(nullptr); + mypet->SayString(this, Chat::PetResponse, PET_ON_REGROUPING); + if (mypet->IsPetStop()) { + mypet->SetPetStop(false); + SetPetCommandState(PET_BUTTON_STOP, 0); } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetPetStop(true); - pet->StopNavigation(); - pet->SetTarget(nullptr); - pet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); - - if (pet->IsPetRegroup()) { - pet->SetPetRegroup(false); - SetPetCommandState(PetButton::Regroup, PetButtonState::Off); - } - - break; } - case PetCommand::StopOff: { - if (pet->IsFeared() || !pet->IsPetStop() || !can_use_command) { - break; - } + break; + } + case PET_REGROUP_OFF: { + if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetPetStop(false); - pet->SayString(this, Chat::PetResponse, PET_GETLOST_STRING); - break; - } - case PetCommand::Regroup: { - if (pet->IsFeared() || !aabonuses.PetCommands[s->command]) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - if (pet->IsPetRegroup()) { - pet->SetPetRegroup(false); - pet->SayString(this, Chat::PetResponse, PET_OFF_REGROUPING); - } else { - pet->SetPetRegroup(true); - pet->SetTarget(nullptr); - pet->SayString(this, Chat::PetResponse, PET_ON_REGROUPING); - - if (pet->IsPetStop()) { - pet->SetPetStop(false); - SetPetCommandState(PetButton::Stop, PetButtonState::Off); - } - } - - break; - } - case PetCommand::RegroupOn: { - if (pet->IsFeared() || pet->IsPetRegroup() || !aabonuses.PetCommands[s->command]) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetPetRegroup(true); - pet->SetTarget(nullptr); - pet->SayString(this, Chat::PetResponse, PET_ON_REGROUPING); - - if (pet->IsPetStop()) { - pet->SetPetStop(false); - SetPetCommandState(PetButton::Stop, PetButtonState::Off); - } - - break; - } - case PetCommand::RegroupOff: { - if (pet->IsFeared() || !pet->IsPetRegroup() || !aabonuses.PetCommands[s->command]) { - break; - } - - std::function f = [&s]() { - return PetCommand::GetName(s->command); - }; - - parse->EventMob(EVENT_PET_COMMAND, pet, CastToMob(), f, s->command); - parse->EventMob(EVENT_PET_COMMAND, CastToMob(), pet, f, s->command); - - pet->SetPetRegroup(false); - pet->SayString(this, Chat::PetResponse, PET_OFF_REGROUPING); - break; - } - default: { - LogError("[{}] attempted to use an unknown pet command: [{}]", GetCleanName(), s->command); - break; + if (aabonuses.PetCommands[PetCommand]) { + mypet->SetPetRegroup(false); + mypet->SayString(this, Chat::PetResponse, PET_OFF_REGROUPING); } + break; + } + default: + printf("Client attempted to use a unknown pet command:\n"); + break; } } - void Client::Handle_OP_Petition(const EQApplicationPacket *app) { if (app->size <= 1) diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 71144db89..e14985763 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1571,7 +1571,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app) if (from_bucket == &m_pp.platinum_shared) amount_to_add = 0 - amount_to_take; - database.SetSharedPlatinum(AccountID(),amount_to_add); + database.AddSharedPlatinum(AccountID(),amount_to_add); } } else{ diff --git a/zone/common.h b/zone/common.h index 4c187566d..6a11f7255 100644 --- a/zone/common.h +++ b/zone/common.h @@ -854,6 +854,66 @@ struct DataBucketCache uint32_t bucket_expires; }; +// Defines based on the RoF2 Client +#define PET_HEALTHREPORT 0 // 0x00 - /pet health or Pet Window +#define PET_LEADER 1 // 0x01 - /pet leader or Pet Window +#define PET_ATTACK 2 // 0x02 - /pet attack or Pet Window +#define PET_QATTACK 3 // 0x03 - /pet qattack or Pet Window +#define PET_FOLLOWME 4 // 0x04 - /pet follow or Pet Window +#define PET_GUARDHERE 5 // 0x05 - /pet guard or Pet Window +#define PET_SIT 6 // 0x06 - /pet sit or Pet Window +#define PET_SITDOWN 7 // 0x07 - /pet sit on +#define PET_STANDUP 8 // 0x08 - /pet sit off +#define PET_STOP 9 // 0x09 - /pet stop or Pet Window - Not implemented +#define PET_STOP_ON 10 // 0x0a - /pet stop on - Not implemented +#define PET_STOP_OFF 11 // 0x0b - /pet stop off - Not implemented +#define PET_TAUNT 12 // 0x0c - /pet taunt or Pet Window +#define PET_TAUNT_ON 13 // 0x0d - /pet taunt on +#define PET_TAUNT_OFF 14 // 0x0e - /pet taunt off +#define PET_HOLD 15 // 0x0f - /pet hold or Pet Window, won't add to hate list unless attacking +#define PET_HOLD_ON 16 // 0x10 - /pet hold on +#define PET_HOLD_OFF 17 // 0x11 - /pet hold off +#define PET_GHOLD 18 // 0x12 - /pet ghold, will never add to hate list unless told to +#define PET_GHOLD_ON 19 // 0x13 - /pet ghold on +#define PET_GHOLD_OFF 20 // 0x14 - /pet ghold off +#define PET_SPELLHOLD 21 // 0x15 - /pet no cast or /pet spellhold or Pet Window +#define PET_SPELLHOLD_ON 22 // 0x16 - /pet spellhold on +#define PET_SPELLHOLD_OFF 23 // 0x17 - /pet spellhold off +#define PET_FOCUS 24 // 0x18 - /pet focus or Pet Window +#define PET_FOCUS_ON 25 // 0x19 - /pet focus on +#define PET_FOCUS_OFF 26 // 0x1a - /pet focus off +#define PET_FEIGN 27 // 0x1b - /pet feign +#define PET_BACKOFF 28 // 0x1c - /pet back off +#define PET_GETLOST 29 // 0x1d - /pet get lost +#define PET_GUARDME 30 // 0x1e - Same as /pet follow, but different message in older clients - define not from client /pet target in modern clients but doesn't send packet +#define PET_REGROUP 31 // 0x1f - /pet regroup, acts like classic hold. Stops attack and moves back to guard/you but doesn't clear hate list +#define PET_REGROUP_ON 32 // 0x20 - /pet regroup on, turns on regroup +#define PET_REGROUP_OFF 33 // 0x21 - /pet regroup off, turns off regroup +#define PET_MAXCOMMANDS PET_REGROUP_OFF + 1 + +// can change the state of these buttons with a packet +#define PET_BUTTON_SIT 0 +#define PET_BUTTON_STOP 1 +#define PET_BUTTON_REGROUP 2 +#define PET_BUTTON_FOLLOW 3 +#define PET_BUTTON_GUARD 4 +#define PET_BUTTON_TAUNT 5 +#define PET_BUTTON_HOLD 6 +#define PET_BUTTON_GHOLD 7 +#define PET_BUTTON_FOCUS 8 +#define PET_BUTTON_SPELLHOLD 9 + +enum eStandingPetOrder { SPO_Follow, SPO_Sit, SPO_Guard, SPO_FeignDeath }; + +typedef enum { + petFamiliar, //only listens to /pet get lost + petAnimation, //does not listen to any commands + petOther, + petCharmed, + petNPCFollow, + petTargetLock, //remain active as long something is on the hatelist. Don't listen to any commands + petNone = 0xFF // not a pet +} PetTypeOld; #endif diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 6d220b8d8..ad9708d52 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -208,6 +208,8 @@ const char* QuestEventSubroutines[_LargestEventID] = { "EVENT_SPELL_BLOCKED", "EVENT_READ_ITEM", "EVENT_PET_COMMAND", + "EVENT_CHARM_START", + "EVENT_CHARM_END", // Add new events before these or Lua crashes "EVENT_SPELL_EFFECT_BOT", diff --git a/zone/event_codes.h b/zone/event_codes.h index 0d14f565d..ff345abff 100644 --- a/zone/event_codes.h +++ b/zone/event_codes.h @@ -146,6 +146,8 @@ typedef enum { EVENT_SPELL_BLOCKED, EVENT_READ_ITEM, EVENT_PET_COMMAND, + EVENT_CHARM_START, + EVENT_CHARM_END, // Add new events before these or Lua crashes EVENT_SPELL_EFFECT_BOT, diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index ae8c4b2af..1873aec0b 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -6992,7 +6992,9 @@ luabind::scope lua_register_events() { luabind::value("entity_variable_update", static_cast(EVENT_ENTITY_VARIABLE_UPDATE)), luabind::value("aa_loss", static_cast(EVENT_AA_LOSS)), luabind::value("read", static_cast(EVENT_READ_ITEM)), - luabind::value("pet_command", static_cast(EVENT_PET_COMMAND)) + luabind::value("pet_command", static_cast(EVENT_PET_COMMAND)), + luabind::value("charm_start", static_cast(EVENT_CHARM_START)), + luabind::value("charm_end", static_cast(EVENT_CHARM_END)) )]; } diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index c3f37aec5..3e3a5257f 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -189,7 +189,9 @@ const char *LuaEvents[_LargestEventID] = { "event_aa_loss", "event_spell_blocked", "event_read_item", - "event_pet_command" + "event_pet_command", + "event_charm_start", + "event_charm_end" }; extern Zone *zone; @@ -266,6 +268,8 @@ LuaParser::LuaParser() { NPCArgumentDispatch[EVENT_ENTITY_VARIABLE_UPDATE] = handle_npc_entity_variable; NPCArgumentDispatch[EVENT_SPELL_BLOCKED] = handle_npc_spell_blocked; NPCArgumentDispatch[EVENT_PET_COMMAND] = handle_npc_pet_command; + NPCArgumentDispatch[EVENT_CHARM_START] = handle_npc_single_mob; + NPCArgumentDispatch[EVENT_CHARM_END] = handle_npc_single_mob; PlayerArgumentDispatch[EVENT_SAY] = handle_player_say; PlayerArgumentDispatch[EVENT_ENVIRONMENTAL_DAMAGE] = handle_player_environmental_damage; diff --git a/zone/npc.cpp b/zone/npc.cpp index 8f12645b7..0a91d8e52 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -2274,9 +2274,9 @@ void NPC::SetLevel(uint8 in_level, bool command) void NPC::ModifyNPCStat(const std::string& stat, const std::string& value) { - auto stat_lower = Strings::ToLower(stat); + const std::string& stat_lower = Strings::ToLower(stat); - auto variable_key = fmt::format( + const std::string& variable_key = fmt::format( "modify_stat_{}", stat_lower ); @@ -2288,40 +2288,24 @@ void NPC::ModifyNPCStat(const std::string& stat, const std::string& value) if (stat_lower == "ac") { AC = Strings::ToInt(value); CalcAC(); - return; - } - else if (stat_lower == "str") { + } else if (stat_lower == "str") { STR = Strings::ToInt(value); - return; - } - else if (stat_lower == "sta") { + } else if (stat_lower == "sta") { STA = Strings::ToInt(value); - return; - } - else if (stat_lower == "agi") { + } else if (stat_lower == "agi") { AGI = Strings::ToInt(value); CalcAC(); - return; - } - else if (stat_lower == "dex") { + } else if (stat_lower == "dex") { DEX = Strings::ToInt(value); - return; - } - else if (stat_lower == "wis") { + } else if (stat_lower == "wis") { WIS = Strings::ToInt(value); CalcMaxMana(); - return; - } - else if (stat_lower == "int" || stat_lower == "_int") { + } else if (stat_lower == "int" || stat_lower == "_int") { INT = Strings::ToInt(value); CalcMaxMana(); - return; - } - else if (stat_lower == "cha") { + } else if (stat_lower == "cha") { CHA = Strings::ToInt(value); - return; - } - else if (stat_lower == "max_hp") { + } else if (stat_lower == "max_hp") { base_hp = Strings::ToBigInt(value); CalcMaxHP(); @@ -2329,45 +2313,27 @@ void NPC::ModifyNPCStat(const std::string& stat, const std::string& value) current_hp = max_hp; } - return; - } - else if (stat_lower == "max_mana") { + } else if (stat_lower == "max_mana") { npc_mana = Strings::ToUnsignedBigInt(value); CalcMaxMana(); if (current_mana > max_mana) { current_mana = max_mana; } - return; - } - else if (stat_lower == "mr") { + } else if (stat_lower == "mr") { MR = Strings::ToInt(value); - return; - } - else if (stat_lower == "fr") { + } else if (stat_lower == "fr") { FR = Strings::ToInt(value); - return; - } - else if (stat_lower == "cr") { + } else if (stat_lower == "cr") { CR = Strings::ToInt(value); - return; - } - else if (stat_lower == "cor") { + } else if (stat_lower == "cor") { Corrup = Strings::ToInt(value); - return; - } - else if (stat_lower == "pr") { + } else if (stat_lower == "pr") { PR = Strings::ToInt(value); - return; - } - else if (stat_lower == "dr") { + } else if (stat_lower == "dr") { DR = Strings::ToInt(value); - return; - } - else if (stat_lower == "phr") { + } else if (stat_lower == "phr") { PhR = Strings::ToInt(value); - return; - } - else if (stat_lower == "runspeed") { + } else if (stat_lower == "runspeed") { runspeed = Strings::ToFloat(value); base_runspeed = (int) (runspeed * 40.0f); base_walkspeed = base_runspeed * 100 / 265; @@ -2375,297 +2341,229 @@ void NPC::ModifyNPCStat(const std::string& stat, const std::string& value) base_fearspeed = base_runspeed * 100 / 127; fearspeed = ((float) base_fearspeed) * 0.025f; CalcBonuses(); - return; - } - else if (stat_lower == "special_attacks") { + } else if (stat_lower == "special_attacks") { NPCSpecialAttacks(value.c_str(), 0, true); - return; - } - else if (stat_lower == "special_abilities") { + } else if (stat_lower == "special_abilities") { ProcessSpecialAbilities(value); - return; - } - else if (stat_lower == "attack_speed") { + } else if (stat_lower == "attack_speed") { attack_speed = Strings::ToFloat(value); CalcBonuses(); - return; - } - else if (stat_lower == "attack_delay") { + } else if (stat_lower == "attack_delay") { /* TODO: fix DB */ attack_delay = Strings::ToInt(value) * 100; CalcBonuses(); - return; - } - else if (stat_lower == "atk") { + } else if (stat_lower == "atk") { ATK = Strings::ToInt(value); - return; - } - else if (stat_lower == "accuracy") { + } else if (stat_lower == "accuracy") { accuracy_rating = Strings::ToInt(value); - return; - } - else if (stat_lower == "avoidance") { + } else if (stat_lower == "avoidance") { avoidance_rating = Strings::ToInt(value); - return; - } - else if (stat_lower == "trackable") { + } else if (stat_lower == "trackable") { trackable = Strings::ToInt(value); - return; - } - else if (stat_lower == "min_hit") { - min_dmg = Strings::ToInt(value); + } else if (stat_lower == "min_hit") { + min_dmg = Strings::ToInt(value); // Clamp max_dmg to be >= min_dmg - max_dmg = std::max(min_dmg, max_dmg); + max_dmg = std::max(min_dmg, max_dmg); base_damage = round((max_dmg - min_dmg) / 1.9); min_damage = min_dmg - round(base_damage / 10.0); - return; - } - else if (stat_lower == "max_hit") { - max_dmg = Strings::ToInt(value); + } else if (stat_lower == "max_hit") { + max_dmg = Strings::ToInt(value); // Clamp min_dmg to be <= max_dmg - min_dmg = std::min(min_dmg, max_dmg); + min_dmg = std::min(min_dmg, max_dmg); base_damage = round((max_dmg - min_dmg) / 1.9); min_damage = min_dmg - round(base_damage / 10.0); - return; - } - else if (stat_lower == "attack_count") { + } else if (stat_lower == "attack_count") { attack_count = Strings::ToInt(value); - return; - } - else if (stat_lower == "see_invis") { + } else if (stat_lower == "see_invis") { see_invis = Strings::ToInt(value); - return; - } - else if (stat_lower == "see_invis_undead") { + } else if (stat_lower == "see_invis_undead") { see_invis_undead = Strings::ToInt(value); - return; - } - else if (stat_lower == "see_hide") { + } else if (stat_lower == "see_hide") { see_hide = Strings::ToInt(value); - return; - } - else if (stat_lower == "see_improved_hide") { + } else if (stat_lower == "see_improved_hide") { see_improved_hide = Strings::ToInt(value); - return; - } - else if (stat_lower == "hp_regen") { + } else if (stat_lower == "hp_regen") { hp_regen = Strings::ToBigInt(value); - return; - } - else if (stat_lower == "hp_regen_per_second") { + } else if (stat_lower == "hp_regen_per_second") { hp_regen_per_second = Strings::ToBigInt(value); - return; - } - else if (stat_lower == "mana_regen") { + } else if (stat_lower == "mana_regen") { mana_regen = Strings::ToBigInt(value); - return; - } - else if (stat_lower == "level") { + } else if (stat_lower == "level") { SetLevel(Strings::ToInt(value)); - return; - } - else if (stat_lower == "aggro") { + } else if (stat_lower == "aggro") { pAggroRange = Strings::ToFloat(value); - return; - } - else if (stat_lower == "assist") { + } else if (stat_lower == "assist") { pAssistRange = Strings::ToFloat(value); - return; - } - else if (stat_lower == "slow_mitigation") { + } else if (stat_lower == "slow_mitigation") { slow_mitigation = Strings::ToInt(value); - return; - } - else if (stat_lower == "loottable_id") { + } else if (stat_lower == "loottable_id") { m_loottable_id = Strings::ToFloat(value); - return; - } - else if (stat_lower == "healscale") { + } else if (stat_lower == "healscale") { healscale = Strings::ToFloat(value); - return; - } - else if (stat_lower == "spellscale") { + } else if (stat_lower == "spellscale") { spellscale = Strings::ToFloat(value); - return; - } - else if (stat_lower == "npc_spells_id") { + } else if (stat_lower == "npc_spells_id") { AI_AddNPCSpells(Strings::ToInt(value)); - return; - } - else if (stat_lower == "npc_spells_effects_id") { + } else if (stat_lower == "npc_spells_effects_id") { AI_AddNPCSpellsEffects(Strings::ToInt(value)); CalcBonuses(); - return; - } - else if (stat_lower == "heroic_strikethrough") { + } else if (stat_lower == "heroic_strikethrough") { heroic_strikethrough = Strings::ToInt(value); - return; - } - else if (stat_lower == "keeps_sold_items") { + } else if (stat_lower == "keeps_sold_items") { SetKeepsSoldItems(Strings::ToBool(value)); - return; + } else if (stat_lower == "charm_ac") { + charm_ac = Strings::ToInt(value); + } else if (stat_lower == "charm_min_dmg") { + charm_min_dmg = Strings::ToInt(value); + } else if (stat_lower == "charm_max_dmg") { + charm_max_dmg = Strings::ToInt(value); + } else if (stat_lower == "charm_attack_delay") { + charm_attack_delay = Strings::ToInt(value); + } else if (stat_lower == "charm_accuracy_rating") { + charm_accuracy_rating = Strings::ToInt(value); + } else if (stat_lower == "charm_avoidance_rating") { + charm_avoidance_rating = Strings::ToInt(value); + } else if (stat_lower == "charm_atk") { + charm_atk = Strings::ToInt(value); + } else if (stat_lower == "default_ac") { + default_ac = Strings::ToInt(value); + } else if (stat_lower == "default_min_dmg") { + default_min_dmg = Strings::ToInt(value); + } else if (stat_lower == "default_max_dmg") { + default_max_dmg = Strings::ToInt(value); + } else if (stat_lower == "default_attack_delay") { + default_attack_delay = Strings::ToInt(value); + } else if (stat_lower == "default_accuracy_rating") { + default_accuracy_rating = Strings::ToInt(value); + } else if (stat_lower == "default_avoidance_rating") { + default_avoidance_rating = Strings::ToInt(value); + } else if (stat_lower == "default_atk") { + default_atk = Strings::ToInt(value); } } float NPC::GetNPCStat(const std::string& stat) { + const std::string& stat_lower = Strings::ToLower(stat); - if (auto stat_lower = Strings::ToLower(stat); stat_lower == "ac") { + if (stat_lower == "ac") { return AC; - } - else if (stat_lower == "str") { + } else if (stat_lower == "str") { return STR; - } - else if (stat_lower == "sta") { + } else if (stat_lower == "sta") { return STA; - } - else if (stat_lower == "agi") { + } else if (stat_lower == "agi") { return AGI; - } - else if (stat_lower == "dex") { + } else if (stat_lower == "dex") { return DEX; - } - else if (stat_lower == "wis") { + } else if (stat_lower == "wis") { return WIS; - } - else if (stat_lower == "int" || stat_lower == "_int") { + } else if (stat_lower == "int" || stat_lower == "_int") { return INT; - } - else if (stat_lower == "cha") { + } else if (stat_lower == "cha") { return CHA; - } - else if (stat_lower == "max_hp") { + } else if (stat_lower == "max_hp") { return base_hp; - } - else if (stat_lower == "max_mana") { + } else if (stat_lower == "max_mana") { return npc_mana; - } - else if (stat_lower == "mr") { + } else if (stat_lower == "mr") { return MR; - } - else if (stat_lower == "fr") { + } else if (stat_lower == "fr") { return FR; - } - else if (stat_lower == "cr") { + } else if (stat_lower == "cr") { return CR; - } - else if (stat_lower == "cor") { + } else if (stat_lower == "cor") { return Corrup; - } - else if (stat_lower == "phr") { + } else if (stat_lower == "phr") { return PhR; - } - else if (stat_lower == "pr") { + } else if (stat_lower == "pr") { return PR; - } - else if (stat_lower == "dr") { + } else if (stat_lower == "dr") { return DR; - } - else if (stat_lower == "runspeed") { + } else if (stat_lower == "runspeed") { return runspeed; - } - else if (stat_lower == "attack_speed") { + } else if (stat_lower == "attack_speed") { return attack_speed; - } - else if (stat_lower == "attack_delay") { + } else if (stat_lower == "attack_delay") { return attack_delay; - } - else if (stat_lower == "atk") { + } else if (stat_lower == "atk") { return ATK; - } - else if (stat_lower == "accuracy") { + } else if (stat_lower == "accuracy") { return accuracy_rating; - } - else if (stat_lower == "avoidance") { + } else if (stat_lower == "avoidance") { return avoidance_rating; - } - else if (stat_lower == "trackable") { + } else if (stat_lower == "trackable") { return trackable; - } - else if (stat_lower == "min_hit") { + } else if (stat_lower == "min_hit") { return min_dmg; - } - else if (stat_lower == "max_hit") { + } else if (stat_lower == "max_hit") { return max_dmg; - } - else if (stat_lower == "attack_count") { + } else if (stat_lower == "attack_count") { return attack_count; - } - else if (stat_lower == "see_invis") { + } else if (stat_lower == "see_invis") { return see_invis; - } - else if (stat_lower == "see_invis_undead") { + } else if (stat_lower == "see_invis_undead") { return see_invis_undead; - } - else if (stat_lower == "see_hide") { + } else if (stat_lower == "see_hide") { return see_hide; - } - else if (stat_lower == "see_improved_hide") { + } else if (stat_lower == "see_improved_hide") { return see_improved_hide; - } - else if (stat_lower == "hp_regen") { + } else if (stat_lower == "hp_regen") { return hp_regen; - } - else if (stat_lower == "hp_regen_per_second") { + } else if (stat_lower == "hp_regen_per_second") { return hp_regen_per_second; - } - else if (stat_lower == "mana_regen") { + } else if (stat_lower == "mana_regen") { return mana_regen; - } - else if (stat_lower == "level") { + } else if (stat_lower == "level") { return GetOrigLevel(); - } - else if (stat_lower == "aggro") { + } else if (stat_lower == "aggro") { return pAggroRange; - } - else if (stat_lower == "assist") { + } else if (stat_lower == "assist") { return pAssistRange; - } - else if (stat_lower == "slow_mitigation") { + } else if (stat_lower == "slow_mitigation") { return slow_mitigation; - } - else if (stat_lower == "loottable_id") { + } else if (stat_lower == "loottable_id") { return m_loottable_id; - } - else if (stat_lower == "healscale") { + } else if (stat_lower == "healscale") { return healscale; - } - else if (stat_lower == "spellscale") { + } else if (stat_lower == "spellscale") { return spellscale; - } - else if (stat_lower == "npc_spells_id") { + } else if (stat_lower == "npc_spells_id") { return npc_spells_id; - } - else if (stat_lower == "npc_spells_effects_id") { + } else if (stat_lower == "npc_spells_effects_id") { return npc_spells_effects_id; - } - else if (stat_lower == "heroic_strikethrough") { + } else if (stat_lower == "heroic_strikethrough") { return heroic_strikethrough; - } - else if (stat_lower == "keeps_sold_items") { + } else if (stat_lower == "keeps_sold_items") { return keeps_sold_items; - } - //default values - else if (stat_lower == "default_ac") { + } else if (stat_lower == "default_ac") { return default_ac; - } - else if (stat_lower == "default_min_hit") { + } else if (stat_lower == "default_min_hit") { return default_min_dmg; - } - else if (stat_lower == "default_max_hit") { + } else if (stat_lower == "default_max_hit") { return default_max_dmg; - } - else if (stat_lower == "default_attack_delay") { + } else if (stat_lower == "default_attack_delay") { return default_attack_delay; - } - else if (stat_lower == "default_accuracy") { + } else if (stat_lower == "default_accuracy") { return default_accuracy_rating; - } - else if (stat_lower == "default_avoidance") { + } else if (stat_lower == "default_avoidance") { return default_avoidance_rating; - } - else if (stat_lower == "default_atk") { + } else if (stat_lower == "default_atk") { return default_atk; + } else if (stat_lower == "charm_ac") { + return charm_ac; + } else if (stat_lower == "charm_min_hit") { + return charm_min_dmg; + } else if (stat_lower == "charm_max_hit") { + return charm_max_dmg; + } else if (stat_lower == "charm_attack_delay") { + return charm_attack_delay; + } else if (stat_lower == "charm_accuracy") { + return charm_accuracy_rating; + } else if (stat_lower == "charm_avoidance") { + return charm_avoidance_rating; + } else if (stat_lower == "charm_atk") { + return charm_atk; } return 0.0f; @@ -3387,62 +3285,55 @@ void NPC::DepopSwarmPets() } } -void NPC::ModifyStatsOnCharm(bool is_charm_removed) +void NPC::ModifyStatsOnCharm(bool remove_charm, Mob* charmer) { - if (is_charm_removed) { - if (charm_ac) { - AC = default_ac; - } - if (charm_attack_delay) { - attack_delay = default_attack_delay; - } - if (charm_accuracy_rating) { - accuracy_rating = default_accuracy_rating; - } - if (charm_avoidance_rating) { - avoidance_rating = default_avoidance_rating; - } - if (charm_atk) { - ATK = default_atk; - } - if (charm_min_dmg || charm_max_dmg) { - base_damage = round((default_max_dmg - default_min_dmg) / 1.9); - min_damage = default_min_dmg - round(base_damage / 10.0); - } - if (RuleB(Spells, CharmDisablesSpecialAbilities)) { - ProcessSpecialAbilities(default_special_abilities); - } - - SetAttackTimer(); - CalcAC(); - - return; + if (!remove_charm && parse->HasQuestSub(GetNPCTypeID(), EVENT_CHARM_START)) { + parse->EventNPC(EVENT_CHARM_START, this, charmer, "", 0); + } else if (remove_charm && parse->HasQuestSub(GetNPCTypeID(), EVENT_CHARM_END)) { + parse->EventNPC(EVENT_CHARM_END, this, charmer, "", 0); } - if (charm_ac) { - AC = charm_ac; + const int new_ac = remove_charm ? default_ac : charm_ac; + const int new_attack_delay = remove_charm ? default_attack_delay : charm_attack_delay; + const int new_accuracy_rating = remove_charm ? default_accuracy_rating : charm_accuracy_rating; + const int new_avoidance_rating = remove_charm ? default_avoidance_rating : charm_avoidance_rating; + const int new_atk = remove_charm ? default_atk : charm_atk; + const int new_min_dmg = remove_charm ? default_min_dmg : charm_min_dmg; + const int new_max_dmg = remove_charm ? default_max_dmg : charm_max_dmg; + + if (new_ac) { + AC = new_ac; } - if (charm_attack_delay) { - attack_delay = charm_attack_delay; + + if (new_attack_delay) { + attack_delay = new_attack_delay; } - if (charm_accuracy_rating) { - accuracy_rating = charm_accuracy_rating; + + if (new_accuracy_rating) { + accuracy_rating = new_accuracy_rating; } - if (charm_avoidance_rating) { - avoidance_rating = charm_avoidance_rating; + + if (new_avoidance_rating) { + avoidance_rating = new_avoidance_rating; } - if (charm_atk) { - ATK = charm_atk; + + if (new_atk) { + ATK = new_atk; } - if (charm_min_dmg || charm_max_dmg) { - base_damage = round((charm_max_dmg - charm_min_dmg) / 1.9); - min_damage = charm_min_dmg - round(base_damage / 10.0); + + if (new_min_dmg || new_max_dmg) { + base_damage = std::round((new_max_dmg - new_min_dmg) / 1.9); + min_damage = new_min_dmg - std::round(base_damage / 10.0); } + if (RuleB(Spells, CharmDisablesSpecialAbilities)) { - ClearSpecialAbilities(); + if (remove_charm) { + ProcessSpecialAbilities(default_special_abilities); + } else { + ClearSpecialAbilities(); + } } - // the rest of the stats aren't cached, so lets just do these two instead of full CalcBonuses() SetAttackTimer(); CalcAC(); } diff --git a/zone/npc.h b/zone/npc.h index 4c4d3cb1b..90569d12b 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -346,7 +346,7 @@ public: int64 GetNPCHPRegen() const { return hp_regen + itembonuses.HPRegen + spellbonuses.HPRegen; } inline const char* GetAmmoIDfile() const { return ammo_idfile; } - void ModifyStatsOnCharm(bool is_charm_removed); + void ModifyStatsOnCharm(bool remove_charm, Mob* charmer); //waypoint crap int GetMaxWp() const { return max_wp; } diff --git a/zone/parcels.cpp b/zone/parcels.cpp index 4ef3b1a2b..f1dc874c1 100644 --- a/zone/parcels.cpp +++ b/zone/parcels.cpp @@ -61,6 +61,7 @@ void Client::SendBulkParcels() inst->SetCharges(p.second.quantity); inst->SetMerchantCount(1); inst->SetMerchantSlot(p.second.slot_id); + inst->SetEvolveCurrentAmount(p.second.evolve_amount); if (inst->IsStackable()) { inst->SetCharges(p.second.quantity); } @@ -164,6 +165,7 @@ void Client::SendParcel(Parcel_Struct &parcel_in) inst->SetCharges(p.quantity); inst->SetMerchantCount(1); inst->SetMerchantSlot(p.slot_id); + inst->SetEvolveCurrentAmount(p.evolve_amount); if (inst->IsStackable()) { inst->SetCharges(p.quantity); } @@ -381,23 +383,23 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in) return; } - uint32 quantity{}; + uint32 quantity = 1; if (inst->IsStackable()) { quantity = parcel_in->quantity; - } - else { - quantity = inst->GetCharges() >= 0 ? inst->GetCharges() : parcel_in->quantity; + } else if (inst->GetItem()->MaxCharges > 0) { + quantity = inst->GetCharges(); } CharacterParcelsRepository::CharacterParcels parcel_out{}; - parcel_out.from_name = GetName(); - parcel_out.note = parcel_in->note; - parcel_out.sent_date = time(nullptr); - parcel_out.quantity = quantity; - parcel_out.item_id = inst->GetID(); - parcel_out.char_id = send_to_client.at(0).char_id; - parcel_out.slot_id = next_slot; - parcel_out.id = 0; + parcel_out.from_name = GetName(); + parcel_out.note = parcel_in->note; + parcel_out.sent_date = time(nullptr); + parcel_out.quantity = quantity; + parcel_out.item_id = inst->GetID(); + parcel_out.char_id = send_to_client.at(0).char_id; + parcel_out.slot_id = next_slot; + parcel_out.evolve_amount = inst->GetEvolveCurrentAmount(); + parcel_out.id = 0; if (inst->IsAugmented()) { auto augs = inst->GetAugmentIDs(); @@ -445,7 +447,9 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in) cpc.aug_slot_5 = augs.at(4); cpc.aug_slot_6 = augs.at(5); } - cpc.quantity = kv.second->GetCharges() >= 0 ? kv.second->GetCharges() : 1; + + cpc.quantity = kv.second->GetCharges() >= 0 ? kv.second->GetCharges() : 1; + cpc.evolve_amount = kv.second->GetEvolveCurrentAmount(); all_entries.push_back(cpc); } CharacterParcelsContainersRepository::InsertMany(database, all_entries); @@ -679,6 +683,8 @@ void Client::DoParcelRetrieve(const ParcelRetrieve_Struct &parcel_in) return; } + inst->SetEvolveCurrentAmount(p->second.evolve_amount); + if (inst->IsStackable()) { inst->SetCharges(item_quantity > 0 ? item_quantity : 1); } @@ -715,6 +721,8 @@ void Client::DoParcelRetrieve(const ParcelRetrieve_Struct &parcel_in) return; } + item->SetEvolveCurrentAmount(i.evolve_amount); + if (CheckLoreConflict(item->GetItem())) { if (RuleB(Parcel, DeleteOnDuplicate)) { MessageString(Chat::Yellow, PARCEL_DUPLICATE_DELETE, inst->GetItem()->Name); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 145c4f67a..42078e322 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -835,12 +835,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove SendAppearancePacket(AppearanceType::Pet, caster->GetID(), true, true); } - if (IsClient()) - { + if (IsClient()) { CastToClient()->AI_Start(); - } else if(IsNPC()) { - CastToNPC()->SetPetSpellID(0); //not a pet spell. - CastToNPC()->ModifyStatsOnCharm(false); + } else if (IsNPC()) { + CastToNPC()->SetPetSpellID(0); //not a pet spell. + CastToNPC()->ModifyStatsOnCharm(false, caster); } bool bBreak = false; @@ -4418,10 +4417,9 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) case SpellEffect::Charm: { - if(IsNPC()) - { + if (IsNPC()) { CastToNPC()->RestoreGuardSpotCharm(); - CastToNPC()->ModifyStatsOnCharm(true); + CastToNPC()->ModifyStatsOnCharm(true, GetOwner()); } SendAppearancePacket(AppearanceType::Pet, 0, true, true);