From 18df055f16e622cdba39ed7eb1cec6dad1573651 Mon Sep 17 00:00:00 2001 From: dannuic Date: Sat, 2 May 2026 22:53:26 -0600 Subject: [PATCH] Add Buff infrastructure to go through different logic paths from different patches (#5073) --- common/CMakeLists.txt | 1 + common/database/database_update_manifest.h | 19 + .../database/database_update_manifest_bots.h | 18 +- common/emu_oplist.h | 8 +- common/eq_packet_structs.h | 36 +- common/events/player_events.h | 4 +- common/links.cpp | 2 +- common/links.h | 2 +- common/patches/IBuff.h | 60 +++ common/patches/IMessage.h | 8 +- common/patches/client_version.cpp | 55 ++- common/patches/client_version.h | 35 +- common/patches/deprecated_sof_opcode_list.h | 2 +- common/patches/rof.cpp | 107 +---- common/patches/rof.h | 48 +-- common/patches/rof2.cpp | 104 +---- common/patches/rof2.h | 48 +-- common/patches/rof2_ops.h | 7 +- common/patches/rof2_structs.h | 22 +- common/patches/rof_ops.h | 7 +- common/patches/rof_structs.h | 22 +- common/patches/sod.cpp | 134 +++---- common/patches/sod.h | 60 ++- common/patches/sod_ops.h | 6 +- common/patches/sod_structs.h | 18 +- common/patches/sof.cpp | 43 +-- common/patches/sof.h | 48 +-- common/patches/sof_ops.h | 5 +- common/patches/sof_structs.h | 18 +- common/patches/template.h | 33 +- common/patches/titanium.cpp | 152 +++++--- common/patches/titanium.h | 74 ++-- common/patches/titanium_ops.h | 5 +- common/patches/titanium_structs.h | 18 +- common/patches/tob.cpp | 308 ++++++++------- common/patches/tob.h | 93 +++-- common/patches/tob_limits.h | 6 +- common/patches/tob_ops.h | 3 +- common/patches/tob_structs.h | 40 +- common/patches/uf.cpp | 162 +++----- common/patches/uf.h | 59 ++- common/patches/uf_ops.h | 7 +- common/patches/uf_structs.h | 22 +- .../base/base_blocked_spells_repository.h | 2 +- .../base/base_bot_blocked_buffs_repository.h | 2 +- .../base/base_bot_buffs_repository.h | 2 +- .../base/base_bot_pet_buffs_repository.h | 2 +- .../base/base_bot_pets_repository.h | 2 +- .../base/base_bot_spell_settings_repository.h | 2 +- .../base/base_bot_spells_entries_repository.h | 2 +- .../base/base_bot_timers_repository.h | 2 +- .../base/base_character_buffs_repository.h | 2 +- .../base_character_memmed_spells_repository.h | 2 +- .../base/base_character_spells_repository.h | 2 +- .../base/base_damageshieldtypes_repository.h | 2 +- .../base_ldon_trap_templates_repository.h | 2 +- .../base/base_merc_buffs_repository.h | 2 +- .../base_merc_spell_list_entries_repository.h | 2 +- .../base/base_npc_spells_entries_repository.h | 2 +- .../base/base_spell_buckets_repository.h | 2 +- common/servertalk.h | 4 +- common/spdat.cpp | 296 +++++++------- common/spdat.h | 305 ++++++++------- common/spdat_bot.cpp | 4 +- common/version.h | 4 +- tob/opcodes.md | 10 +- .../EQExtractor2/patch_April15-2013.conf | 8 +- .../EQExtractor2/patch_Aug04-2011.conf | 8 +- .../EQExtractor2/patch_August15-2012.conf | 8 +- .../EQExtractor2/patch_Dec10-2012.conf | 8 +- .../EQExtractor2/patch_Dec7-2010.conf | 8 +- .../EQExtractor2/patch_Feb11-2013.conf | 8 +- .../EQExtractor2/patch_Feb8-2011.conf | 8 +- .../EQExtractor2/patch_Jan16-2013.conf | 8 +- .../EQExtractor2/patch_July13-2012.conf | 8 +- .../EQExtractor2/patch_June25-2012.conf | 8 +- .../EQExtractor2/patch_Mar13-2013.conf | 8 +- .../EQExtractor2/patch_Mar15-2012.conf | 8 +- .../EQExtractor2/patch_March15-2011.conf | 8 +- .../EQExtractor2/patch_May12-2010.conf | 8 +- .../EQExtractor2/patch_May12-2011.conf | 8 +- .../EQExtractor2/patch_Nov17-2011.conf | 8 +- .../EQExtractor2/patch_Sep01-2010.conf | 8 +- .../EQExtractor2/patch_Sep22-2010.conf | 8 +- .../EQExtractor2/EQExtractor2/patch_SoD.conf | 6 +- .../patch_TestServer-Feb5-2013.conf | 8 +- .../patch_TestServer-Jan16-2013.conf | 8 +- utils/patches/opcodes.conf | 2 +- utils/patches/patch_RoF.conf | 8 +- utils/patches/patch_RoF2.conf | 8 +- utils/patches/patch_SoD.conf | 6 +- utils/patches/patch_SoF.conf | 4 +- utils/patches/patch_TOB.conf | 8 +- utils/patches/patch_Titanium.conf | 4 +- utils/patches/patch_UF.conf | 8 +- utils/scripts/opcode_scripts/patch_NEW.conf | 8 +- utils/scripts/opcode_scripts/patch_OLD.conf | 8 +- utils/sql/merc_tables_bootstrap.sql | 4 +- zone/aa.cpp | 4 +- zone/aggro.cpp | 6 +- zone/attack.cpp | 26 +- zone/aura.cpp | 4 +- zone/beacon.cpp | 2 +- zone/beacon.h | 8 +- zone/bonuses.cpp | 6 +- zone/bot.cpp | 110 +++--- zone/bot.h | 120 +++--- zone/bot_commands/bot_blocked_buffs.cpp | 4 +- zone/bot_commands/bot_cast.cpp | 4 +- zone/bot_commands/bot_discipline.cpp | 2 +- zone/bot_database.cpp | 8 +- zone/bot_database.h | 6 +- zone/bot_structs.h | 10 +- zone/botspellsai.cpp | 24 +- zone/client.cpp | 25 +- zone/client.h | 62 ++- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 53 +-- zone/client_packet.h | 2 +- zone/client_process.cpp | 14 +- zone/client_version.cpp | 127 ++++++ zone/client_version.h | 133 ++++--- zone/common.h | 15 +- zone/corpse.cpp | 2 +- zone/corpse.h | 6 +- zone/effects.cpp | 24 +- zone/embparser.cpp | 12 +- zone/embparser.h | 8 +- zone/embparser_api.cpp | 302 +++++++-------- zone/encounter.h | 4 +- zone/entity.h | 4 +- zone/gm_commands/castspell.cpp | 2 +- zone/gm_commands/npccast.cpp | 8 +- zone/gm_commands/unscribespell.cpp | 2 +- zone/gm_commands/untraindisc.cpp | 2 +- zone/groups.cpp | 2 +- zone/groups.h | 2 +- zone/hate_list.cpp | 2 +- zone/hate_list.h | 2 +- zone/horse.cpp | 10 +- zone/horse.h | 8 +- zone/lua_bot.cpp | 36 +- zone/lua_bot.h | 20 +- zone/lua_buff.cpp | 2 +- zone/lua_buff.h | 2 +- zone/lua_client.cpp | 30 +- zone/lua_client.h | 16 +- zone/lua_entity_list.cpp | 24 +- zone/lua_entity_list.h | 12 +- zone/lua_general.cpp | 302 +++++++-------- zone/lua_merc.cpp | 2 +- zone/lua_merc.h | 2 +- zone/lua_mob.cpp | 72 ++-- zone/lua_mob.h | 42 +- zone/lua_mod.cpp | 8 +- zone/lua_mod.h | 8 +- zone/lua_npc.cpp | 8 +- zone/lua_npc.h | 4 +- zone/lua_packet.cpp | 12 +- zone/lua_parser.cpp | 18 +- zone/lua_parser.h | 18 +- zone/lua_parser_events.cpp | 30 +- zone/lua_parser_events.h | 8 +- zone/lua_stat_bonuses.cpp | 4 +- zone/lua_stat_bonuses.h | 4 +- zone/lua_zone.cpp | 2 +- zone/lua_zone.h | 2 +- zone/merc.cpp | 22 +- zone/merc.h | 26 +- zone/mob.cpp | 30 +- zone/mob.h | 203 +++++----- zone/mob_ai.cpp | 8 +- zone/npc.h | 26 +- zone/perl_bot.cpp | 38 +- zone/perl_buff.cpp | 2 +- zone/perl_client.cpp | 52 +-- zone/perl_entity.cpp | 24 +- zone/perl_groups.cpp | 2 +- zone/perl_merc.cpp | 2 +- zone/perl_mob.cpp | 190 ++++----- zone/perl_npc.cpp | 26 +- zone/perl_player_corpse.cpp | 2 +- zone/perl_raids.cpp | 2 +- zone/perl_stat_bonuses.cpp | 4 +- zone/perl_zone.cpp | 2 +- zone/pets.cpp | 10 +- zone/pets.h | 4 +- zone/quest_interface.h | 8 +- zone/quest_parser_collection.cpp | 10 +- zone/quest_parser_collection.h | 10 +- zone/questmgr.cpp | 14 +- zone/questmgr.h | 14 +- zone/raids.cpp | 2 +- zone/raids.h | 2 +- zone/spell_effects.cpp | 136 +++---- zone/spells.cpp | 365 ++++-------------- zone/trap.h | 2 +- zone/zone.cpp | 6 +- zone/zone.h | 4 +- zone/zonedb.cpp | 8 +- zone/zonedb.h | 18 +- 201 files changed, 2856 insertions(+), 3105 deletions(-) create mode 100644 common/patches/IBuff.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 22a26681c..1fa0d0af8 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -657,6 +657,7 @@ set(common_headers packet_dump_file.h packet_dump.h packet_functions.h + patches/IBuff.h patches/IMessage.h patches/client_version.h patches/patches.h diff --git a/common/database/database_update_manifest.h b/common/database/database_update_manifest.h index e0a0281d7..5cbddf453 100644 --- a/common/database/database_update_manifest.h +++ b/common/database/database_update_manifest.h @@ -7207,6 +7207,25 @@ ALTER TABLE `character_parcels_containers` )", .content_schema_update = false }, + ManifestEntry{ + .version = 9329, + .description = "2026_04_27_spell_id_type_correction.sql", + .check = "SHOW COLUMNS FROM `character_spells` WHERE `Field` LIKE 'spell_id' AND `Type` LIKE 'int(%)'", + .condition = "empty", + .match = "", + .sql = R"( +ALTER TABLE `blocked_spells` MODIFY COLUMN `spellid` INTEGER NULL; +ALTER TABLE `character_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL; +ALTER TABLE `character_memmed_spells` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `character_spells` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `damageshieldtypes` MODIFY COLUMN `spellid` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `ldon_trap_templates` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE IF EXISTS `merc_buffs` MODIFY COLUMN `SpellId` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE IF EXISTS `merc_spell_list_entries` MODIFY COLUMN `spell_id` INTEGER NOT NULL; +ALTER TABLE `npc_spells_entries` MODIFY COLUMN `spellid` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `spell_buckets` MODIFY COLUMN `spell_id` INTEGER NOT NULL; +)" + }, // -- template; copy/paste this when you need to create a new entry // ManifestEntry{ // .version = 9228, diff --git a/common/database/database_update_manifest_bots.h b/common/database/database_update_manifest_bots.h index c73268a82..eebdae70f 100644 --- a/common/database/database_update_manifest_bots.h +++ b/common/database/database_update_manifest_bots.h @@ -2174,7 +2174,23 @@ FROM bot_settings WHERE `setting_id` = 0 AND `setting_type` = 0; )" - } + }, + ManifestEntry{ + .version = 9056, + .description = "some_new_migration.sql", + .check = "SHOW COLUMNS FROM `table_name` LIKE 'column_name'", + .condition = "empty", + .match = "", + .sql = R"( +ALTER TABLE `bot_blocked_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL; +ALTER TABLE `bot_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_pet_buffs` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_pets` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_spell_settings` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_spells_entries` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +ALTER TABLE `bot_timers` MODIFY COLUMN `spell_id` INTEGER NOT NULL DEFAULT 0; +)" + }, // -- template; copy/paste this when you need to create a new entry // ManifestEntry{ // .version = 9228, diff --git a/common/emu_oplist.h b/common/emu_oplist.h index 5aea4a663..5c9d9144a 100644 --- a/common/emu_oplist.h +++ b/common/emu_oplist.h @@ -78,8 +78,8 @@ N(OP_Bind_Wound), N(OP_BlockedBuffs), N(OP_BoardBoat), N(OP_BookButton), -N(OP_Buff), -N(OP_BuffCreate), +N(OP_BuffDefinition), +N(OP_RefreshBuffs), N(OP_BuffRemoveRequest), N(OP_Bug), N(OP_BuyerItems), @@ -406,7 +406,7 @@ N(OP_OpenGuildTributeMaster), N(OP_OpenInventory), N(OP_OpenTributeMaster), N(OP_PDeletePetition), -N(OP_PetBuffWindow), +N(OP_RefreshPetBuffs), N(OP_PetCommands), N(OP_PetCommandState), N(OP_PetHoTT), @@ -562,7 +562,7 @@ N(OP_Stun), N(OP_Surname), N(OP_SwapSpell), N(OP_SystemFingerprint), -N(OP_TargetBuffs), +N(OP_RefreshTargetBuffs), N(OP_TargetCommand), N(OP_TargetHoTT), N(OP_TargetMouse), diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index c1476a6cf..42fec1d24 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -128,7 +128,7 @@ struct LDoNTrapTemplate { uint32 id; LDoNChestTypes type; - uint32 spell_id; + int32 spell_id; uint16 skill; uint8 locked; }; @@ -422,7 +422,7 @@ struct NewZone_Struct { */ struct MemorizeSpell_Struct { uint32 slot; // Spot in the spell book/memorized slot -uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) +int32 spell_id; // Spell id (200 or c8 is minor healing, etc) uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 reduction; // lower reuse }; @@ -471,7 +471,7 @@ struct ManaChange_Struct { /*00*/ uint32 new_mana; // New Mana AMount /*04*/ uint32 stamina; -/*08*/ uint32 spell_id; +/*08*/ int32 spell_id; /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*16*/ int32 slot; // -1 normal, otherwise clear ETA and GCD @@ -489,14 +489,14 @@ struct BeginCast_Struct { // len = 8 /*000*/ uint16 caster_id; -/*002*/ uint16 spell_id; +/*002*/ int16 spell_id; /*004*/ uint32 cast_time; // in miliseconds }; struct CastSpell_Struct { uint32 slot; - uint32 spell_id; + int32 spell_id; uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 target_id; uint32 cs_unknown1; @@ -544,7 +544,7 @@ struct SpellBuff_Struct /*001*/ uint8 level; /*002*/ uint8 bard_modifier; /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? -- OSX client calls this "activated" -/*004*/ uint32 spellid; +/*004*/ int32 spellid; /*008*/ int32 duration; /*012*/ uint32 counters; // single book keeping value (counters, rune/vie) /*016*/ uint32 player_id; // caster ID, pretty sure just zone ID @@ -574,7 +574,7 @@ struct BuffRemoveRequest_Struct struct PetBuff_Struct { /*000*/ uint32 petid; -/*004*/ uint32 spellid[PET_BUFF_COUNT]; +/*004*/ int32 spellid[PET_BUFF_COUNT]; /*124*/ int32 ticsremaining[PET_BUFF_COUNT]; /*244*/ uint32 buffcount; }; @@ -875,7 +875,7 @@ struct BindStruct { struct SuspendedMinion_Struct { - /*000*/ uint16 SpellID; + /*000*/ int16 SpellID; /*002*/ uint32 HP; /*006*/ uint32 Mana; /*010*/ SpellBuff_Struct Buffs[BUFF_COUNT]; @@ -1010,7 +1010,7 @@ struct PlayerProfile_Struct /*2505*/ uint8 unknown2541[47]; // ? /*2552*/ uint8 languages[MAX_PP_LANGUAGE]; /*2580*/ uint8 unknown2616[4]; -/*2584*/ uint32 spell_book[EQ::spells::SPELLBOOK_SIZE]; +/*2584*/ int32 spell_book[EQ::spells::SPELLBOOK_SIZE]; /*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff /*4632*/ uint32 mem_spells[EQ::spells::SPELL_GEM_COUNT]; /*4668*/ uint8 unknown4704[32]; // @@ -1344,7 +1344,7 @@ struct CombatDamage_Struct /* 00 */ uint16 target; /* 02 */ uint16 source; /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells, skill -/* 05 */ uint16 spellid; +/* 05 */ int16 spellid; /* 07 */ uint32 damage; /* 11 */ float force; /* 15 */ float hit_heading; // see above notes in Action_Struct @@ -1377,7 +1377,7 @@ struct Death_Struct /*004*/ uint32 killer_id; /*008*/ uint32 corpseid; // was corpseid /*012*/ uint32 bindzoneid; -/*016*/ uint32 spell_id; +/*016*/ int32 spell_id; /*020*/ uint32 attack_skill; /*024*/ uint32 damage; /*028*/ uint32 unknown028; @@ -2983,7 +2983,7 @@ struct Resurrect_Struct { /*024*/ char your_name[64]; /*088*/ uint32 unknown088; /*092*/ char rezzer_name[64]; -/*156*/ uint32 spellid; +/*156*/ int32 spellid; /*160*/ char corpse_name[64]; /*224*/ uint32 action; /* 228 */ @@ -2991,7 +2991,7 @@ struct Resurrect_Struct { struct Translocate_Struct { /*000*/ uint32 ZoneID; -/*004*/ uint32 SpellID; +/*004*/ int32 SpellID; /*008*/ uint32 unknown008; //Heading ? /*012*/ char Caster[64]; /*076*/ float y; @@ -3008,7 +3008,7 @@ struct PendingTranslocate_Struct float x; float y; float z; - uint32 spell_id; + int32 spell_id; }; struct Sacrifice_Struct { @@ -4875,7 +4875,7 @@ struct MarkNPC_Struct }; struct InspectBuffs_Struct { -/*000*/ uint32 spell_id[BUFF_COUNT]; +/*000*/ int32 spell_id[BUFF_COUNT]; /*100*/ int32 tics_remaining[BUFF_COUNT]; }; @@ -5144,7 +5144,7 @@ struct SendAA_Struct { /*0040*/ uint32 prereq_skill; //is < 0, abs() is category # /*0044*/ uint32 prereq_minpoints; //min points in the prereq /*0048*/ uint32 type; -/*0052*/ uint32 spellid; +/*0052*/ int32 spellid; /*0056*/ uint32 spell_type; /*0060*/ uint32 spell_refresh; /*0064*/ uint16 classes; @@ -5645,7 +5645,7 @@ struct HideCorpse_Struct struct BuffIconEntry_Struct { uint32 buff_slot; - uint32 spell_id; + int32 spell_id; int32 tics_remaining; uint32 num_hits; char caster[64]; @@ -5656,7 +5656,7 @@ struct BuffIcon_Struct uint32 entity_id; uint8 all_buffs; uint16 count; - uint8 type; // 0 = self buff window, 1 = self target window, 4 = group, 5 = PC, 7 = NPC + uint8 type; // 0 = self buff window, 1 = self target window, 2 = pet buff or target window, 4 = group, 5 = PC, 7 = NPC int32 tic_timer; int32 name_lengths; // so ahh we kind of do these packets hacky, this is the total length of all the names to make creating the real packets in the translators easier BuffIconEntry_Struct entries[0]; diff --git a/common/events/player_events.h b/common/events/player_events.h index 7dbe8e5d8..6ff89d97b 100644 --- a/common/events/player_events.h +++ b/common/events/player_events.h @@ -960,7 +960,7 @@ namespace PlayerEvent { struct ResurrectAcceptEvent { std::string resurrecter_name; std::string spell_name; - uint32 spell_id; + int32 spell_id; // cereal template @@ -1058,7 +1058,7 @@ namespace PlayerEvent { uint32 killer_id; std::string killer_name; int64 damage; - uint32 spell_id; + int32 spell_id; std::string spell_name; int skill_id; std::string skill_name; diff --git a/common/links.cpp b/common/links.cpp index 6508fa44a..4afac085d 100644 --- a/common/links.cpp +++ b/common/links.cpp @@ -11,7 +11,7 @@ void Links::FormatItemLink(char* Buffer, size_t BufferSize, const EQ::ItemInstan // TODO: Reverse 0x14064B220 to get definition of this function } -void Links::FormatSpellLink(char* Buffer, size_t BufferSize, uint32_t SpellID, +void Links::FormatSpellLink(char* Buffer, size_t BufferSize, int32_t SpellID, const char* spellNameOverride) { snprintf(Buffer, BufferSize, "%c%d3^%d^0^'%s%c", ITEM_TAG_CHAR, ETAG_SPELL, SpellID, diff --git a/common/links.h b/common/links.h index d01940cba..fbf1c0fa0 100644 --- a/common/links.h +++ b/common/links.h @@ -49,7 +49,7 @@ void FormatItemLink(char* Buffer, size_t BufferSize, const EQ::ItemInstance* ite // Create a spell link for the given spell, with optional spell name override. Spells on items often have // spell name overrides that changes the display name of the spell. -void FormatSpellLink(char* Buffer, size_t BufferSize, uint32_t SpellID, +void FormatSpellLink(char* Buffer, size_t BufferSize, int32_t SpellID, const char* spellNameOverride = nullptr); // Format text into a clickable dialog link. The keyword is the text that will be displayed in the chat window, diff --git a/common/patches/IBuff.h b/common/patches/IBuff.h new file mode 100644 index 000000000..1d6d7cf84 --- /dev/null +++ b/common/patches/IBuff.h @@ -0,0 +1,60 @@ +/* EQEmu: EQEmulator + + Copyright (C) 2001-2026 EQEmu Development Team + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#pragma once + +#include "common/emu_opcodes.h" + +#include +#include + +class Client; +class Mob; +class EQApplicationPacket; +class Buffs_Struct; + +namespace ClientPatch { + +class IBuff +{ +public: + using BuffSequenceFunc = std::function(const Client*)>; + + IBuff(uint32_t maxLongBuffs, uint32_t maxShortBuffs) + : m_maxLongBuffs(maxLongBuffs) + , m_maxShortBuffs(maxShortBuffs) + {} + + IBuff() = delete; + virtual ~IBuff() = default; + + virtual std::unique_ptr BuffDefinition(Mob* mob, const Buffs_Struct& buff, uint32_t slot, + bool fade) const = 0; + virtual std::unique_ptr RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove, + bool buff_timers_suspended, const std::vector& slots) const = 0; + virtual void SetRefreshType(std::unique_ptr& packet, uint8_t refresh_type) const = 0; + virtual bool NeedsWearMessage() const = 0; + + uint32_t ServerToPatchBuffSlot(uint32_t slot) const; + +protected: + uint32_t m_maxLongBuffs; + uint32_t m_maxShortBuffs; +}; + +} // namespace Buff diff --git a/common/patches/IMessage.h b/common/patches/IMessage.h index 80bd15501..0e8fa1930 100644 --- a/common/patches/IMessage.h +++ b/common/patches/IMessage.h @@ -15,9 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#pragma once -#include "client_version.h" +#pragma once // Migration path: replace string_ids.h usage with ID enum values one call site at a time. @@ -25,7 +24,7 @@ class Client; class Mob; class EQApplicationPacket; -namespace Message { +namespace ClientPatch { template concept AllConstChar = (std::is_convertible_v && ...); @@ -33,13 +32,14 @@ concept AllConstChar = (std::is_convertible_v && ...); class IMessage { public: + using FormattedArgs = std::array; IMessage() = default; virtual ~IMessage() = default; // these two are the basic string message packets virtual std::unique_ptr Simple(uint32_t color, uint32_t id) const = 0; virtual std::unique_ptr Formatted(uint32_t color, uint32_t id, - const std::array& args) const = 0; + const FormattedArgs& args) const = 0; // These aren't technically messages, but they use the same format and are similar enough to include here virtual std::unique_ptr InterruptSpell(uint32_t message, uint32_t spawn_id, diff --git a/common/patches/client_version.cpp b/common/patches/client_version.cpp index 0c00906f5..f71700398 100644 --- a/common/patches/client_version.cpp +++ b/common/patches/client_version.cpp @@ -18,13 +18,22 @@ #include "client_version.h" +#include "common/emu_constants.h" + #include "common/patches/titanium.h" +#include "common/patches/titanium_limits.h" #include "common/patches/sof.h" +#include "common/patches/sof_limits.h" #include "common/patches/sod.h" +#include "common/patches/sod_limits.h" #include "common/patches/uf.h" +#include "common/patches/uf_limits.h" #include "common/patches/rof.h" +#include "common/patches/rof_limits.h" #include "common/patches/rof2.h" +#include "common/patches/rof2_limits.h" #include "common/patches/tob.h" +#include "common/patches/tob_limits.h" #include @@ -36,25 +45,32 @@ struct ClientComponents { switch (version) { case Version::TOB: - messageComponent = std::make_unique(); + buffComponent = std::make_unique(TOB::spells::LONG_BUFFS, TOB::spells::SHORT_BUFFS); + messageComponent = std::make_unique(); break; case Version::RoF2: - messageComponent = std::make_unique(); + buffComponent = std::make_unique(RoF2::spells::LONG_BUFFS, RoF2::spells::SHORT_BUFFS); + messageComponent = std::make_unique(); break; case Version::RoF: - messageComponent = std::make_unique(); + buffComponent = std::make_unique(RoF::spells::LONG_BUFFS, RoF::spells::SHORT_BUFFS); + messageComponent = std::make_unique(); break; case Version::UF: - messageComponent = std::make_unique(); + buffComponent = std::make_unique(UF::spells::LONG_BUFFS, UF::spells::SHORT_BUFFS); + messageComponent = std::make_unique(); break; case Version::SoD: - messageComponent = std::make_unique(); + buffComponent = std::make_unique(SoD::spells::LONG_BUFFS, SoD::spells::SHORT_BUFFS); + messageComponent = std::make_unique(); break; case Version::SoF: - messageComponent = std::make_unique(); + buffComponent = std::make_unique(SoF::spells::LONG_BUFFS, SoF::spells::SHORT_BUFFS); + messageComponent = std::make_unique(); break; case Version::Titanium: - messageComponent = std::make_unique(); + buffComponent = std::make_unique(Titanium::spells::LONG_BUFFS, Titanium::spells::SHORT_BUFFS); + messageComponent = std::make_unique(); break; default: break; @@ -62,7 +78,8 @@ struct ClientComponents } const Version version; - std::unique_ptr messageComponent; + std::unique_ptr buffComponent; + std::unique_ptr messageComponent; }; // this array must be in the same order as the Version enum because it converts Version to index directly @@ -80,7 +97,27 @@ static const std::array s_pa } }; -const std::unique_ptr& GetMessageComponent(Version version) +template<> +const std::unique_ptr& GetComponent(Version version) +{ + return s_patches.at(static_cast(version)).buffComponent; +} + +template<> +const std::unique_ptr& GetComponent(Version version) { return s_patches.at(static_cast(version)).messageComponent; } + +uint32_t ClientPatch::IBuff::ServerToPatchBuffSlot(uint32_t slot) const +{ + // we're a disc + if (slot >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS) + return slot - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS + + m_maxLongBuffs + m_maxShortBuffs; + // we're a song + if (slot >= EQ::spells::LONG_BUFFS) + return slot - EQ::spells::LONG_BUFFS + m_maxLongBuffs; + // we're a normal buff + return slot; // as long as we guard against bad slots server side, we should be fine +} diff --git a/common/patches/client_version.h b/common/patches/client_version.h index a0ebf9c3a..bc84976d6 100644 --- a/common/patches/client_version.h +++ b/common/patches/client_version.h @@ -1,13 +1,38 @@ -// -// Created by dannu on 4/21/2026. -// +/* EQEmu: EQEmulator + + Copyright (C) 2001-2026 EQEmu Development Team + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ #pragma once #include "common/emu_versions.h" #include -namespace Message { class IMessage; } +namespace ClientPatch { +class IBuff; +class IMessage; +} +// store all static functions for the different patches here // store all static functions for the different patches here, this can return nullptr for unsupported patches -const std::unique_ptr& GetMessageComponent(EQ::versions::ClientVersion version); +template +const std::unique_ptr& GetComponent(EQ::versions::ClientVersion version); + +template <> +const std::unique_ptr& GetComponent(EQ::versions::ClientVersion version); + +template <> +const std::unique_ptr& GetComponent(EQ::versions::ClientVersion version); diff --git a/common/patches/deprecated_sof_opcode_list.h b/common/patches/deprecated_sof_opcode_list.h index d8a88f63f..13a171e8f 100644 --- a/common/patches/deprecated_sof_opcode_list.h +++ b/common/patches/deprecated_sof_opcode_list.h @@ -353,7 +353,7 @@ 0x05ea, 0x1b6f, 0x198e, -0x7bd6, OP_Buff +0x7bd6, OP_BuffDefinition 0x3501, 0x47ab, 0x7a9e, OP_World_Client_CRC1 diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 3ce262080..d5e9f3ca8 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -67,7 +67,6 @@ namespace RoF static inline spells::CastingSlot ServerToRoFCastingSlot(EQ::spells::CastingSlot slot); static inline EQ::spells::CastingSlot RoFToServerCastingSlot(spells::CastingSlot slot); - static inline int ServerToRoFBuffSlot(int index); static inline int RoFToServerBuffSlot(int index); void Register(EQStreamIdentifier &into) @@ -402,7 +401,7 @@ namespace RoF FINISH_ENCODE(); } - ENCODE(OP_Buff) + ENCODE(OP_BuffDefinition) { ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -410,8 +409,7 @@ namespace RoF OUT(entityid); OUT(buff.effect_type); OUT(buff.level); - // just so we're 100% sure we get a 1.0f ... - eq->buff.bard_modifier = emu->buff.bard_modifier == 10 ? 1.0f : emu->buff.bard_modifier / 10.0f; + OUT(buff.bard_modifier); OUT(buff.spellid); OUT(buff.duration); OUT(buff.player_id); @@ -420,59 +418,13 @@ namespace RoF OUT(buff.x); OUT(buff.z); // TODO: implement slot_data stuff - eq->slotid = ServerToRoFBuffSlot(emu->slotid); + OUT(slotid); if (emu->bufffade == 1) eq->bufffade = 1; else eq->bufffade = 2; - // Bit of a hack. OP_Buff appears to add/remove the buff while OP_BuffCreate adds/removes the actual buff icon - EQApplicationPacket *outapp = nullptr; - if (eq->bufffade == 1) - { - outapp = new EQApplicationPacket(OP_BuffCreate, 29); - outapp->WriteUInt32(emu->entityid); - outapp->WriteUInt32(0); // tic timer - outapp->WriteUInt8(0); // Type of OP_BuffCreate packet ? - outapp->WriteUInt16(1); // 1 buff in this packet - outapp->WriteUInt32(eq->slotid); - outapp->WriteUInt32(0xffffffff); // SpellID (0xffff to remove) - outapp->WriteUInt32(0); // Duration - outapp->WriteUInt32(0); // numhits - outapp->WriteUInt8(0); // Caster name - outapp->WriteUInt8(0); // Type - } - FINISH_ENCODE(); - - if (outapp) - dest->FastQueuePacket(&outapp); // Send the OP_BuffCreate to remove the buff - } - - ENCODE(OP_BuffCreate) - { - SETUP_VAR_ENCODE(BuffIcon_Struct); - - uint32 sz = 12 + (17 * emu->count) + emu->name_lengths; // 17 includes nullterm - __packet->size = sz; - __packet->pBuffer = new unsigned char[sz]; - memset(__packet->pBuffer, 0, sz); - - __packet->WriteUInt32(emu->entity_id); - __packet->WriteUInt32(emu->tic_timer); - __packet->WriteUInt8(emu->all_buffs); // 1 indicates all buffs on the player (0 to add or remove a single buff) - __packet->WriteUInt16(emu->count); - - for (int i = 0; i < emu->count; ++i) - { - __packet->WriteUInt32(emu->type == 0 ? ServerToRoFBuffSlot(emu->entries[i].buff_slot) : emu->entries[i].buff_slot); - __packet->WriteUInt32(emu->entries[i].spell_id); - __packet->WriteUInt32(emu->entries[i].tics_remaining); - __packet->WriteUInt32(emu->entries[i].num_hits); // Unknown - __packet->WriteString(emu->entries[i].caster); - } - __packet->WriteUInt8(emu->type); // Unknown - FINISH_ENCODE(); } @@ -1858,38 +1810,6 @@ namespace RoF FINISH_ENCODE(); } - ENCODE(OP_PetBuffWindow) - { - // The format of the RoF packet is identical to the OP_BuffCreate packet. - - SETUP_VAR_ENCODE(PetBuff_Struct); - - uint32 sz = 12 + (17 * emu->buffcount); - __packet->size = sz; - __packet->pBuffer = new unsigned char[sz]; - memset(__packet->pBuffer, 0, sz); - - __packet->WriteUInt32(emu->petid); - __packet->WriteUInt32(0); // PlayerID ? - __packet->WriteUInt8(1); // 1 indicates all buffs on the pet (0 to add or remove a single buff) - __packet->WriteUInt16(emu->buffcount); - - for (uint16 i = 0; i < PET_BUFF_COUNT; ++i) - { - if (emu->spellid[i]) - { - __packet->WriteUInt32(i); - __packet->WriteUInt32(emu->spellid[i]); - __packet->WriteUInt32(emu->ticsremaining[i]); - __packet->WriteUInt32(0); // numhits - __packet->WriteString(""); - } - } - __packet->WriteUInt8(0); // some sort of type - - FINISH_ENCODE(); - } - ENCODE(OP_PlayerProfile) { EQApplicationPacket *in = *p; @@ -2179,7 +2099,7 @@ namespace RoF outapp->WriteUInt32(emu->buffs[r].counters); outapp->WriteUInt32(emu->buffs[r].duration); outapp->WriteUInt8(emu->buffs[r].level); - outapp->WriteUInt32(emu->buffs[r].spellid); + outapp->WriteSInt32 (emu->buffs[r].spellid); outapp->WriteUInt8(effect_type); // Only ever seen 2 outapp->WriteUInt32(emu->buffs[r].num_hits); outapp->WriteUInt32(0); @@ -3239,8 +3159,6 @@ namespace RoF FINISH_ENCODE(); } - ENCODE(OP_TargetBuffs) { ENCODE_FORWARD(OP_BuffCreate); } - ENCODE(OP_TaskDescription) { EQApplicationPacket *in = *p; @@ -4196,7 +4114,7 @@ namespace RoF FINISH_DIRECT_DECODE(); } - DECODE(OP_Buff) + DECODE(OP_BuffDefinition) { DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -6263,21 +6181,6 @@ namespace RoF } } - // these should be optimized out for RoF since they should all boil down to return index :P - // but lets leave it here for future proofing - static inline int ServerToRoFBuffSlot(int index) - { - // we're a disc - if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS) - return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS + - spells::LONG_BUFFS + spells::SHORT_BUFFS; - // we're a song - if (index >= EQ::spells::LONG_BUFFS) - return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS; - // we're a normal buff - return index; // as long as we guard against bad slots server side, we should be fine - } - static inline int RoFToServerBuffSlot(int index) { // we're a disc diff --git a/common/patches/rof.h b/common/patches/rof.h index 0d08c6e68..b6d374935 100644 --- a/common/patches/rof.h +++ b/common/patches/rof.h @@ -17,46 +17,28 @@ */ #pragma once -#include "uf.h" #include "common/struct_strategy.h" +#include "common/patches/uf.h" class EQStreamIdentifier; -namespace RoF -{ +namespace RoF { - //these are the only public member of this namespace. - extern void Register(EQStreamIdentifier &into); - extern void Reload(); +extern void Register(EQStreamIdentifier& into); +extern void Reload(); - - - //you should not directly access anything below.. - //I just dont feel like making a seperate header for it. - - class Strategy : public StructStrategy { - public: - Strategy(); - - protected: - - virtual std::string Describe() const; - virtual const EQ::versions::ClientVersion ClientVersion() const; - - //magic macro to declare our opcode processors - #include "ss_declare.h" - #include "rof_ops.h" - }; - -} /*RoF*/ - -namespace Message { - -class RoF : public UF +class Strategy : public StructStrategy { public: - RoF() = default; - ~RoF() override = default; + Strategy(); + +protected: + virtual std::string Describe() const; + virtual const EQ::versions::ClientVersion ClientVersion() const; + + //magic macro to declare our opcode processors +#include "ss_declare.h" +#include "rof_ops.h" }; -} // namespace Message +} /*RoF*/ diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index a2b3ba30e..daa937133 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -69,7 +69,6 @@ namespace RoF2 static inline spells::CastingSlot ServerToRoF2CastingSlot(EQ::spells::CastingSlot slot); static inline EQ::spells::CastingSlot RoF2ToServerCastingSlot(spells::CastingSlot slot); - static inline int ServerToRoF2BuffSlot(int index); static inline int RoF2ToServerBuffSlot(int index); void Register(EQStreamIdentifier &into) @@ -661,7 +660,7 @@ namespace RoF2 FINISH_ENCODE(); } - ENCODE(OP_Buff) + ENCODE(OP_BuffDefinition) { ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -678,59 +677,13 @@ namespace RoF2 OUT(buff.y); OUT(buff.x); OUT(buff.z); - eq->slotid = ServerToRoF2BuffSlot(emu->slotid); + OUT(slotid); // TODO: implement slot_data stuff if (emu->bufffade == 1) eq->bufffade = 1; else eq->bufffade = 2; - // Bit of a hack. OP_Buff appears to add/remove the buff while OP_BuffCreate adds/removes the actual buff icon - EQApplicationPacket *outapp = nullptr; - if (eq->bufffade == 1) - { - outapp = new EQApplicationPacket(OP_BuffCreate, 29u); - outapp->WriteUInt32(emu->entityid); - outapp->WriteUInt32(0); // tic timer - outapp->WriteUInt8(0); // Type of OP_BuffCreate packet ? - outapp->WriteUInt16(1); // 1 buff in this packet - outapp->WriteUInt32(eq->slotid); - outapp->WriteUInt32(0xffffffff); // SpellID (0xffff to remove) - outapp->WriteUInt32(0); // Duration - outapp->WriteUInt32(0); // numhits - outapp->WriteUInt8(0); // Caster name - outapp->WriteUInt8(0); // Type - } - FINISH_ENCODE(); - - if (outapp) - dest->FastQueuePacket(&outapp); // Send the OP_BuffCreate to remove the buff - } - - ENCODE(OP_BuffCreate) - { - SETUP_VAR_ENCODE(BuffIcon_Struct); - - uint32 sz = 12 + (17 * emu->count) + emu->name_lengths; // 17 includes nullterm - __packet->size = sz; - __packet->pBuffer = new unsigned char[sz]; - memset(__packet->pBuffer, 0, sz); - - __packet->WriteUInt32(emu->entity_id); - __packet->WriteUInt32(emu->tic_timer); - __packet->WriteUInt8(emu->all_buffs); // 1 indicates all buffs on the player (0 to add or remove a single buff) - __packet->WriteUInt16(emu->count); - - for (int i = 0; i < emu->count; ++i) - { - __packet->WriteUInt32(emu->type == 0 ? ServerToRoF2BuffSlot(emu->entries[i].buff_slot) : emu->entries[i].buff_slot); - __packet->WriteUInt32(emu->entries[i].spell_id); - __packet->WriteUInt32(emu->entries[i].tics_remaining); - __packet->WriteUInt32(emu->entries[i].num_hits); // Unknown - __packet->WriteString(emu->entries[i].caster); - } - __packet->WriteUInt8(emu->type); // Unknown - FINISH_ENCODE(); } @@ -2464,38 +2417,6 @@ namespace RoF2 FINISH_ENCODE(); } - ENCODE(OP_PetBuffWindow) - { - // The format of the RoF2 packet is identical to the OP_BuffCreate packet. - - SETUP_VAR_ENCODE(PetBuff_Struct); - - uint32 sz = 12 + (17 * emu->buffcount); - __packet->size = sz; - __packet->pBuffer = new unsigned char[sz]; - memset(__packet->pBuffer, 0, sz); - - __packet->WriteUInt32(emu->petid); - __packet->WriteUInt32(0); // PlayerID ? - __packet->WriteUInt8(1); // 1 indicates all buffs on the pet (0 to add or remove a single buff) - __packet->WriteUInt16(emu->buffcount); - - for (uint16 i = 0; i < PET_BUFF_COUNT; ++i) - { - if (emu->spellid[i]) - { - __packet->WriteUInt32(i); - __packet->WriteUInt32(emu->spellid[i]); - __packet->WriteUInt32(emu->ticsremaining[i]); - __packet->WriteUInt32(0); // num hits - __packet->WriteString(""); - } - } - __packet->WriteUInt8(0); // some sort of type - - FINISH_ENCODE(); - } - ENCODE(OP_PlayerProfile) { EQApplicationPacket *in = *p; @@ -2786,7 +2707,7 @@ namespace RoF2 outapp->WriteUInt32(emu->buffs[r].counters); outapp->WriteUInt32(emu->buffs[r].duration); outapp->WriteUInt8(emu->buffs[r].level); - outapp->WriteUInt32(emu->buffs[r].spellid); + outapp->WriteSInt32 (emu->buffs[r].spellid); outapp->WriteUInt8(effect_type); // Only ever seen 2 outapp->WriteUInt32(emu->buffs[r].num_hits); outapp->WriteUInt32(0); @@ -3841,8 +3762,6 @@ namespace RoF2 FINISH_ENCODE(); } - ENCODE(OP_TargetBuffs) { ENCODE_FORWARD(OP_BuffCreate); } - ENCODE(OP_TaskDescription) { EQApplicationPacket *in = *p; @@ -5145,7 +5064,7 @@ namespace RoF2 FINISH_DIRECT_DECODE(); } - DECODE(OP_Buff) + DECODE(OP_BuffDefinition) { DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -7495,21 +7414,6 @@ namespace RoF2 } } - // these should be optimized out for RoF2 since they should all boil down to return index :P - // but lets leave it here for future proofing - static inline int ServerToRoF2BuffSlot(int index) - { - // we're a disc - if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS) - return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS + - spells::LONG_BUFFS + spells::SHORT_BUFFS; - // we're a song - if (index >= EQ::spells::LONG_BUFFS) - return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS; - // we're a normal buff - return index; // as long as we guard against bad slots server side, we should be fine - } - static inline int RoF2ToServerBuffSlot(int index) { // we're a disc diff --git a/common/patches/rof2.h b/common/patches/rof2.h index 3613fa354..6f284c551 100644 --- a/common/patches/rof2.h +++ b/common/patches/rof2.h @@ -17,46 +17,28 @@ */ #pragma once -#include "rof.h" #include "common/struct_strategy.h" +#include "common/patches/rof.h" class EQStreamIdentifier; -namespace RoF2 -{ +namespace RoF2 { - //these are the only public member of this namespace. - extern void Register(EQStreamIdentifier &into); - extern void Reload(); +extern void Register(EQStreamIdentifier& into); +extern void Reload(); - - - //you should not directly access anything below.. - //I just dont feel like making a seperate header for it. - - class Strategy : public StructStrategy { - public: - Strategy(); - - protected: - - virtual std::string Describe() const; - virtual const EQ::versions::ClientVersion ClientVersion() const; - - //magic macro to declare our opcode processors - #include "ss_declare.h" - #include "rof2_ops.h" - }; - -}; /*RoF2*/ - -namespace Message { - -class RoF2 : public RoF +class Strategy : public StructStrategy { public: - RoF2() = default; - ~RoF2() override = default; + Strategy(); + +protected: + virtual std::string Describe() const; + virtual const EQ::versions::ClientVersion ClientVersion() const; + + //magic macro to declare our opcode processors +#include "ss_declare.h" +#include "rof2_ops.h" }; -} // namespace Message +}; /*RoF2*/ diff --git a/common/patches/rof2_ops.h b/common/patches/rof2_ops.h index 65e371430..4ea866aec 100644 --- a/common/patches/rof2_ops.h +++ b/common/patches/rof2_ops.h @@ -43,8 +43,7 @@ E(OP_BazaarSearch) E(OP_BecomeTrader) E(OP_BeginCast) E(OP_BlockedBuffs) -E(OP_Buff) -E(OP_BuffCreate) +E(OP_BuffDefinition) E(OP_BuyerItems) E(OP_CancelTrade) E(OP_CastSpell) @@ -100,7 +99,6 @@ E(OP_MoveItem) E(OP_NewSpawn) E(OP_NewZone) E(OP_OnLevelMessage) -E(OP_PetBuffWindow) E(OP_PlayerProfile) E(OP_RaidJoin) E(OP_RaidUpdate) @@ -123,7 +121,6 @@ E(OP_SpawnAppearance) E(OP_SpawnDoor) E(OP_SpecialMesg) E(OP_Stun) -E(OP_TargetBuffs) E(OP_TaskDescription) E(OP_TaskHistoryReply) E(OP_Track) @@ -153,7 +150,7 @@ D(OP_Barter) D(OP_BazaarSearch) D(OP_BlockedBuffs) D(OP_BookButton) -D(OP_Buff) +D(OP_BuffDefinition) D(OP_BuffRemoveRequest) D(OP_BuyerItems) D(OP_CastSpell) diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index e46d97089..c99d68ef5 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -668,7 +668,7 @@ struct NewZone_Struct { */ struct MemorizeSpell_Struct { uint32 slot; // Spot in the spell book/memorized slot -uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) +int32 spell_id; // Spell id (200 or c8 is minor healing, etc) uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 reduction; // lowers reuse }; @@ -705,7 +705,7 @@ struct ManaChange_Struct { /*00*/ uint32 new_mana; // New Mana AMount /*04*/ uint32 stamina; -/*08*/ uint32 spell_id; +/*08*/ int32 spell_id; /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it @@ -719,7 +719,7 @@ struct SwapSpell_Struct struct BeginCast_Struct { -/*000*/ uint32 spell_id; +/*000*/ int32 spell_id; /*004*/ uint16 caster_id; /*006*/ uint32 cast_time; // in miliseconds /*010*/ @@ -728,7 +728,7 @@ struct BeginCast_Struct struct CastSpell_Struct { /*00*/ uint32 slot; -/*04*/ uint32 spell_id; +/*04*/ int32 spell_id; /*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast /*20*/ uint32 target_id; /*24*/ uint32 cs_unknown[2]; @@ -760,7 +760,7 @@ struct SpellBuff_Struct /*002*/ uint8 unknown002; //pretty sure padding now /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? /*004*/ float bard_modifier; -/*008*/ uint32 spellid; +/*008*/ int32 spellid; /*012*/ uint32 duration; /*016*/ uint32 player_id; // caster ID, pretty sure just zone ID /*020*/ uint32 num_hits; @@ -791,7 +791,7 @@ struct BuffRemoveRequest_Struct // not in use struct BuffIconEntry_Struct { /*000*/ uint32 buff_slot; -/*004*/ uint32 spell_id; +/*004*/ int32 spell_id; /*008*/ uint32 tics_remaining; /*012*/ uint32 num_hits; // char name[0]; caster name is also here sometimes @@ -1513,7 +1513,7 @@ struct CombatDamage_Struct /* 00 */ uint16 target; /* 02 */ uint16 source; /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells -/* 05 */ uint32 spellid; +/* 05 */ int32 spellid; /* 09 */ int32 damage; /* 13 */ float force; // cd cc cc 3d /* 17 */ float hit_heading; // see above notes in Action_Struct @@ -1549,7 +1549,7 @@ struct Death_Struct /*004*/ uint32 killer_id; /*008*/ uint32 corpseid; // was corpseid /*012*/ uint32 attack_skill; // was type -/*016*/ uint32 spell_id; +/*016*/ int32 spell_id; /*020*/ uint32 bindzoneid; //bindzoneid? /*024*/ uint32 damage; /*028*/ uint32 unknown028; @@ -2658,7 +2658,7 @@ struct GroupFollow_Struct { // Live Follow Struct }; struct InspectBuffs_Struct { -/*000*/ uint32 spell_id[BUFF_COUNT]; +/*000*/ int32 spell_id[BUFF_COUNT]; /*168*/ int32 tics_remaining[BUFF_COUNT]; }; @@ -3077,7 +3077,7 @@ struct Resurrect_Struct /*024*/ char your_name[64]; /*088*/ uint32 unknown088; /*092*/ char rezzer_name[64]; -/*156*/ uint32 spellid; +/*156*/ int32 spellid; /*160*/ char corpse_name[64]; /*224*/ uint32 action; /*228*/ uint32 unknown228; @@ -4581,7 +4581,7 @@ struct SendAA_Struct { /*0045*/ uint32 prereq_minpoints_count; // mutliple prereqs at least 1, even no prereqs /*0049*/ uint32 prereq_minpoints; //min points in the prereq /*0053*/ uint32 type; -/*0057*/ uint32 spellid; +/*0057*/ int32 spellid; /*0061*/ uint32 unknown057; // Introduced during HoT - Seen 1 - Maybe account status or enable/disable AA? /*0065*/ uint32 spell_type; /*0069*/ uint32 spell_refresh; diff --git a/common/patches/rof_ops.h b/common/patches/rof_ops.h index ceb4ae8e9..ac554b6bd 100644 --- a/common/patches/rof_ops.h +++ b/common/patches/rof_ops.h @@ -27,8 +27,7 @@ E(OP_Barter) E(OP_BazaarSearch) E(OP_BeginCast) E(OP_BlockedBuffs) -E(OP_Buff) -E(OP_BuffCreate) +E(OP_BuffDefinition) E(OP_CancelTrade) E(OP_CastSpell) E(OP_ChannelMessage) @@ -81,7 +80,6 @@ E(OP_MoveItem) E(OP_NewSpawn) E(OP_NewZone) E(OP_OnLevelMessage) -E(OP_PetBuffWindow) E(OP_PlayerProfile) E(OP_RaidJoin) E(OP_RaidUpdate) @@ -104,7 +102,6 @@ E(OP_SpawnAppearance) E(OP_SpawnDoor) E(OP_SpecialMesg) E(OP_Stun) -E(OP_TargetBuffs) E(OP_TaskDescription) E(OP_TaskHistoryReply) E(OP_Track) @@ -131,7 +128,7 @@ D(OP_AugmentInfo) D(OP_AugmentItem) D(OP_BazaarSearch) D(OP_BlockedBuffs) -D(OP_Buff) +D(OP_BuffDefinition) D(OP_BuffRemoveRequest) D(OP_CastSpell) D(OP_ChannelMessage) diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index 2658a7c25..185fd7355 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -614,7 +614,7 @@ struct NewZone_Struct { */ struct MemorizeSpell_Struct { uint32 slot; // Spot in the spell book/memorized slot -uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) +int32 spell_id; // Spell id (200 or c8 is minor healing, etc) uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 reduction; // lowers reuse }; @@ -651,7 +651,7 @@ struct ManaChange_Struct { /*00*/ uint32 new_mana; // New Mana AMount /*04*/ uint32 stamina; -/*08*/ uint32 spell_id; +/*08*/ int32 spell_id; /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it @@ -665,7 +665,7 @@ struct SwapSpell_Struct struct BeginCast_Struct { -/*000*/ uint32 spell_id; +/*000*/ int32 spell_id; /*004*/ uint16 caster_id; /*006*/ uint32 cast_time; // in miliseconds /*010*/ @@ -674,7 +674,7 @@ struct BeginCast_Struct struct CastSpell_Struct { /*00*/ uint32 slot; -/*04*/ uint32 spell_id; +/*04*/ int32 spell_id; /*08*/ InventorySlot_Struct inventory_slot; // slot for clicky item, Seen unknown of 131 = normal cast /*20*/ uint32 target_id; /*24*/ uint32 cs_unknown[2]; @@ -706,7 +706,7 @@ struct SpellBuff_Struct /*002*/ uint8 unknown002; //pretty sure padding now /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? /*004*/ float bard_modifier; -/*008*/ uint32 spellid; +/*008*/ int32 spellid; /*012*/ uint32 duration; /*016*/ uint32 player_id; // caster ID, pretty sure just zone ID /*020*/ uint32 num_hits; @@ -737,7 +737,7 @@ struct BuffRemoveRequest_Struct // not in use struct BuffIconEntry_Struct { /*000*/ uint32 buff_slot; -/*004*/ uint32 spell_id; +/*004*/ int32 spell_id; /*008*/ uint32 tics_remaining; /*012*/ uint32 num_hits; // char name[0]; caster name is also here sometimes @@ -1500,7 +1500,7 @@ struct CombatDamage_Struct /* 00 */ uint16 target; /* 02 */ uint16 source; /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells -/* 05 */ uint32 spellid; +/* 05 */ int32 spellid; /* 09 */ int32 damage; /* 13 */ float force; // cd cc cc 3d /* 17 */ float hit_heading; // see above notes in Action_Struct @@ -1536,7 +1536,7 @@ struct Death_Struct /*004*/ uint32 killer_id; /*008*/ uint32 corpseid; // was corpseid /*012*/ uint32 attack_skill; // was type -/*016*/ uint32 spell_id; +/*016*/ int32 spell_id; /*020*/ uint32 bindzoneid; //bindzoneid? /*024*/ uint32 damage; /*028*/ uint32 unknown028; @@ -2603,7 +2603,7 @@ struct GroupFollow_Struct { // Live Follow Struct }; struct InspectBuffs_Struct { -/*000*/ uint32 spell_id[BUFF_COUNT]; +/*000*/ int32 spell_id[BUFF_COUNT]; /*168*/ int32 tics_remaining[BUFF_COUNT]; }; @@ -3013,7 +3013,7 @@ struct Resurrect_Struct /*024*/ char your_name[64]; /*088*/ uint32 unknown088; /*092*/ char rezzer_name[64]; -/*156*/ uint32 spellid; +/*156*/ int32 spellid; /*160*/ char corpse_name[64]; /*224*/ uint32 action; /*228*/ uint32 unknown228; @@ -4333,7 +4333,7 @@ struct SendAA_Struct { /*0045*/ uint32 prereq_minpoints_count; // mutliple prereqs at least 1, even no prereqs /*0049*/ uint32 prereq_minpoints; //min points in the prereq /*0053*/ uint32 type; -/*0057*/ uint32 spellid; +/*0057*/ int32 spellid; /*0061*/ uint32 unknown057; // Introduced during HoT - Seen 1 - Maybe account status or enable/disable AA? /*0065*/ uint32 spell_type; /*0069*/ uint32 spell_refresh; diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index ca8602565..e2faabae0 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -31,6 +31,8 @@ #include "common/raid.h" #include "common/rulesys.h" #include "common/strings.h" +#include "zone/client.h" +#include "zone/mob.h" #include #include @@ -61,7 +63,6 @@ namespace SoD static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot); static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot); - static inline int ServerToSoDBuffSlot(int index); static inline int SoDToServerBuffSlot(int index); void Register(EQStreamIdentifier &into) @@ -293,7 +294,7 @@ namespace SoD dest->FastQueuePacket(&in, ack_req); } - ENCODE(OP_Buff) + ENCODE(OP_BuffDefinition) { ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -306,7 +307,7 @@ namespace SoD OUT(buff.duration); OUT(buff.counters); OUT(buff.player_id); - eq->slotid = ServerToSoDBuffSlot(emu->slotid); + OUT(slotid); OUT(bufffade); FINISH_ENCODE(); @@ -1375,38 +1376,6 @@ namespace SoD FINISH_ENCODE(); } - ENCODE(OP_PetBuffWindow) - { - EQApplicationPacket *in = *p; - *p = nullptr; - - unsigned char *__emu_buffer = in->pBuffer; - PetBuff_Struct *emu = (PetBuff_Struct *)__emu_buffer; - int PacketSize = 7 + (emu->buffcount * 13); - in->size = PacketSize; - in->pBuffer = new unsigned char[in->size]; - char *Buffer = (char *)in->pBuffer; - - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->petid); - VARSTRUCT_ENCODE_TYPE(uint16, Buffer, emu->buffcount); - - for (unsigned int i = 0; i < PET_BUFF_COUNT; ++i) - { - if (emu->spellid[i]) - { - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, i); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->spellid[i]); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->ticsremaining[i]); - VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // This is a string. Name of the caster of the buff. - } - } - - VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->buffcount); // I think this is actually some sort of type - - delete[] __emu_buffer; - dest->FastQueuePacket(&in, ack_req); - } - ENCODE(OP_PlayerProfile) { SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct); @@ -2145,35 +2114,6 @@ namespace SoD FINISH_ENCODE(); } - ENCODE(OP_TargetBuffs) - { - SETUP_VAR_ENCODE(BuffIcon_Struct); - - uint32 sz = 7 + (13 * emu->count); - __packet->size = sz; - __packet->pBuffer = new unsigned char[sz]; - memset(__packet->pBuffer, 0, sz); - - uchar *ptr = __packet->pBuffer; - *((uint32*)ptr) = emu->entity_id; - ptr += sizeof(uint32); - - *((uint16*)ptr) = emu->count; - ptr += sizeof(uint16); - - for (uint16 i = 0; i < emu->count; ++i) - { - *((uint32*)ptr) = emu->entries[i].buff_slot; - ptr += sizeof(uint32); - *((uint32*)ptr) = emu->entries[i].spell_id; - ptr += sizeof(uint32); - *((uint32*)ptr) = emu->entries[i].tics_remaining; - ptr += sizeof(uint32); - ptr += 1; - } - FINISH_ENCODE(); - } - ENCODE(OP_TaskDescription) { EQApplicationPacket *in = *p; @@ -2877,7 +2817,7 @@ namespace SoD FINISH_DIRECT_DECODE(); } - DECODE(OP_Buff) + DECODE(OP_BuffDefinition) { DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -4259,19 +4199,6 @@ namespace SoD } } - static inline int ServerToSoDBuffSlot(int index) - { - // we're a disc - if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS) - return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS + - spells::LONG_BUFFS + spells::SHORT_BUFFS; - // we're a song - if (index >= EQ::spells::LONG_BUFFS) - return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS; - // we're a normal buff - return index; // as long as we guard against bad slots server side, we should be fine - } - static inline int SoDToServerBuffSlot(int index) { // we're a disc @@ -4284,4 +4211,55 @@ namespace SoD // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } + + std::unique_ptr BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove, + bool buff_timers_suspended, const std::vector& slots) const + { + if (opcode == OP_RefreshPetBuffs || opcode == OP_RefreshTargetBuffs) { + Buffs_Struct* buffs = mob->GetBuffs(); + + size_t buffer_size = 7; // 7 bytes outside the list + std::vector send_slots; + if (slots.empty()) { + for (uint32_t slot = 0; slot < mob->GetMaxTotalSlots(); ++slot) + if (buffs[slot].spellid > 1) { + buffer_size += 13 + strlen(buffs[slot].caster_name); // 13 includes the null terminator + send_slots.push_back(slot); + } + } else { + for (uint32_t slot : slots) + if (slot < mob->GetMaxTotalSlots() && buffs[slot].spellid > 1) { + buffer_size += 13 + strlen(buffs[slot].caster_name); + send_slots.push_back(slot); + } + } + + // SoD only supports target and pet refresh, not self refresh packets + SerializeBuffer buffer(buffer_size); + + buffer.WriteUInt32(mob->GetID()); + buffer.WriteUInt16(send_slots.size()); + + for (uint32_t slot : send_slots) { + buffer.WriteUInt32(ServerToPatchBuffSlot(slot)); + buffer.WriteInt32(remove ? -1 : buffs[slot].spellid); + buffer.WriteInt32(buffs[slot].ticsremaining); + buffer.WriteString(buffs[slot].caster_name); + } + + buffer.WriteUInt8(opcode == OP_RefreshPetBuffs ? 2 : 0); + + return std::make_unique(opcode, std::move(buffer)); + } + + return nullptr; + } + +// 0 = self buff window, 1 = self target window, 2 = pet buff or target window, 4 = group, 5 = PC, 7 = NPC +void BuffComponent::SetRefreshType(std::unique_ptr& packet, uint8_t refresh_type) const +{ + if (packet) + packet->pBuffer[packet->size - 1] = refresh_type; +} + } /*SoD*/ diff --git a/common/patches/sod.h b/common/patches/sod.h index 203d52f19..c5b7dbfad 100644 --- a/common/patches/sod.h +++ b/common/patches/sod.h @@ -17,46 +17,40 @@ */ #pragma once -#include "sof.h" #include "common/struct_strategy.h" +#include "common/patches/sof.h" class EQStreamIdentifier; -namespace SoD -{ +namespace SoD { - //these are the only public member of this namespace. - extern void Register(EQStreamIdentifier &into); - extern void Reload(); +extern void Register(EQStreamIdentifier& into); +extern void Reload(); - - - //you should not directly access anything below.. - //I just dont feel like making a seperate header for it. - - class Strategy : public StructStrategy { - public: - Strategy(); - - protected: - - virtual std::string Describe() const; - virtual const EQ::versions::ClientVersion ClientVersion() const; - - //magic macro to declare our opcode processors - #include "ss_declare.h" - #include "sod_ops.h" - }; - -} /*SoD*/ - -namespace Message { - -class SoD : public SoF +class Strategy : public StructStrategy { public: - SoD() = default; - ~SoD() override = default; + Strategy(); + +protected: + virtual std::string Describe() const; + virtual const EQ::versions::ClientVersion ClientVersion() const; + + //magic macro to declare our opcode processors +#include "ss_declare.h" +#include "sod_ops.h" }; -} // namespace Message +class BuffComponent : public Titanium::BuffComponent +{ +public: + BuffComponent(uint32_t maxLongBuffs, uint32_t maxShortBuffs) : Titanium::BuffComponent(maxLongBuffs, maxShortBuffs) {} + BuffComponent() = delete; + ~BuffComponent() override = default; + + std::unique_ptr RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove, + bool buff_timers_suspended, const std::vector& slots) const override; + void SetRefreshType(std::unique_ptr& packet, uint8_t refresh_type) const override; +}; + +} /*SoD*/ diff --git a/common/patches/sod_ops.h b/common/patches/sod_ops.h index 48cebca54..cf4f48ab4 100644 --- a/common/patches/sod_ops.h +++ b/common/patches/sod_ops.h @@ -23,7 +23,7 @@ E(OP_ApplyPoison) E(OP_AugmentInfo) E(OP_Barter) E(OP_BazaarSearch) -E(OP_Buff) +E(OP_BuffDefinition) E(OP_CancelTrade) E(OP_ChannelMessage) E(OP_CharInventory) @@ -65,7 +65,6 @@ E(OP_MoveItem) E(OP_NewSpawn) E(OP_NewZone) E(OP_OnLevelMessage) -E(OP_PetBuffWindow) E(OP_PlayerProfile) E(OP_RaidJoin) E(OP_RaidUpdate) @@ -80,7 +79,6 @@ E(OP_SomeItemPacketMaybe) E(OP_SpawnDoor) E(OP_SpecialMesg) E(OP_Stun) -E(OP_TargetBuffs) E(OP_TaskDescription) E(OP_Track) E(OP_Trader) @@ -102,7 +100,7 @@ D(OP_AugmentInfo) D(OP_AugmentItem) D(OP_BazaarSearch) D(OP_BookButton) -D(OP_Buff) +D(OP_BuffDefinition) D(OP_CastSpell) D(OP_ChannelMessage) D(OP_CharacterCreate) diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h index dcf58ca95..8a45e6dc0 100644 --- a/common/patches/sod_structs.h +++ b/common/patches/sod_structs.h @@ -480,7 +480,7 @@ struct NewZone_Struct { */ struct MemorizeSpell_Struct { uint32 slot; // Spot in the spell book/memorized slot -uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) +int32 spell_id; // Spell id (200 or c8 is minor healing, etc) uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 reduction; // lowers reuse }; @@ -517,7 +517,7 @@ struct ManaChange_Struct { /*00*/ uint32 new_mana; // New Mana AMount /*04*/ uint32 stamina; -/*08*/ uint32 spell_id; +/*08*/ int32 spell_id; /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it @@ -535,14 +535,14 @@ struct BeginCast_Struct { // len = 8 /*004*/ uint16 caster_id; -/*006*/ uint16 spell_id; +/*006*/ int16 spell_id; /*016*/ uint32 cast_time; // in miliseconds }; struct CastSpell_Struct { uint32 slot; - uint32 spell_id; + int32 spell_id; uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 target_id; uint8 cs_unknown[4]; @@ -571,7 +571,7 @@ struct SpellBuff_Struct /*001*/ uint8 level; // Seen 1 for no buff /*002*/ uint8 bard_modifier; /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? -/*004*/ uint32 spellid; +/*004*/ int32 spellid; /*008*/ uint32 duration; /*012*/ uint32 counters; /*016*/ uint32 unknown016; @@ -1266,7 +1266,7 @@ struct CombatDamage_Struct /* 00 */ uint16 target; /* 02 */ uint16 source; /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells -/* 05 */ uint16 spellid; +/* 05 */ int16 spellid; /* 07 */ int32 damage; /* 11 */ float force; // cd cc cc 3d /* 15 */ float hit_heading; // see above notes in Action_Struct @@ -1301,7 +1301,7 @@ struct Death_Struct /*004*/ uint32 killer_id; /*008*/ uint32 corpseid; // was corpseid /*012*/ uint32 attack_skill; // was type -/*016*/ uint32 spell_id; +/*016*/ int32 spell_id; /*020*/ uint32 bindzoneid; //bindzoneid? /*024*/ uint32 damage; /*028*/ uint32 unknown028; @@ -2534,7 +2534,7 @@ struct Resurrect_Struct { char your_name[64]; uint32 unknown88; char rezzer_name[64]; - uint32 spellid; + int32 spellid; char corpse_name[64]; uint32 action; /* 228 */ @@ -3787,7 +3787,7 @@ struct SendAA_Struct { /*0037*/ uint32 prereq_skill; //is < 0, abs() is category # /*0041*/ uint32 prereq_minpoints; //min points in the prereq /*0045*/ uint32 type; -/*0049*/ uint32 spellid; +/*0049*/ int32 spellid; /*0053*/ uint32 spell_type; /*0057*/ uint32 spell_refresh; /*0061*/ uint32 classes; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index ed72691f6..519bdda13 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -60,7 +60,6 @@ namespace SoF static inline spells::CastingSlot ServerToSoFCastingSlot(EQ::spells::CastingSlot slot); static inline EQ::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location); - static inline int ServerToSoFBuffSlot(int index); static inline int SoFToServerBuffSlot(int index); void Register(EQStreamIdentifier &into) @@ -272,7 +271,7 @@ namespace SoF FINISH_ENCODE(); } - ENCODE(OP_Buff) + ENCODE(OP_BuffDefinition) { ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -285,7 +284,7 @@ namespace SoF OUT(buff.duration); OUT(buff.counters); OUT(buff.player_id); - eq->slotid = ServerToSoFBuffSlot(emu->slotid); + eq->slotid = SoFToServerBuffSlot(emu->slotid); OUT(bufffade); FINISH_ENCODE(); @@ -1049,28 +1048,6 @@ namespace SoF FINISH_ENCODE(); } - ENCODE(OP_PetBuffWindow) - { - ENCODE_LENGTH_EXACT(PetBuff_Struct); - SETUP_DIRECT_ENCODE(PetBuff_Struct, PetBuff_Struct); - - OUT(petid); - OUT(buffcount); - - int EQBuffSlot = 0; // do we really want to shuffle them around like this? - - for (uint32 EmuBuffSlot = 0; EmuBuffSlot < PET_BUFF_COUNT; ++EmuBuffSlot) - { - if (emu->spellid[EmuBuffSlot]) - { - eq->spellid[EQBuffSlot] = emu->spellid[EmuBuffSlot]; - eq->ticsremaining[EQBuffSlot++] = emu->ticsremaining[EmuBuffSlot]; - } - } - - FINISH_ENCODE(); - } - ENCODE(OP_PlayerProfile) { SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct); @@ -2321,7 +2298,7 @@ namespace SoF FINISH_DIRECT_DECODE(); } - DECODE(OP_Buff) + DECODE(OP_BuffDefinition) { DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -2334,7 +2311,7 @@ namespace SoF IN(buff.duration); IN(buff.counters); IN(buff.player_id); - emu->slotid = SoFToServerBuffSlot(eq->slotid); + IN(slotid); IN(bufffade); FINISH_DIRECT_DECODE(); @@ -3657,18 +3634,6 @@ namespace SoF } } - static inline int ServerToSoFBuffSlot(int index) { - // we're a disc - if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS) - return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS + - spells::LONG_BUFFS + spells::SHORT_BUFFS; - // we're a song - if (index >= EQ::spells::LONG_BUFFS) - return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS; - // we're a normal buff - return index; // as long as we guard against bad slots server side, we should be fine - } - static inline int SoFToServerBuffSlot(int index) { // we're a disc diff --git a/common/patches/sof.h b/common/patches/sof.h index 3c0206d17..9bb0b6be5 100644 --- a/common/patches/sof.h +++ b/common/patches/sof.h @@ -17,46 +17,28 @@ */ #pragma once -#include "titanium.h" #include "common/struct_strategy.h" +#include "common/patches/titanium.h" class EQStreamIdentifier; -namespace SoF -{ +namespace SoF { - //these are the only public member of this namespace. - extern void Register(EQStreamIdentifier &into); - extern void Reload(); +extern void Register(EQStreamIdentifier& into); +extern void Reload(); - - - //you should not directly access anything below.. - //I just dont feel like making a seperate header for it. - - class Strategy : public StructStrategy { - public: - Strategy(); - - protected: - - virtual std::string Describe() const; - virtual const EQ::versions::ClientVersion ClientVersion() const; - - //magic macro to declare our opcode processors - #include "ss_declare.h" - #include "sof_ops.h" - }; - -} /*SoF*/ - -namespace Message { - -class SoF : public Titanium +class Strategy : public StructStrategy { public: - SoF() = default; - ~SoF() override = default; + Strategy(); + +protected: + virtual std::string Describe() const; + virtual const EQ::versions::ClientVersion ClientVersion() const; + + //magic macro to declare our opcode processors +#include "ss_declare.h" +#include "sof_ops.h" }; -} // namespace Message +} /*SoF*/ diff --git a/common/patches/sof_ops.h b/common/patches/sof_ops.h index 58f9dc253..84704178c 100644 --- a/common/patches/sof_ops.h +++ b/common/patches/sof_ops.h @@ -23,7 +23,7 @@ E(OP_ApplyPoison) E(OP_AugmentInfo) E(OP_BazaarSearch) E(OP_BecomeTrader) -E(OP_Buff) +E(OP_BuffDefinition) E(OP_CancelTrade) E(OP_ChannelMessage) E(OP_CharInventory) @@ -60,7 +60,6 @@ E(OP_MoveItem) E(OP_NewSpawn) E(OP_NewZone) E(OP_OnLevelMessage) -E(OP_PetBuffWindow) E(OP_PlayerProfile) E(OP_RaidJoin) E(OP_RaidUpdate) @@ -93,7 +92,7 @@ D(OP_ApplyPoison) D(OP_AugmentInfo) D(OP_AugmentItem) D(OP_BookButton) -D(OP_Buff) +D(OP_BuffDefinition) D(OP_Bug) D(OP_CastSpell) D(OP_ChannelMessage) diff --git a/common/patches/sof_structs.h b/common/patches/sof_structs.h index 6f137faed..531175a91 100644 --- a/common/patches/sof_structs.h +++ b/common/patches/sof_structs.h @@ -480,7 +480,7 @@ struct NewZone_Struct { */ struct MemorizeSpell_Struct { uint32 slot; // Spot in the spell book/memorized slot -uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) +int32 spell_id; // Spell id (200 or c8 is minor healing, etc) uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 reduction; // lowers reuse }; @@ -517,7 +517,7 @@ struct ManaChange_Struct { /*00*/ uint32 new_mana; // New Mana AMount /*04*/ uint32 stamina; -/*08*/ uint32 spell_id; +/*08*/ int32 spell_id; /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it @@ -535,14 +535,14 @@ struct BeginCast_Struct { // len = 8 /*004*/ uint16 caster_id; -/*006*/ uint16 spell_id; +/*006*/ int16 spell_id; /*016*/ uint32 cast_time; // in miliseconds }; struct CastSpell_Struct { uint32 slot; - uint32 spell_id; + int32 spell_id; uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 target_id; uint8 cs_unknown[4]; @@ -571,7 +571,7 @@ struct SpellBuff_Struct /*001*/ uint8 level; // Seen 1 for no buff /*002*/ uint8 bard_modifier; /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? -/*004*/ uint32 spellid; +/*004*/ int32 spellid; /*008*/ uint32 duration; /*012*/ uint32 counters; /*016*/ uint32 unknown016; @@ -1266,7 +1266,7 @@ struct CombatDamage_Struct /* 00 */ uint16 target; /* 02 */ uint16 source; /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells -/* 05 */ uint16 spellid; +/* 05 */ int16 spellid; /* 07 */ int32 damage; /* 11 */ float force; // cd cc cc 3d /* 15 */ float hit_heading; // see above notes in Action_Struct @@ -1301,7 +1301,7 @@ struct Death_Struct /*004*/ uint32 killer_id; /*008*/ uint32 corpseid; // was corpseid /*012*/ uint32 attack_skill; // was type -/*016*/ uint32 spell_id; +/*016*/ int32 spell_id; /*020*/ uint32 bindzoneid; //bindzoneid? /*024*/ uint32 damage; /*028*/ uint32 unknown028; @@ -2504,7 +2504,7 @@ struct Resurrect_Struct { char your_name[64]; uint32 unknown88; char rezzer_name[64]; - uint32 spellid; + int32 spellid; char corpse_name[64]; uint32 action; /* 228 */ @@ -3711,7 +3711,7 @@ struct SendAA_Struct { /*0037*/ uint32 prereq_skill; //is < 0, abs() is category # /*0041*/ uint32 prereq_minpoints; //min points in the prereq /*0045*/ uint32 type; -/*0049*/ uint32 spellid; +/*0049*/ int32 spellid; /*0053*/ uint32 spell_type; /*0057*/ uint32 spell_refresh; /*0061*/ uint32 classes; diff --git a/common/patches/template.h b/common/patches/template.h index 8fe3775cb..93c7dbea3 100644 --- a/common/patches/template.h +++ b/common/patches/template.h @@ -23,27 +23,20 @@ class EQStreamIdentifier; namespace TEMPLATE { - //these are the only public member of this namespace. - extern void Register(EQStreamIdentifier &into); - extern void Reload(); +extern void Register(EQStreamIdentifier& into); +extern void Reload(); +class Strategy : public StructStrategy +{ +public: + Strategy(); - - //you should not directly access anything below.. - //I just dont feel like making a seperate header for it. - - class Strategy : public StructStrategy { - public: - Strategy(); - - protected: - - virtual std::string Describe() const; - virtual const EQClientVersion ClientVersion() const; - //magic macro to declare our opcodes - #include "ss_declare.h" - #include "TEMPLATE_ops.h" - - }; +protected: + virtual std::string Describe() const; + virtual const EQClientVersion ClientVersion() const; + //magic macro to declare our opcodes +#include "ss_declare.h" +#include "TEMPLATE_ops.h" +}; }; diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 731cc1488..67164e714 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -32,6 +32,7 @@ #include "common/raid.h" #include "common/rulesys.h" #include "common/strings.h" +#include "zone/mob.h" #include "zone/string_ids.h" #include @@ -62,7 +63,6 @@ namespace Titanium static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQ::spells::CastingSlot slot); static inline EQ::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location); - static inline int ServerToTitaniumBuffSlot(int index); static inline int TitaniumToServerBuffSlot(int index); void Register(EQStreamIdentifier &into) @@ -326,7 +326,7 @@ namespace Titanium } } - ENCODE(OP_Buff) + ENCODE(OP_BuffDefinition) { ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -339,7 +339,7 @@ namespace Titanium OUT(buff.duration); OUT(buff.counters); OUT(buff.player_id); - eq->slotid = ServerToTitaniumBuffSlot(emu->slotid); + OUT(slotid); OUT(bufffade); FINISH_ENCODE(); @@ -1307,28 +1307,6 @@ namespace Titanium FINISH_ENCODE(); } - ENCODE(OP_PetBuffWindow) - { - ENCODE_LENGTH_EXACT(PetBuff_Struct); - SETUP_DIRECT_ENCODE(PetBuff_Struct, PetBuff_Struct); - - OUT(petid); - OUT(buffcount); - - int EQBuffSlot = 0; // do we really want to shuffle them around like this? - - for (uint32 EmuBuffSlot = 0; EmuBuffSlot < PET_BUFF_COUNT; ++EmuBuffSlot) - { - if (emu->spellid[EmuBuffSlot]) - { - eq->spellid[EQBuffSlot] = emu->spellid[EmuBuffSlot]; - eq->ticsremaining[EQBuffSlot++] = emu->ticsremaining[EmuBuffSlot]; - } - } - - FINISH_ENCODE(); - } - ENCODE(OP_PlayerProfile) { SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct); @@ -2540,7 +2518,7 @@ namespace Titanium } } - DECODE(OP_Buff) + DECODE(OP_BuffDefinition) { DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -3894,19 +3872,6 @@ namespace Titanium } } - static inline int ServerToTitaniumBuffSlot(int index) - { - // we're a disc - if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS) - return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS + - spells::LONG_BUFFS + spells::SHORT_BUFFS; - // we're a song - if (index >= EQ::spells::LONG_BUFFS) - return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS; - // we're a normal buff - return index; // as long as we guard against bad slots server side, we should be fine - } - static inline int TitaniumToServerBuffSlot(int index) { // we're a disc @@ -3919,10 +3884,8 @@ namespace Titanium // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } -} /*Titanium*/ -namespace Message { -std::unique_ptr Titanium::Simple(uint32_t color, uint32_t id) const +std::unique_ptr MessageComponent::Simple(uint32_t color, uint32_t id) const { uint32_t string_id = ResolveID(id); if (string_id > 0) { @@ -3938,8 +3901,8 @@ std::unique_ptr Titanium::Simple(uint32_t color, uint32_t i return nullptr; } -std::unique_ptr Titanium::Formatted( - uint32_t color, uint32_t id, const std::array& args) const +std::unique_ptr MessageComponent::Formatted(uint32_t color, uint32_t id, + const FormattedArgs& args) const { uint32_t string_id = ResolveID(id); if (string_id > 0) { @@ -3966,7 +3929,7 @@ std::unique_ptr Titanium::Formatted( return nullptr; } -std::unique_ptr Titanium::InterruptSpell(uint32_t message, uint32_t spawn_id, +std::unique_ptr MessageComponent::InterruptSpell(uint32_t message, uint32_t spawn_id, const char* spell_link) const { auto outapp = std::make_unique(OP_InterruptCast, sizeof(InterruptCast_Struct)); @@ -3978,40 +3941,121 @@ std::unique_ptr Titanium::InterruptSpell(uint32_t message, return outapp; } -std::unique_ptr Titanium::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id, - const char* name, - const char* spell_link) const +std::unique_ptr MessageComponent::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id, + const char* name, const char* spell_link) const { auto outapp = std::make_unique(OP_InterruptCast, sizeof(InterruptCast_Struct) + strlen(name) + 1); auto ic = reinterpret_cast(outapp->pBuffer); ic->messageid = ResolveID(message); ic->spawnid = spawn_id; - fmt::format_to_n(ic->message, strlen(name) + 1, "{}\0", name); + strcpy(ic->message, spell_link); return outapp; } // A value of 0 means that the string isn't mapped in this client, valid string ids start at 1 -uint32_t Titanium::ResolveID(uint32_t id) const +uint32_t MessageComponent::ResolveID(uint32_t id) const { // passthrough — string IDs are defined at the base client level; // override in patches where IDs need remapping return id; } -void Titanium::ResolveArguments(uint32_t id, std::array& args) const +void MessageComponent::ResolveArguments(uint32_t id, std::array& args) const { switch (id) { case SPELL_FIZZLE: case MISS_NOTE: - args[0] = nullptr; // drop spell link + args[0] = nullptr; // the 0th (and only) argument here is the spell link, not supported before TOB break; case SPELL_FIZZLE_OTHER: case MISSED_NOTE_OTHER: - args[1] = nullptr; // drop spell link + args[1] = nullptr; // the 1st argument here is the spell link, not supported before TOB break; default: break; } } -} // namespace Message +std::unique_ptr BuffComponent::BuffDefinition(Mob* mob, const Buffs_Struct& buff, uint32_t slot, + bool fade) const +{ + auto outapp = std::make_unique(OP_BuffDefinition, sizeof(SpellBuffPacket_Struct)); + auto sbf = reinterpret_cast(outapp->pBuffer); + + sbf->entityid = mob->GetID(); + + sbf->buff.effect_type = 2; + + sbf->buff.level = buff.casterlevel > 0 ? buff.casterlevel : mob->GetLevel(); + sbf->buff.bard_modifier = buff.instrument_mod; + sbf->buff.spellid = buff.spellid; + sbf->buff.duration = buff.ticsremaining; + if (buff.dot_rune) + sbf->buff.counters = buff.dot_rune; + else if (buff.magic_rune) + sbf->buff.counters = buff.magic_rune; + else if (buff.melee_rune) + sbf->buff.counters = buff.melee_rune; + else if (buff.counters) + sbf->buff.counters = buff.counters; + sbf->buff.player_id = buff.casterid; + sbf->buff.num_hits = buff.hit_number; + sbf->buff.y = buff.caston_y; + sbf->buff.x = buff.caston_x; + sbf->buff.z = buff.caston_z; + + sbf->slotid = ServerToPatchBuffSlot(slot); + sbf->bufffade = fade; + + return outapp; +} + +std::unique_ptr BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove, + bool buff_timers_suspended, const std::vector& slots) const +{ + // titanium only sends refresh for pet buffs + if (opcode == OP_RefreshPetBuffs) { + Buffs_Struct* buffs = mob->GetBuffs(); + + std::vector send_slots; + if (slots.empty()) { + for (uint32_t slot = 0; slot < mob->GetMaxTotalSlots(); ++slot) + if (buffs[slot].spellid > 1) + send_slots.push_back(slot); + } else { + for (uint32_t slot : slots) + if (slot < mob->GetMaxTotalSlots() && buffs[slot].spellid > 1) + send_slots.push_back(slot); + } + + auto outapp = std::make_unique(OP_RefreshPetBuffs, sizeof(PetBuff_Struct)); + auto pbs = reinterpret_cast(outapp->pBuffer); + memset(outapp->pBuffer, 0, outapp->size); + + pbs->petid = mob->GetID(); + int MaxSlots = mob->GetMaxTotalSlots(); + if (MaxSlots > PET_BUFF_COUNT) + MaxSlots = PET_BUFF_COUNT; + + int count = 0; + for (uint32_t slot : send_slots) { + if (slot < MaxSlots) { + pbs->spellid[slot] = buffs[slot].spellid; + pbs->ticsremaining[slot] = buffs[slot].ticsremaining; + ++count; + } + } + + pbs->buffcount = count; + + return outapp; + } + + return nullptr; +} + +bool BuffComponent::NeedsWearMessage() const { return true; } + +void BuffComponent::SetRefreshType(std::unique_ptr& packet, uint8_t refresh_type) const {} + +} /*Titanium*/ diff --git a/common/patches/titanium.h b/common/patches/titanium.h index e31c4ef63..4fa4c2add 100644 --- a/common/patches/titanium.h +++ b/common/patches/titanium.h @@ -17,51 +17,40 @@ */ #pragma once -#include "IMessage.h" #include "common/struct_strategy.h" +#include "common/patches/IBuff.h" +#include "common/patches/IMessage.h" class EQStreamIdentifier; -namespace Titanium -{ +namespace Titanium { - //these are the only public member of this namespace. - extern void Register(EQStreamIdentifier &into); - extern void Reload(); +extern void Register(EQStreamIdentifier& into); +extern void Reload(); - - - //you should not directly access anything below.. - //I just dont feel like making a seperate header for it. - - class Strategy : public StructStrategy { - public: - Strategy(); - - protected: - - virtual std::string Describe() const; - virtual const EQ::versions::ClientVersion ClientVersion() const; - - //magic macro to declare our opcode processors - #include "ss_declare.h" - #include "titanium_ops.h" - }; - -} /*Titanium*/ - -// out-going message packets -namespace Message { - -class Titanium : public IMessage +class Strategy : public StructStrategy { public: - Titanium() = default; - ~Titanium() override = default; + Strategy(); + +protected: + virtual std::string Describe() const; + virtual const EQ::versions::ClientVersion ClientVersion() const; + + //magic macro to declare our opcode processors +#include "ss_declare.h" +#include "titanium_ops.h" +}; + +class MessageComponent : public ClientPatch::IMessage +{ +public: + MessageComponent() = default; + ~MessageComponent() override = default; std::unique_ptr Simple(uint32_t color, uint32_t id) const override; std::unique_ptr Formatted(uint32_t color, uint32_t id, - const std::array& args) const override; + const FormattedArgs& args) const override; std::unique_ptr InterruptSpell(uint32_t message, uint32_t spawn_id, const char* spell_link) const override; @@ -74,5 +63,20 @@ protected: virtual void ResolveArguments(uint32_t id, std::array& args) const; }; -} // namespace Message +class BuffComponent : public ClientPatch::IBuff +{ +public: + BuffComponent(uint32_t maxLongBuffs, uint32_t maxShortBuffs) : IBuff(maxLongBuffs, maxShortBuffs) {} + BuffComponent() = delete; + ~BuffComponent() override = default; + + std::unique_ptr BuffDefinition(Mob* mob, const Buffs_Struct& buff, uint32_t slot, + bool fade) const override; + std::unique_ptr RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove, + bool buff_timers_suspended, const std::vector& slots) const override; + bool NeedsWearMessage() const override; + void SetRefreshType(std::unique_ptr& packet, uint8_t refresh_type) const override; +}; + +} /*Titanium*/ diff --git a/common/patches/titanium_ops.h b/common/patches/titanium_ops.h index 1116baac7..96c323402 100644 --- a/common/patches/titanium_ops.h +++ b/common/patches/titanium_ops.h @@ -21,7 +21,7 @@ E(OP_AdventureMerchantSell) E(OP_ApplyPoison) E(OP_BazaarSearch) E(OP_BecomeTrader) -E(OP_Buff) +E(OP_BuffDefinition) E(OP_ChannelMessage) E(OP_CharInventory) E(OP_ClientUpdate) @@ -61,7 +61,6 @@ E(OP_ManaChange) E(OP_MemorizeSpell) E(OP_MoveItem) E(OP_OnLevelMessage) -E(OP_PetBuffWindow) E(OP_PlayerProfile) E(OP_NewSpawn) E(OP_MarkRaidNPC) @@ -91,7 +90,7 @@ D(OP_AdventureMerchantSell) D(OP_ApplyPoison) D(OP_AugmentItem) D(OP_BazaarSearch) -D(OP_Buff) +D(OP_BuffDefinition) D(OP_Bug) D(OP_CastSpell) D(OP_ChannelMessage) diff --git a/common/patches/titanium_structs.h b/common/patches/titanium_structs.h index 3d3dfadd4..fcd482f60 100644 --- a/common/patches/titanium_structs.h +++ b/common/patches/titanium_structs.h @@ -406,7 +406,7 @@ struct NewZone_Struct { */ struct MemorizeSpell_Struct { uint32 slot; // Spot in the spell book/memorized slot -uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) +int32 spell_id; // Spell id (200 or c8 is minor healing, etc) uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 reduction; // lowers reuse }; @@ -442,7 +442,7 @@ struct ManaChange_Struct { /*00*/ uint32 new_mana; // New Mana AMount /*04*/ uint32 stamina; -/*08*/ uint32 spell_id; +/*08*/ int32 spell_id; /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like }; @@ -459,14 +459,14 @@ struct BeginCast_Struct { // len = 8 /*000*/ uint16 caster_id; -/*002*/ uint16 spell_id; +/*002*/ int16 spell_id; /*004*/ uint32 cast_time; // in miliseconds }; struct CastSpell_Struct { uint32 slot; - uint32 spell_id; + int32 spell_id; uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 target_id; uint8 cs_unknown[4]; @@ -495,7 +495,7 @@ struct SpellBuff_Struct /*001*/ uint8 level; /*002*/ uint8 bard_modifier; /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? -/*004*/ uint32 spellid; +/*004*/ int32 spellid; /*008*/ int32 duration; /*012*/ uint32 counters; // single book keeping value (counters, rune/vie) /*016*/ uint32 player_id; // caster ID, pretty sure just zone ID @@ -1142,7 +1142,7 @@ struct CombatDamage_Struct /* 00 */ uint16 target; /* 02 */ uint16 source; /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells, skill -/* 05 */ uint16 spellid; +/* 05 */ int16 spellid; /* 07 */ uint32 damage; /* 11 */ float force; /* 15 */ float hit_heading; // see above notes in Action_Struct @@ -1177,7 +1177,7 @@ struct Death_Struct /*004*/ uint32 killer_id; /*008*/ uint32 corpseid; // was corpseid /*012*/ uint32 attack_skill; // was type -/*016*/ uint32 spell_id; +/*016*/ int32 spell_id; /*020*/ uint32 bindzoneid; //bindzoneid? /*024*/ uint32 damage; /*028*/ uint32 unknown028; @@ -2233,7 +2233,7 @@ struct Resurrect_Struct { char your_name[64]; uint32 unknown88; char rezzer_name[64]; - uint32 spellid; + int32 spellid; char corpse_name[64]; uint32 action; /* 228 */ @@ -3247,7 +3247,7 @@ struct SendAA_Struct { /*0040*/ uint32 prereq_skill; //is < 0, abs() is category # /*0044*/ uint32 prereq_minpoints; //min points in the prereq /*0048*/ uint32 type; -/*0052*/ uint32 spellid; +/*0052*/ int32 spellid; /*0056*/ uint32 spell_type; /*0060*/ uint32 spell_refresh; /*0064*/ uint32 classes; diff --git a/common/patches/tob.cpp b/common/patches/tob.cpp index 41b014448..e40bda653 100644 --- a/common/patches/tob.cpp +++ b/common/patches/tob.cpp @@ -1,22 +1,46 @@ -#include "../global_define.h" -#include "../eqemu_config.h" -#include "../eqemu_logsys.h" +/* EQEmu: EQEmulator + +Copyright (C) 2001-2026 EQEmu Development Team + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "tob.h" -#include "../opcodemgr.h" - -#include "../eq_stream_ident.h" -#include "../crc32.h" - -#include "../eq_packet_structs.h" -#include "../misc_functions.h" -#include "../strings.h" -#include "../inventory_profile.h" #include "tob_structs.h" -#include "../rulesys.h" -#include "../path_manager.h" -#include "../classes.h" -#include "../races.h" -#include "../raid.h" + +#include "common/global_define.h" +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/opcodemgr.h" + +#include "common/eq_stream_ident.h" +#include "common/crc32.h" + +#include "common/eq_packet_structs.h" +#include "common/misc_functions.h" +#include "common/strings.h" +#include "common/inventory_profile.h" +#include "common/rulesys.h" +#include "common/path_manager.h" +#include "common/classes.h" +#include "common/packet_dump.h" +#include "common/races.h" +#include "common/raid.h" +#include "world/sof_char_create_data.h" +#include "zone/client.h" +#include "zone/mob.h" +#include "zone/string_ids.h" #include #include @@ -25,10 +49,6 @@ #include #include -#include "common/packet_dump.h" -#include "world/sof_char_create_data.h" -#include "zone/string_ids.h" - namespace TOB { static const char* name = "TOB"; @@ -67,7 +87,6 @@ namespace TOB static inline EQ::spells::CastingSlot TOBToServerCastingSlot(spells::CastingSlot slot); // buff slots - static inline int ServerToTOBBuffSlot(int index); static inline int TOBToServerBuffSlot(int index); void Register(EQStreamIdentifier& into) @@ -254,92 +273,6 @@ namespace TOB FINISH_ENCODE(); } - ENCODE(OP_Buff) - { - ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); - SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::EQAffectPacket_Struct); - - eq->entity_id = emu->entityid; - eq->unknown004 = 0; - - //fill in affect info - eq->affect.caster_id.Id = emu->buff.player_id; - eq->affect.flags = 0; - eq->affect.spell_id = emu->buff.spellid; - eq->affect.duration = emu->buff.duration; - eq->affect.initial_duration = emu->buff.duration; - eq->affect.hit_count = emu->buff.num_hits; - eq->affect.viral_timer = 0; - eq->affect.modifier = emu->buff.bard_modifier == 10 ? 1.0f : emu->buff.bard_modifier / 10.0f; - eq->affect.y = emu->buff.y; - eq->affect.x = emu->buff.x; - eq->affect.z = emu->buff.z; - eq->affect.level = emu->buff.level; - - eq->slot_id = ServerToTOBBuffSlot(emu->slotid); - if (emu->bufffade == 1) - { - eq->buff_fade = 1; - } - else - { - eq->buff_fade = 2; - } - - EQApplicationPacket* outapp = nullptr; - if (emu->bufffade == 1) - { - // Bit of a hack. OP_Buff appears to add/remove the buff while OP_BuffCreate adds/removes the actual buff icon - outapp = new EQApplicationPacket(OP_BuffCreate, 30); - outapp->WriteUInt32(emu->entityid); - outapp->WriteUInt32(0); // tic timer - outapp->WriteUInt8(0); // Type of OP_BuffCreate packet ? - outapp->WriteUInt16(1); // 1 buff in this packet - outapp->WriteUInt32(ServerToTOBBuffSlot(emu->slotid)); - outapp->WriteUInt32(0xffffffff); // SpellID (0xffff to remove) - outapp->WriteUInt32(0); // Duration - outapp->WriteUInt32(0); // numhits - outapp->WriteUInt8(0); // Caster name - outapp->WriteUInt8(0); // Type - outapp->WriteUInt8(0); // Type - } - - FINISH_ENCODE(); - - if (outapp) { - dest->FastQueuePacket(&outapp); - } - } - - ENCODE(OP_BuffCreate) - { - SETUP_VAR_ENCODE(BuffIcon_Struct); - - //TOB has one extra 0x00 byte before the end byte - uint32 sz = 13 + (17 * emu->count) + emu->name_lengths; // 17 includes nullterm - __packet->size = sz; - __packet->pBuffer = new unsigned char[sz]; - memset(__packet->pBuffer, 0, sz); - - __packet->WriteUInt32(emu->entity_id); - __packet->WriteUInt32(emu->tic_timer); - __packet->WriteUInt8(emu->all_buffs); // 1 indicates all buffs on the player (0 to add or remove a single buff) - __packet->WriteUInt16(emu->count); - - for (int i = 0; i < emu->count; ++i) - { - __packet->WriteUInt32(emu->type == 0 ? ServerToTOBBuffSlot(emu->entries[i].buff_slot) : emu->entries[i].buff_slot); - __packet->WriteUInt32(emu->entries[i].spell_id); - __packet->WriteUInt32(emu->entries[i].tics_remaining); - __packet->WriteUInt32(emu->entries[i].num_hits); // Unknown - __packet->WriteString(emu->entries[i].caster); - } - __packet->WriteUInt8(0); // Unknown1 - __packet->WriteUInt8(emu->type); // Unknown2 - - FINISH_ENCODE(); - } - ENCODE(OP_CancelTrade) { ENCODE_LENGTH_EXACT(CancelTrade_Struct); @@ -3603,6 +3536,20 @@ namespace TOB emu->Initialise = init; } + DECODE(OP_BuffRemoveRequest) + { + // This is to cater for the fact that short buff box buffs start at 30 as opposed to 25 in prior clients. + // + DECODE_LENGTH_EXACT(BuffRemoveRequest_Struct); + SETUP_DIRECT_DECODE(BuffRemoveRequest_Struct, BuffRemoveRequest_Struct); + + emu->SlotID = TOBToServerBuffSlot(eq->SlotID); + + IN(EntityID); + + FINISH_DIRECT_DECODE(); + } + DECODE(OP_CastSpell) { DECODE_LENGTH_EXACT(structs::CastSpell_Struct); @@ -5536,20 +5483,6 @@ namespace TOB } } - //TOB has the same # of long buffs as rof2, but 10 more short buffs - static inline int ServerToTOBBuffSlot(int index) - { - // we're a disc - if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS) - return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS + - spells::LONG_BUFFS + spells::SHORT_BUFFS; - // we're a song - if (index >= EQ::spells::LONG_BUFFS) - return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS; - // we're a normal buff - return index; // as long as we guard against bad slots server side, we should be fine - } - static inline int TOBToServerBuffSlot(int index) { // we're a disc @@ -5562,16 +5495,13 @@ namespace TOB // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } -} /*TOB*/ - -namespace Message { struct TOBStringIDs { static constexpr uint32_t DisarmedTrap = 1458; // You successfully disarmed the trap }; -uint32_t TOB::ResolveID(uint32_t id) const +uint32_t MessageComponent::ResolveID(uint32_t id) const { switch (id) { case YOU_FLURRY: @@ -5615,11 +5545,11 @@ uint32_t TOB::ResolveID(uint32_t id) const case DISARMED_TRAP: return TOBStringIDs::DisarmedTrap; default: - return RoF2::ResolveID(id); + return Titanium::MessageComponent::ResolveID(id); } } -void TOB::ResolveArguments(uint32_t id, std::array& args) const +void MessageComponent::ResolveArguments(uint32_t id, std::array& args) const { switch (id) { case SPELL_FIZZLE: @@ -5629,13 +5559,13 @@ void TOB::ResolveArguments(uint32_t id, std::array& args) const // take all arguments (spell link) break; default: - RoF2::ResolveArguments(id, args); + Titanium::MessageComponent::ResolveArguments(id, args); break; } } -std::unique_ptr TOB::Formatted(uint32_t color, uint32_t id, - const std::array& args) const +std::unique_ptr MessageComponent::Formatted(uint32_t color, uint32_t id, + const FormattedArgs& args) const { uint32_t string_id = ResolveID(id); if (string_id > 0) { @@ -5667,20 +5597,20 @@ std::unique_ptr TOB::Formatted(uint32_t color, uint32_t id, return nullptr; } -std::unique_ptr TOB::InterruptSpell(uint32_t message, uint32_t spawn_id, +std::unique_ptr MessageComponent::InterruptSpell(uint32_t message, uint32_t spawn_id, const char* spell_link) const { auto outapp = std::make_unique(OP_InterruptCast, sizeof(InterruptCast_Struct) + strlen(spell_link) + 1); auto ic = reinterpret_cast(outapp->pBuffer); ic->messageid = ResolveID(message); ic->spawnid = spawn_id; - fmt::format_to_n(ic->message, strlen(spell_link) + 1, "{}\0", spell_link); + strcpy(ic->message, spell_link); outapp->priority = 5; return outapp; } -std::unique_ptr TOB::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id, +std::unique_ptr MessageComponent::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id, const char* name, const char* spell_link) const { @@ -5689,10 +5619,116 @@ std::unique_ptr TOB::InterruptSpellOther(Mob* sender, uint3 auto ic = reinterpret_cast(outapp->pBuffer); ic->messageid = ResolveID(message); ic->spawnid = spawn_id; - fmt::format_to_n(ic->message, strlen(name) + strlen(spell_link) + 2, "{}\0{}\0", name, spell_link); + strcpy(ic->message, name); + strcpy(&ic->message[strlen(name) + 1], spell_link); return outapp; } -} // namespace Message +std::unique_ptr BuffComponent::BuffDefinition(Mob* mob, const Buffs_Struct& buff, uint32_t slot, bool fade) const +{ + auto packet = std::make_unique(OP_BuffDefinition, sizeof(structs::EQAffectPacket_Struct)); + auto affect = reinterpret_cast(packet->pBuffer); + // base packet + affect->entity_id = mob->GetID(); + affect->unknown004 = 0; + affect->slot_id = ServerToPatchBuffSlot(slot); + affect->buff_fade = fade ? 1 : 2; // 1 is remove, 2 is modify, 3 is add (only seen 1 and 2 sent) + + memset(&affect->affect, 0, sizeof(affect->affect)); + + // affect slots + for (int affect_slot = 0; affect_slot < 6; ++affect_slot) { + // all of this is unknown, just what we've seen + affect->affect.slots[affect_slot].slot = -1; // this is always -1 + affect->affect.slots[affect_slot].padding = 0; // this is never 0, but the values aren't clear + affect->affect.slots[affect_slot].value = 0; // this is always 0 + } + + // affect info + affect->affect.caster_id.Id = buff.casterid; + affect->affect.caster_id.WorldId = RuleI(World, Id); + affect->affect.caster_id.Reserved = 0; + affect->affect.flags = 0; + affect->affect.spell_id = buff.spellid; + affect->affect.duration = buff.ticsremaining; + affect->affect.initial_duration = buff.initialduration; + affect->affect.hit_count = buff.hit_number; + affect->affect.viral_timer = 0; + affect->affect.modifier = static_cast(buff.instrument_mod) / 10.f; + affect->affect.y = static_cast(buff.caston_y); + affect->affect.x = static_cast(buff.caston_x); + affect->affect.z = static_cast(buff.caston_z); + affect->affect.type = 2; + affect->affect.level = buff.casterlevel > 0 ? buff.casterlevel : mob->GetLevel(); + + //no idea if these are right; eqlib doesn't seem to know either + if (buff.dot_rune > 0) + affect->affect.charges = buff.dot_rune; + else if (buff.magic_rune > 0) + affect->affect.charges = buff.magic_rune; + else if (buff.melee_rune > 0) + affect->affect.charges = buff.melee_rune; + else if (buff.counters > 0) + affect->affect.charges = buff.counters; + + affect->affect.activatable = 0; + affect->affect.unknown1 = 0; //might be some timer, not sure though + + return packet; +} + +std::unique_ptr BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove, + bool buff_timers_suspended, const std::vector& slots) const +{ + Buffs_Struct* buffs = mob->GetBuffs(); + + // pre-calculate the buffer size to avoid too many grow calls + size_t buffer_size = 13; // 13 bytes outside the list + std::vector send_slots; + if (slots.empty()) { + for (uint32_t slot = 0; slot < mob->GetMaxTotalSlots(); ++slot) + if (buffs[slot].spellid > 1) { + buffer_size += 17 + strlen(buffs[slot].caster_name); // 17 includes the null terminator + send_slots.push_back(slot); + } + } else { + for (uint32_t slot : slots) + if (slot < mob->GetMaxTotalSlots() && buffs[slot].spellid > 1) { + buffer_size += 17 + strlen(buffs[slot].caster_name); + send_slots.push_back(slot); + } + } + + SerializeBuffer buffer(buffer_size); + + buffer.WriteUInt32(mob->GetID()); + buffer.WriteInt32(mob->GetRemainingTicTime()); + buffer.WriteUInt8(slots.empty() ? 1 : 0); // 1 indicates all buffs on the mob (0 to add or remove a single buff) + buffer.WriteUInt16(send_slots.size()); + + for (uint32_t slot : send_slots) { + buffer.WriteUInt32(ServerToPatchBuffSlot(slot)); // the server stores fewer buffs + buffer.WriteInt32(remove ? -1 : buffs[slot].spellid); + buffer.WriteUInt32(buffs[slot].ticsremaining); + buffer.WriteUInt32(buffs[slot].hit_number); + buffer.WriteString(buffs[slot].caster_name); + } + + buffer.WriteUInt8(opcode == OP_RefreshPetBuffs ? 2 : 0); + buffer.WriteUInt8(buff_timers_suspended ? 1 : 0); // bBuffTimersOnHold + + return std::make_unique(opcode, std::move(buffer)); +} + +bool BuffComponent::NeedsWearMessage() const { return false; } + +// 0 = self buff window, 1 = self target window, 2 = pet buff or target window, 4 = group, 5 = PC, 7 = NPC +void BuffComponent::SetRefreshType(std::unique_ptr& packet, uint8_t refresh_type) const +{ + if (packet) + packet->pBuffer[packet->size - 2] = refresh_type; +} + +} /*TOB*/ \ No newline at end of file diff --git a/common/patches/tob.h b/common/patches/tob.h index 39eb708cf..e4f473494 100644 --- a/common/patches/tob.h +++ b/common/patches/tob.h @@ -1,49 +1,55 @@ +/* EQEmu: EQEmulator + +Copyright (C) 2001-2026 EQEmu Development Team + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #pragma once -#include "rof2.h" -#include "../struct_strategy.h" +#include "common/struct_strategy.h" +#include "common/patches/rof2.h" class EQStreamIdentifier; -namespace TOB -{ +namespace TOB { - //these are the only public member of this namespace. - extern void Register(EQStreamIdentifier& into); - extern void Reload(); +extern void Register(EQStreamIdentifier& into); +extern void Reload(); - - - //you should not directly access anything below.. - //I just dont feel like making a seperate header for it. - - class Strategy : public StructStrategy { - public: - Strategy(); - - protected: - - virtual std::string Describe() const; - virtual const EQ::versions::ClientVersion ClientVersion() const; - - //magic macro to declare our opcode processors -#include "ss_declare.h" -#include "tob_ops.h" - - }; - -}; /*TOB*/ - -namespace Message { - -class TOB : public RoF2 +class Strategy : public StructStrategy { public: - TOB() {} - ~TOB() override {} + Strategy(); + +protected: + virtual std::string Describe() const; + virtual const EQ::versions::ClientVersion ClientVersion() const; + +//magic macro to declare our opcode processors +#include "ss_declare.h" +#include "tob_ops.h" +}; + +class MessageComponent : public Titanium::MessageComponent +{ +public: + MessageComponent() = default; + ~MessageComponent() override = default; std::unique_ptr Formatted(uint32_t color, uint32_t id, - const std::array& args) const override; + const FormattedArgs& args) const override; std::unique_ptr InterruptSpell(uint32_t message, uint32_t spawn_id, const char* spell_link) const override; @@ -55,4 +61,19 @@ protected: void ResolveArguments(uint32_t id, std::array& args) const override; }; -} // namespace Message +class BuffComponent : public UF::BuffComponent +{ +public: + BuffComponent(uint32_t maxLongBuffs, uint32_t maxShortBuffs) : UF::BuffComponent(maxLongBuffs, maxShortBuffs) {} + BuffComponent() = delete; + ~BuffComponent() override = default; + + std::unique_ptr + BuffDefinition(Mob* mob, const Buffs_Struct& buff, uint32_t slot, bool fade) const override; + std::unique_ptr RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove, + bool buff_timers_suspended, const std::vector& slots) const override; + bool NeedsWearMessage() const override; + void SetRefreshType(std::unique_ptr& packet, uint8_t refresh_type) const override; +}; + +}; /*TOB*/ diff --git a/common/patches/tob_limits.h b/common/patches/tob_limits.h index beb5e7b90..7988dd9b0 100644 --- a/common/patches/tob_limits.h +++ b/common/patches/tob_limits.h @@ -1,9 +1,9 @@ #ifndef COMMON_LAURION_LIMITS_H #define COMMON_LAURION_LIMITS_H -#include "../types.h" -#include "../emu_versions.h" -#include "../skills.h" +#include "common/types.h" +#include "common/emu_versions.h" +#include "common/skills.h" namespace TOB { diff --git a/common/patches/tob_ops.h b/common/patches/tob_ops.h index 0136ef5ba..01226f487 100644 --- a/common/patches/tob_ops.h +++ b/common/patches/tob_ops.h @@ -6,8 +6,6 @@ E(OP_ApplyPoison) E(OP_AugmentInfo) E(OP_BeginCast) E(OP_BlockedBuffs) -E(OP_Buff) -E(OP_BuffCreate) E(OP_CancelTrade) E(OP_CastSpell) E(OP_ChannelMessage) @@ -71,6 +69,7 @@ D(OP_ApproveName) D(OP_AugmentInfo) D(OP_AugmentItem) D(OP_BlockedBuffs) +D(OP_BuffRemoveRequest) D(OP_CastSpell) D(OP_ChannelMessage) D(OP_CharacterCreate) diff --git a/common/patches/tob_structs.h b/common/patches/tob_structs.h index e60cad405..04a066ad5 100644 --- a/common/patches/tob_structs.h +++ b/common/patches/tob_structs.h @@ -1,5 +1,25 @@ -#ifndef STEAM_LATEST_STRUCTS_H_ -#define STEAM_LATEST_STRUCTS_H_ +/* EQEmu: EQEmulator + +Copyright (C) 2001-2026 EQEmu Development Team + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#pragma once + +#include "common/eq_packet_structs.h" +#include "common/skills.h" namespace TOB { namespace structs { @@ -627,7 +647,7 @@ namespace TOB { /*004*/ uint32 killer_id; /*008*/ uint32 corpseid; //not read by client /*012*/ uint32 unknown1; //not read by client - /*016*/ uint32 spell_id; + /*016*/ int32 spell_id; /*020*/ uint32 attack_skill; /*024*/ uint64 damage; /*032*/ uint32 unknown2; //not read by client @@ -672,7 +692,7 @@ namespace TOB { struct BeginCast_Struct { - /*000*/ uint32 spell_id; + /*000*/ int32 spell_id; /*004*/ uint16 caster_id; /*006*/ uint32 cast_time; // in miliseconds /*010*/ uint32 unknown0a; // I think this is caster effective level but im not sure. live always sends 0. The client uses this for the spell link @@ -682,7 +702,7 @@ namespace TOB { struct MemorizeSpell_Struct { uint32 slot; // Spot in the spell book/memorized slot - uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) + int32 spell_id; // Spell id (200 or c8 is minor healing, etc) uint32 scribing; // -1 refreshes book, 0 scribe to book, 2 end mem, 1 start mem, 3 unmem, 4 set activated item keyring -- client will send back 2 if a 0 operation updated a memorized spell of the same group + subgroup uint32 reduction; // lower reuse (only used if scribing is 4) }; @@ -702,7 +722,7 @@ namespace TOB { struct CastSpell_Struct { /*00*/ uint32 slot; - /*04*/ uint32 spell_id; + /*04*/ int32 spell_id; /*08*/ CastSpellInventorySlot_Struct inventory_slot; /*18*/ uint32 target_id; /*22*/ uint32 spell_crc; @@ -732,7 +752,7 @@ namespace TOB { /*000*/ EQAffectSlot_Struct slots[6]; /*096*/ EqGuid caster_id; /*104*/ uint32 flags; - /*108*/ uint32 spell_id; + /*108*/ int32 spell_id; /*112*/ uint32 duration; /*116*/ uint32 initial_duration; /*120*/ uint32 hit_count; @@ -762,7 +782,7 @@ namespace TOB { { uint32 new_mana; uint32 stamina; // endurance - uint32 spell_id; + int32 spell_id; uint32 keepcasting; int32 slot; // gem slot }; @@ -775,7 +795,7 @@ namespace TOB { { uint16 target; uint16 source; - uint32 spell_id; + int32 spell_id; //4 leaves a buff uint32 effect_type; uint32 effective_casting_level; @@ -1086,5 +1106,3 @@ namespace TOB { }; //end namespace structs }; //end namespace tob - -#endif /*LAURION_STRUCTS_H_*/ \ No newline at end of file diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index 32f958b35..aa4715763 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -33,6 +33,7 @@ #include "common/raid.h" #include "common/rulesys.h" #include "common/strings.h" +#include "zone/mob.h" #include "cereal/types/vector.hpp" #include @@ -64,7 +65,6 @@ namespace UF static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot); static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot); - static inline int ServerToUFBuffSlot(int index); static inline int UFToServerBuffSlot(int index); void Register(EQStreamIdentifier &into) @@ -434,7 +434,7 @@ namespace UF } } - ENCODE(OP_Buff) + ENCODE(OP_BuffDefinition) { ENCODE_LENGTH_EXACT(SpellBuffPacket_Struct); SETUP_DIRECT_ENCODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -442,72 +442,17 @@ namespace UF OUT(entityid); OUT(buff.effect_type); OUT(buff.level); - // just so we're 100% sure we get a 1.0f ... - eq->buff.bard_modifier = emu->buff.bard_modifier == 10 ? 1.0f : emu->buff.bard_modifier / 10.0f; + OUT(buff.bard_modifier); OUT(buff.spellid); OUT(buff.duration); OUT(buff.num_hits); // TODO: implement slot_data stuff - eq->slotid = ServerToUFBuffSlot(emu->slotid); + OUT(slotid); OUT(bufffade); // Live (October 2011) sends a 2 rather than 0 when a buff is created, but it doesn't seem to matter. FINISH_ENCODE(); } - ENCODE(OP_BuffCreate) - { - SETUP_VAR_ENCODE(BuffIcon_Struct); - - uint32 sz = 12 + (17 * emu->count) + emu->name_lengths; // 17 includes nullterm - __packet->size = sz; - __packet->pBuffer = new unsigned char[sz]; - memset(__packet->pBuffer, 0, sz); - - __packet->WriteUInt32(emu->entity_id); - __packet->WriteUInt32(emu->tic_timer); - __packet->WriteUInt8(emu->all_buffs); // 1 = all buffs, 0 = 1 buff - __packet->WriteUInt16(emu->count); - - for (int i = 0; i < emu->count; ++i) - { - __packet->WriteUInt32(emu->type == 0 ? ServerToUFBuffSlot(emu->entries[i].buff_slot) : emu->entries[i].buff_slot); - __packet->WriteUInt32(emu->entries[i].spell_id); - __packet->WriteUInt32(emu->entries[i].tics_remaining); - __packet->WriteUInt32(emu->entries[i].num_hits); - __packet->WriteString(emu->entries[i].caster); - } - __packet->WriteUInt8(emu->type); - - FINISH_ENCODE(); - /* - uint32 write_var32 = 60; - uint8 write_var8 = 1; - ss.write((const char*)&emu->entity_id, sizeof(uint32)); - ss.write((const char*)&write_var32, sizeof(uint32)); - ss.write((const char*)&write_var8, sizeof(uint8)); - ss.write((const char*)&emu->count, sizeof(uint16)); - write_var32 = 0; - write_var8 = 0; - for(uint16 i = 0; i < emu->count; ++i) - { - if(emu->entries[i].buff_slot >= 25 && emu->entries[i].buff_slot < 37) - { - emu->entries[i].buff_slot += 5; - } - else if(emu->entries[i].buff_slot >= 37) - { - emu->entries[i].buff_slot += 14; - } - ss.write((const char*)&emu->entries[i].buff_slot, sizeof(uint32)); - ss.write((const char*)&emu->entries[i].spell_id, sizeof(uint32)); - ss.write((const char*)&emu->entries[i].tics_remaining, sizeof(uint32)); - ss.write((const char*)&write_var32, sizeof(uint32)); - ss.write((const char*)&write_var8, sizeof(uint8)); - } - ss.write((const char*)&write_var8, sizeof(uint8)); - */ - } - ENCODE(OP_CancelTrade) { ENCODE_LENGTH_EXACT(CancelTrade_Struct); @@ -1800,44 +1745,6 @@ namespace UF FINISH_ENCODE(); } - ENCODE(OP_PetBuffWindow) - { - EQApplicationPacket *in = *p; - *p = nullptr; - - unsigned char *__emu_buffer = in->pBuffer; - - PetBuff_Struct *emu = (PetBuff_Struct *)__emu_buffer; - - int PacketSize = 12 + (emu->buffcount * 17); - - in->size = PacketSize; - in->pBuffer = new unsigned char[in->size]; - - char *Buffer = (char *)in->pBuffer; - - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->petid); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); - VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 1); - VARSTRUCT_ENCODE_TYPE(uint16, Buffer, emu->buffcount); - - for (unsigned int i = 0; i < PET_BUFF_COUNT; ++i) - { - if (emu->spellid[i]) - { - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, i); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->spellid[i]); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->ticsremaining[i]); - VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // numhits - VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // This is a string. Name of the caster of the buff. - } - } - VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->buffcount); /// I think this is actually some sort of type - - delete[] __emu_buffer; - dest->FastQueuePacket(&in, ack_req); - } - ENCODE(OP_PlayerProfile) { SETUP_DIRECT_ENCODE(PlayerProfile_Struct, structs::PlayerProfile_Struct); @@ -2729,8 +2636,6 @@ namespace UF FINISH_ENCODE(); } - ENCODE(OP_TargetBuffs) { ENCODE_FORWARD(OP_BuffCreate); } - ENCODE(OP_TaskDescription) { EQApplicationPacket *in = *p; @@ -3638,7 +3543,7 @@ namespace UF FINISH_DIRECT_DECODE(); } - DECODE(OP_Buff) + DECODE(OP_BuffDefinition) { DECODE_LENGTH_EXACT(structs::SpellBuffPacket_Struct); SETUP_DIRECT_DECODE(SpellBuffPacket_Struct, structs::SpellBuffPacket_Struct); @@ -5208,19 +5113,6 @@ namespace UF } } - static inline int ServerToUFBuffSlot(int index) - { - // we're a disc - if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS) - return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS + - spells::LONG_BUFFS + spells::SHORT_BUFFS; - // we're a song - if (index >= EQ::spells::LONG_BUFFS) - return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS; - // we're a normal buff - return index; // as long as we guard against bad slots server side, we should be fine - } - static inline int UFToServerBuffSlot(int index) { // we're a disc @@ -5233,4 +5125,48 @@ namespace UF // we're a normal buff return index; // as long as we guard against bad slots server side, we should be fine } + + std::unique_ptr BuffComponent::RefreshBuffs(EmuOpcode opcode, Mob* mob, + bool remove, + bool buff_timers_suspended, const std::vector& slots) const +{ + // UF introduced the self refresh buff packet + Buffs_Struct* buffs = mob->GetBuffs(); + + size_t buffer_size = 12; // 12 bytes outside the list + std::vector send_slots; + if (slots.empty()) { + for (uint32_t slot = 0; slot < mob->GetMaxTotalSlots(); ++slot) + if (buffs[slot].spellid > 1) { + buffer_size += 17 + strlen(buffs[slot].caster_name); // 17 includes the null terminator + send_slots.push_back(slot); + } + } else { + for (uint32_t slot : slots) + if (slot < mob->GetMaxTotalSlots() && buffs[slot].spellid > 1) { + buffer_size += 17 + strlen(buffs[slot].caster_name); + send_slots.push_back(slot); + } + } + + SerializeBuffer buffer(buffer_size); + + buffer.WriteUInt32(mob->GetID()); + buffer.WriteUInt32(mob->GetRemainingTicTime()); + buffer.WriteUInt8(slots.empty() ? 1 : 0); + buffer.WriteUInt16(send_slots.size()); + + for (uint32_t slot : send_slots) { + buffer.WriteUInt32(ServerToPatchBuffSlot(slot)); + buffer.WriteInt32(remove ? -1 : buffs[slot].spellid); + buffer.WriteInt32(buffs[slot].ticsremaining); + buffer.WriteUInt32(buffs[slot].hit_number); + buffer.WriteString(buffs[slot].caster_name); + } + + buffer.WriteUInt8(opcode == OP_RefreshPetBuffs ? 2 : 0); + + return std::make_unique(opcode, std::move(buffer)); +} + } /*UF*/ diff --git a/common/patches/uf.h b/common/patches/uf.h index 05c27875b..9191226ee 100644 --- a/common/patches/uf.h +++ b/common/patches/uf.h @@ -17,46 +17,39 @@ */ #pragma once -#include "sod.h" #include "common/struct_strategy.h" +#include "common/patches/sod.h" class EQStreamIdentifier; -namespace UF -{ +namespace UF { - //these are the only public member of this namespace. - extern void Register(EQStreamIdentifier &into); - extern void Reload(); +extern void Register(EQStreamIdentifier& into); +extern void Reload(); - - - //you should not directly access anything below.. - //I just dont feel like making a seperate header for it. - - class Strategy : public StructStrategy { - public: - Strategy(); - - protected: - - virtual std::string Describe() const; - virtual const EQ::versions::ClientVersion ClientVersion() const; - - //magic macro to declare our opcode processors - #include "ss_declare.h" - #include "uf_ops.h" - }; - -}; /*UF*/ - -namespace Message { - -class UF : public SoD +class Strategy : public StructStrategy { public: - UF() = default; - ~UF() override = default; + Strategy(); + +protected: + virtual std::string Describe() const; + virtual const EQ::versions::ClientVersion ClientVersion() const; + + //magic macro to declare our opcode processors +#include "ss_declare.h" +#include "uf_ops.h" }; -} // namespace Message +class BuffComponent : public SoD::BuffComponent +{ +public: + BuffComponent(uint32_t maxLongBuffs, uint32_t maxShortBuffs) : SoD::BuffComponent(maxLongBuffs, maxShortBuffs) {} + BuffComponent() = delete; + ~BuffComponent() override = default; + + std::unique_ptr RefreshBuffs(EmuOpcode opcode, Mob* mob, bool remove, + bool buff_timers_suspended, const std::vector& slots) const override; +}; + +}; /*UF*/ diff --git a/common/patches/uf_ops.h b/common/patches/uf_ops.h index 4b0830e83..94ef66b25 100644 --- a/common/patches/uf_ops.h +++ b/common/patches/uf_ops.h @@ -25,8 +25,7 @@ E(OP_AugmentInfo) E(OP_Barter) E(OP_BazaarSearch) E(OP_BecomeTrader) -E(OP_Buff) -E(OP_BuffCreate) +E(OP_BuffDefinition) E(OP_CancelTrade) E(OP_ChannelMessage) E(OP_CharInventory) @@ -75,7 +74,6 @@ E(OP_MoveItem) E(OP_NewSpawn) E(OP_NewZone) E(OP_OnLevelMessage) -E(OP_PetBuffWindow) E(OP_PlayerProfile) E(OP_RaidJoin) E(OP_RaidUpdate) @@ -93,7 +91,6 @@ E(OP_SpawnAppearance) E(OP_SpawnDoor) E(OP_SpecialMesg) E(OP_Stun) -E(OP_TargetBuffs) E(OP_TaskDescription) E(OP_Track) E(OP_Trader) @@ -116,7 +113,7 @@ D(OP_AugmentInfo) D(OP_AugmentItem) D(OP_BazaarSearch) D(OP_BookButton) -D(OP_Buff) +D(OP_BuffDefinition) D(OP_BuffRemoveRequest) D(OP_CastSpell) D(OP_ChannelMessage) diff --git a/common/patches/uf_structs.h b/common/patches/uf_structs.h index 3720df32c..389bf7451 100644 --- a/common/patches/uf_structs.h +++ b/common/patches/uf_structs.h @@ -480,7 +480,7 @@ struct NewZone_Struct { */ struct MemorizeSpell_Struct { uint32 slot; // Spot in the spell book/memorized slot -uint32 spell_id; // Spell id (200 or c8 is minor healing, etc) +int32 spell_id; // Spell id (200 or c8 is minor healing, etc) uint32 scribing; // 1 if memorizing a spell, set to 0 if scribing to book, 2 if un-memming uint32 reduction; // lowers reuse }; @@ -517,7 +517,7 @@ struct ManaChange_Struct { /*00*/ uint32 new_mana; // New Mana AMount /*04*/ uint32 stamina; -/*08*/ uint32 spell_id; +/*08*/ int32 spell_id; /*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting? /*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like /*16*/ int32 slot; // -1 for normal usage slot for when we want silent interrupt? I think it does timer stuff or something. Linked Spell Reuse interrupt uses it @@ -535,14 +535,14 @@ struct BeginCast_Struct { // len = 8 /*004*/ uint16 caster_id; -/*006*/ uint16 spell_id; +/*006*/ int16 spell_id; /*016*/ uint32 cast_time; // in miliseconds }; struct CastSpell_Struct { uint32 slot; - uint32 spell_id; + int32 spell_id; uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast uint32 target_id; uint32 cs_unknown1; @@ -575,7 +575,7 @@ struct SpellBuff_Struct /*002*/ uint8 unknown002; //pretty sure padding now /*003*/ uint8 unknown003; // MQ2 used to call this "damage shield" -- don't see client referencing it, so maybe server side DS type tracking? /*004*/ float bard_modifier; -/*008*/ uint32 spellid; +/*008*/ int32 spellid; /*012*/ uint32 duration; /*016*/ uint32 num_hits; /*020*/ uint32 player_id; // caster ID, pretty sure just zone ID @@ -595,7 +595,7 @@ struct SpellBuffPacket_Struct { #if 0 struct BuffIconEntry_Struct { /*000*/ uint32 buff_slot; -/*004*/ uint32 spell_id; +/*004*/ int32 spell_id; /*008*/ uint32 tics_remaining; /*012*/ uint32 num_hits; // char name[0]; caster name is also here sometimes @@ -1306,7 +1306,7 @@ struct CombatDamage_Struct /* 00 */ uint16 target; /* 02 */ uint16 source; /* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells -/* 05 */ uint16 spellid; +/* 05 */ int16 spellid; /* 07 */ int32 damage; /* 11 */ float force; // cd cc cc 3d /* 15 */ float hit_heading; // see above notes in Action_Struct @@ -1342,7 +1342,7 @@ struct Death_Struct /*004*/ uint32 killer_id; /*008*/ uint32 corpseid; // was corpseid /*012*/ uint32 attack_skill; // was type -/*016*/ uint32 spell_id; +/*016*/ int32 spell_id; /*020*/ uint32 bindzoneid; //bindzoneid? /*024*/ uint32 damage; /*028*/ uint32 unknown028; @@ -2194,7 +2194,7 @@ struct GroupFollow_Struct { // Underfoot Follow Struct }; struct InspectBuffs_Struct { -/*000*/ uint32 spell_id[BUFF_COUNT]; +/*000*/ int32 spell_id[BUFF_COUNT]; /*120*/ int32 tics_remaining[BUFF_COUNT]; }; @@ -2610,7 +2610,7 @@ struct Resurrect_Struct { char your_name[64]; uint32 unknown88; char rezzer_name[64]; - uint32 spellid; + int32 spellid; char corpse_name[64]; uint32 action; /* 228 */ @@ -3896,7 +3896,7 @@ struct SendAA_Struct { /*0037*/ uint32 prereq_skill; //is < 0, abs() is category # /*0041*/ uint32 prereq_minpoints; //min points in the prereq /*0045*/ uint32 type; -/*0049*/ uint32 spellid; +/*0049*/ int32 spellid; /*0053*/ uint32 spell_type; /*0057*/ uint32 spell_refresh; /*0061*/ uint32 classes; diff --git a/common/repositories/base/base_blocked_spells_repository.h b/common/repositories/base/base_blocked_spells_repository.h index 6c9c81ba6..1ba7b1970 100644 --- a/common/repositories/base/base_blocked_spells_repository.h +++ b/common/repositories/base/base_blocked_spells_repository.h @@ -37,7 +37,7 @@ class BaseBlockedSpellsRepository { public: struct BlockedSpells { int32_t id; - uint32_t spellid; + int32_t spellid; int8_t type; int32_t zoneid; float x; diff --git a/common/repositories/base/base_bot_blocked_buffs_repository.h b/common/repositories/base/base_bot_blocked_buffs_repository.h index 2b6b67ccf..7af99fe69 100644 --- a/common/repositories/base/base_bot_blocked_buffs_repository.h +++ b/common/repositories/base/base_bot_blocked_buffs_repository.h @@ -37,7 +37,7 @@ class BaseBotBlockedBuffsRepository { public: struct BotBlockedBuffs { uint32_t bot_id; - uint32_t spell_id; + int32_t spell_id; uint8_t blocked; uint8_t blocked_pet; }; diff --git a/common/repositories/base/base_bot_buffs_repository.h b/common/repositories/base/base_bot_buffs_repository.h index 1bc2df94a..689184fd7 100644 --- a/common/repositories/base/base_bot_buffs_repository.h +++ b/common/repositories/base/base_bot_buffs_repository.h @@ -38,7 +38,7 @@ public: struct BotBuffs { uint32_t buffs_index; uint32_t bot_id; - uint32_t spell_id; + int32_t spell_id; uint8_t caster_level; uint32_t duration_formula; uint32_t tics_remaining; diff --git a/common/repositories/base/base_bot_pet_buffs_repository.h b/common/repositories/base/base_bot_pet_buffs_repository.h index a2e00e08f..fc391e27c 100644 --- a/common/repositories/base/base_bot_pet_buffs_repository.h +++ b/common/repositories/base/base_bot_pet_buffs_repository.h @@ -38,7 +38,7 @@ public: struct BotPetBuffs { uint32_t pet_buffs_index; uint32_t pets_index; - uint32_t spell_id; + int32_t spell_id; uint32_t caster_level; uint32_t duration; }; diff --git a/common/repositories/base/base_bot_pets_repository.h b/common/repositories/base/base_bot_pets_repository.h index d78202202..66f17a76a 100644 --- a/common/repositories/base/base_bot_pets_repository.h +++ b/common/repositories/base/base_bot_pets_repository.h @@ -37,7 +37,7 @@ class BaseBotPetsRepository { public: struct BotPets { uint32_t pets_index; - uint32_t spell_id; + int32_t spell_id; uint32_t bot_id; std::string name; int32_t mana; diff --git a/common/repositories/base/base_bot_spell_settings_repository.h b/common/repositories/base/base_bot_spell_settings_repository.h index a70bf41e0..7526c31b1 100644 --- a/common/repositories/base/base_bot_spell_settings_repository.h +++ b/common/repositories/base/base_bot_spell_settings_repository.h @@ -38,7 +38,7 @@ public: struct BotSpellSettings { uint32_t id; int32_t bot_id; - int16_t spell_id; + int32_t spell_id; int16_t priority; int16_t min_hp; int16_t max_hp; diff --git a/common/repositories/base/base_bot_spells_entries_repository.h b/common/repositories/base/base_bot_spells_entries_repository.h index 45ae3c796..02da648c6 100644 --- a/common/repositories/base/base_bot_spells_entries_repository.h +++ b/common/repositories/base/base_bot_spells_entries_repository.h @@ -38,7 +38,7 @@ public: struct BotSpellsEntries { uint32_t id; int32_t npc_spells_id; - uint16_t spell_id; + int32_t spell_id; uint32_t type; uint8_t minlevel; uint8_t maxlevel; diff --git a/common/repositories/base/base_bot_timers_repository.h b/common/repositories/base/base_bot_timers_repository.h index 44484da8d..5786f7890 100644 --- a/common/repositories/base/base_bot_timers_repository.h +++ b/common/repositories/base/base_bot_timers_repository.h @@ -42,7 +42,7 @@ public: uint32_t recast_time; uint8_t is_spell; uint8_t is_disc; - uint32_t spell_id; + int32_t spell_id; uint8_t is_item; uint32_t item_id; }; diff --git a/common/repositories/base/base_character_buffs_repository.h b/common/repositories/base/base_character_buffs_repository.h index c7a796411..d91c31f07 100644 --- a/common/repositories/base/base_character_buffs_repository.h +++ b/common/repositories/base/base_character_buffs_repository.h @@ -38,7 +38,7 @@ public: struct CharacterBuffs { uint32_t character_id; uint8_t slot_id; - uint16_t spell_id; + int32_t spell_id; uint8_t caster_level; std::string caster_name; int32_t ticsremaining; diff --git a/common/repositories/base/base_character_memmed_spells_repository.h b/common/repositories/base/base_character_memmed_spells_repository.h index ef99ba9ef..22d6caf8e 100644 --- a/common/repositories/base/base_character_memmed_spells_repository.h +++ b/common/repositories/base/base_character_memmed_spells_repository.h @@ -38,7 +38,7 @@ public: struct CharacterMemmedSpells { uint32_t id; uint16_t slot_id; - uint16_t spell_id; + int32_t spell_id; }; static std::string PrimaryKey() diff --git a/common/repositories/base/base_character_spells_repository.h b/common/repositories/base/base_character_spells_repository.h index c70c79a6a..f920e8d35 100644 --- a/common/repositories/base/base_character_spells_repository.h +++ b/common/repositories/base/base_character_spells_repository.h @@ -38,7 +38,7 @@ public: struct CharacterSpells { uint32_t id; uint16_t slot_id; - uint16_t spell_id; + int32_t spell_id; }; static std::string PrimaryKey() diff --git a/common/repositories/base/base_damageshieldtypes_repository.h b/common/repositories/base/base_damageshieldtypes_repository.h index 10f64037b..b3740efb1 100644 --- a/common/repositories/base/base_damageshieldtypes_repository.h +++ b/common/repositories/base/base_damageshieldtypes_repository.h @@ -36,7 +36,7 @@ class BaseDamageshieldtypesRepository { public: struct Damageshieldtypes { - uint32_t spellid; + int32_t spellid; uint8_t type; }; diff --git a/common/repositories/base/base_ldon_trap_templates_repository.h b/common/repositories/base/base_ldon_trap_templates_repository.h index d860e5eab..7c5a28786 100644 --- a/common/repositories/base/base_ldon_trap_templates_repository.h +++ b/common/repositories/base/base_ldon_trap_templates_repository.h @@ -38,7 +38,7 @@ public: struct LdonTrapTemplates { uint32_t id; uint8_t type; - uint16_t spell_id; + int32_t spell_id; uint16_t skill; uint8_t locked; }; diff --git a/common/repositories/base/base_merc_buffs_repository.h b/common/repositories/base/base_merc_buffs_repository.h index d7d786c4e..efd18859a 100644 --- a/common/repositories/base/base_merc_buffs_repository.h +++ b/common/repositories/base/base_merc_buffs_repository.h @@ -38,7 +38,7 @@ public: struct MercBuffs { uint32_t MercBuffId; uint32_t MercId; - uint32_t SpellId; + int32_t SpellId; uint32_t CasterLevel; uint32_t DurationFormula; int32_t TicsRemaining; diff --git a/common/repositories/base/base_merc_spell_list_entries_repository.h b/common/repositories/base/base_merc_spell_list_entries_repository.h index 2cd80dc49..86b02a510 100644 --- a/common/repositories/base/base_merc_spell_list_entries_repository.h +++ b/common/repositories/base/base_merc_spell_list_entries_repository.h @@ -39,7 +39,7 @@ public: struct MercSpellListEntries { uint32_t merc_spell_list_entry_id; uint32_t merc_spell_list_id; - uint32_t spell_id; + int32_t spell_id; uint32_t spell_type; uint8_t stance_id; uint8_t minlevel; diff --git a/common/repositories/base/base_npc_spells_entries_repository.h b/common/repositories/base/base_npc_spells_entries_repository.h index fcb8887fa..d5c1995f8 100644 --- a/common/repositories/base/base_npc_spells_entries_repository.h +++ b/common/repositories/base/base_npc_spells_entries_repository.h @@ -38,7 +38,7 @@ public: struct NpcSpellsEntries { uint32_t id; int32_t npc_spells_id; - uint16_t spellid; + int32_t spellid; uint32_t type; uint8_t minlevel; uint8_t maxlevel; diff --git a/common/repositories/base/base_spell_buckets_repository.h b/common/repositories/base/base_spell_buckets_repository.h index 5be55a327..d8e633447 100644 --- a/common/repositories/base/base_spell_buckets_repository.h +++ b/common/repositories/base/base_spell_buckets_repository.h @@ -36,7 +36,7 @@ class BaseSpellBucketsRepository { public: struct SpellBuckets { - uint32_t spell_id; + int32_t spell_id; std::string bucket_name; std::string bucket_value; uint8_t bucket_comparison; diff --git a/common/servertalk.h b/common/servertalk.h index da30dc4b1..d897dd388 100644 --- a/common/servertalk.h +++ b/common/servertalk.h @@ -1425,7 +1425,7 @@ struct CZSpell_Struct { uint8 update_type; // 0 - Character, 1 - Group, 2 - Raid, 3 - Guild, 4 - Expedition, 5 - Character Name uint8 update_subtype; // 0 - Cast Spell, 1 - Remove Spell int update_identifier; // Character ID, Group ID, Raid ID, Guild ID, or Expedition ID based on update type, 0 for Character Name - uint32 spell_id; + int32 spell_id; char client_name[64]; // Only used by Character Name Type, else empty }; @@ -1498,7 +1498,7 @@ struct WWSignal_Struct { struct WWSpell_Struct { uint8 update_type; // 0 - Cast Spell, 1 - Remove Spell - uint32 spell_id; + int32 spell_id; uint8 min_status; uint8 max_status; }; diff --git a/common/spdat.cpp b/common/spdat.cpp index 01bf12efe..3d1975d0f 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -84,7 +84,7 @@ /////////////////////////////////////////////////////////////////////////////// // spell property testing functions -bool IsTargetableAESpell(uint16 spell_id) +bool IsTargetableAESpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -100,12 +100,12 @@ bool IsTargetableAESpell(uint16 spell_id) ); } -bool IsSacrificeSpell(uint16 spell_id) +bool IsSacrificeSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Sacrifice); } -bool IsLifetapSpell(uint16 spell_id) +bool IsLifetapSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -124,22 +124,22 @@ bool IsLifetapSpell(uint16 spell_id) return false; } -bool IsMesmerizeSpell(uint16 spell_id) +bool IsMesmerizeSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Mez); } -bool SpellBreaksMez(uint16 spell_id) +bool SpellBreaksMez(int32 spell_id) { return (IsValidSpell(spell_id) && IsDetrimentalSpell(spell_id) && IsAnyDamageSpell(spell_id)); } -bool IsStunSpell(uint16 spell_id) +bool IsStunSpell(int32 spell_id) { return (IsValidSpell(spell_id) && IsEffectInSpell(spell_id, SpellEffect::Stun) || IsEffectInSpell(spell_id, SpellEffect::SpinTarget)); } -bool IsSummonSpell(uint16 spell_id) +bool IsSummonSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -161,7 +161,7 @@ bool IsSummonSpell(uint16 spell_id) return false; } -bool IsDamageSpell(uint16 spell_id) +bool IsDamageSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -186,7 +186,7 @@ bool IsDamageSpell(uint16 spell_id) return false; } -bool IsAnyDamageSpell(uint16 spell_id) +bool IsAnyDamageSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -218,7 +218,7 @@ bool IsAnyDamageSpell(uint16 spell_id) return false; } -bool IsDamageOverTimeSpell(uint16 spell_id) +bool IsDamageOverTimeSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -248,12 +248,12 @@ bool IsDamageOverTimeSpell(uint16 spell_id) return false; } -bool IsFearSpell(uint16 spell_id) +bool IsFearSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Fear); } -bool IsCureSpell(uint16 spell_id) +bool IsCureSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -284,7 +284,7 @@ bool IsCureSpell(uint16 spell_id) return false; } -bool IsSlowSpell(uint16 spell_id) +bool IsSlowSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -308,7 +308,7 @@ bool IsSlowSpell(uint16 spell_id) return false; } -bool IsHasteSpell(uint16 spell_id) +bool IsHasteSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -325,7 +325,7 @@ bool IsHasteSpell(uint16 spell_id) return false; } -bool IsHarmonySpell(uint16 spell_id) +bool IsHarmonySpell(int32 spell_id) { return ( IsEffectInSpell(spell_id, SpellEffect::ChangeFrenzyRad) || @@ -334,12 +334,12 @@ bool IsHarmonySpell(uint16 spell_id) ); } -bool IsPercentalHealSpell(uint16 spell_id) +bool IsPercentalHealSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::PercentalHeal); } -bool IsGroupOnlySpell(uint16 spell_id) +bool IsGroupOnlySpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -348,7 +348,7 @@ bool IsGroupOnlySpell(uint16 spell_id) return spells[spell_id].good_effect == BENEFICIAL_EFFECT_GROUP_ONLY; } -bool IsBeneficialSpell(uint16 spell_id) +bool IsBeneficialSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -425,12 +425,12 @@ bool IsBeneficialSpell(uint16 spell_id) ); } -bool IsDetrimentalSpell(uint16 spell_id) +bool IsDetrimentalSpell(int32 spell_id) { return !IsBeneficialSpell(spell_id); } -bool IsInvisibleSpell(uint16 spell_id) +bool IsInvisibleSpell(int32 spell_id) { return ( IsEffectInSpell(spell_id, SpellEffect::Invisibility) || @@ -442,37 +442,37 @@ bool IsInvisibleSpell(uint16 spell_id) ); } -bool IsInvulnerabilitySpell(uint16 spell_id) +bool IsInvulnerabilitySpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::DivineAura); } -bool IsCompleteHealDurationSpell(uint16 spell_id) +bool IsCompleteHealDurationSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::CompleteHeal); } -bool IsPoisonCounterSpell(uint16 spell_id) +bool IsPoisonCounterSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::PoisonCounter); } -bool IsDiseaseCounterSpell(uint16 spell_id) +bool IsDiseaseCounterSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::DiseaseCounter); } -bool IsSummonItemSpell(uint16 spell_id) +bool IsSummonItemSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::SummonItem); } -bool IsSummonSkeletonSpell(uint16 spell_id) +bool IsSummonSkeletonSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::NecPet); } -bool IsSummonPetSpell(uint16 spell_id) +bool IsSummonPetSpell(int32 spell_id) { return ( IsEffectInSpell(spell_id, SpellEffect::SummonPet) || @@ -482,7 +482,7 @@ bool IsSummonPetSpell(uint16 spell_id) ); } -bool IsPetSpell(uint16 spell_id) +bool IsPetSpell(int32 spell_id) { return ( IsSummonPetSpell(spell_id) || @@ -490,17 +490,17 @@ bool IsPetSpell(uint16 spell_id) ); } -bool IsSummonPCSpell(uint16 spell_id) +bool IsSummonPCSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::SummonPC); } -bool IsCharmSpell(uint16 spell_id) +bool IsCharmSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Charm); } -bool IsResurrectionSicknessSpell(uint16 spell_id) { +bool IsResurrectionSicknessSpell(int32 spell_id) { return ( spell_id == SPELL_RESURRECTION_SICKNESS || spell_id == SPELL_RESURRECTION_SICKNESS2 || @@ -510,47 +510,47 @@ bool IsResurrectionSicknessSpell(uint16 spell_id) { ); } -bool IsBlindSpell(uint16 spell_id) +bool IsBlindSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Blind); } -bool IsHealthSpell(uint16 spell_id) +bool IsHealthSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::CurrentHP); } -bool IsCastTimeReductionSpell(uint16 spell_id) +bool IsCastTimeReductionSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::IncreaseSpellHaste); } -bool IsIncreaseDurationSpell(uint16 spell_id) +bool IsIncreaseDurationSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::IncreaseSpellDuration); } -bool IsManaCostReductionSpell(uint16 spell_id) +bool IsManaCostReductionSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::ReduceManaCost); } -bool IsIncreaseRangeSpell(uint16 spell_id) +bool IsIncreaseRangeSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::IncreaseRange); } -bool IsImprovedHealingSpell(uint16 spell_id) +bool IsImprovedHealingSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::ImprovedHeal); } -bool IsImprovedDamageSpell(uint16 spell_id) +bool IsImprovedDamageSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::ImprovedDamage); } -bool IsAEDurationSpell(uint16 spell_id) +bool IsAEDurationSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -577,7 +577,7 @@ bool IsAEDurationSpell(uint16 spell_id) return false; } -bool IsPureNukeSpell(uint16 spell_id) +bool IsPureNukeSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -603,7 +603,7 @@ bool IsPureNukeSpell(uint16 spell_id) return false; } -bool IsAENukeSpell(uint16 spell_id) +bool IsAENukeSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -619,7 +619,7 @@ bool IsAENukeSpell(uint16 spell_id) return false; } -bool IsPBAENukeSpell(uint16 spell_id) +bool IsPBAENukeSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -637,7 +637,7 @@ bool IsPBAENukeSpell(uint16 spell_id) return false; } -bool IsAERainNukeSpell(uint16 spell_id) +bool IsAERainNukeSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -656,7 +656,7 @@ bool IsAERainNukeSpell(uint16 spell_id) return false; } -bool IsAnyNukeOrStunSpell(uint16 spell_id) { +bool IsAnyNukeOrStunSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -678,7 +678,7 @@ bool IsAnyNukeOrStunSpell(uint16 spell_id) { return false; } -bool IsAnyAESpell(uint16 spell_id) { +bool IsAnyAESpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -694,7 +694,7 @@ bool IsAnyAESpell(uint16 spell_id) { ); } -bool IsAESpell(uint16 spell_id) +bool IsAESpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -736,7 +736,7 @@ bool IsAESpell(uint16 spell_id) return false; } -bool IsPBAESpell(uint16 spell_id) +bool IsPBAESpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -754,7 +754,7 @@ bool IsPBAESpell(uint16 spell_id) return false; } -bool IsAERainSpell(uint16 spell_id) +bool IsAERainSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -772,7 +772,7 @@ bool IsAERainSpell(uint16 spell_id) return false; } -bool IsPartialResistableSpell(uint16 spell_id) +bool IsPartialResistableSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -809,7 +809,7 @@ bool IsPartialResistableSpell(uint16 spell_id) return false; } -bool IsResistableSpell(uint16 spell_id) +bool IsResistableSpell(int32 spell_id) { // for now only detrimental spells are resistable. later on i will // add specific exceptions for the beneficial spells that are resistable @@ -817,7 +817,7 @@ bool IsResistableSpell(uint16 spell_id) } // checks if this spell affects your group -bool IsGroupSpell(uint16 spell_id) +bool IsGroupSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -833,7 +833,7 @@ bool IsGroupSpell(uint16 spell_id) } // checks if this spell can be targeted -bool IsTGBCompatibleSpell(uint16 spell_id) +bool IsTGBCompatibleSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -851,7 +851,7 @@ bool IsTGBCompatibleSpell(uint16 spell_id) return false; } -bool IsBardSong(uint16 spell_id) +bool IsBardSong(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -869,7 +869,7 @@ bool IsBardSong(uint16 spell_id) return false; } -bool IsEffectInSpell(uint16 spell_id, int effect_id) +bool IsEffectInSpell(int32 spell_id, int effect_id) { if (!IsValidSpell(spell_id)) { return false; @@ -886,7 +886,7 @@ bool IsEffectInSpell(uint16 spell_id, int effect_id) return false; } -uint16 GetSpellTriggerSpellID(uint16 spell_id, int effect_id) +int32 GetSpellTriggerSpellID(int32 spell_id, int effect_id) { if (!IsValidSpell(spell_id)) { return false; @@ -917,7 +917,7 @@ uint16 GetSpellTriggerSpellID(uint16 spell_id, int effect_id) // arguments are spell id and the index of the effect to check. // this is used in loops that process effects inside a spell to skip // the blanks -bool IsBlankSpellEffect(uint16 spell_id, int effect_index) +bool IsBlankSpellEffect(int32 spell_id, int effect_index) { if (!IsValidSpell(spell_id)) { return false; @@ -948,7 +948,7 @@ bool IsBlankSpellEffect(uint16 spell_id, int effect_index) } // checks some things about a spell id, to see if we can proceed -bool IsValidSpell(uint32 spell_id) +bool IsValidSpell(int32 spell_id) { if ( SPDAT_RECORDS > 0 && @@ -963,7 +963,7 @@ bool IsValidSpell(uint32 spell_id) return false; } -bool IsHarmTouchSpell(uint16 spell_id) +bool IsHarmTouchSpell(int32 spell_id) { return spell_id == SPELL_HARM_TOUCH || spell_id == SPELL_HARM_TOUCH2 || @@ -971,7 +971,7 @@ bool IsHarmTouchSpell(uint16 spell_id) } // returns the lowest level of any caster which can use the spell -uint8 GetSpellMinimumLevel(uint16 spell_id) +uint8 GetSpellMinimumLevel(int32 spell_id) { if (!IsValidSpell(spell_id)) { return UINT8_MAX; @@ -993,7 +993,7 @@ uint8 GetSpellMinimumLevel(uint16 spell_id) return minimum_level; } -uint8 GetSpellLevel(uint16 spell_id, uint8 class_id) +uint8 GetSpellLevel(int32 spell_id, uint8 class_id) { if (!IsValidSpell(spell_id)) { return UINT8_MAX; @@ -1009,7 +1009,7 @@ uint8 GetSpellLevel(uint16 spell_id, uint8 class_id) // this will find the first occurrence of effect. this is handy // for spells like mez and charm, but if the effect appears more than once // in a spell this will just give back the first one. -int GetSpellEffectIndex(uint16 spell_id, int effect_id) +int GetSpellEffectIndex(int32 spell_id, int effect_id) { if (!IsValidSpell(spell_id)) { return -1; @@ -1026,7 +1026,7 @@ int GetSpellEffectIndex(uint16 spell_id, int effect_id) return -1; } -int CalculatePoisonCounters(uint16 spell_id) +int CalculatePoisonCounters(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -1048,7 +1048,7 @@ int CalculatePoisonCounters(uint16 spell_id) return counters; } -int CalculateDiseaseCounters(uint16 spell_id) +int CalculateDiseaseCounters(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -1070,7 +1070,7 @@ int CalculateDiseaseCounters(uint16 spell_id) return counters; } -int CalculateCurseCounters(uint16 spell_id) +int CalculateCurseCounters(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -1092,7 +1092,7 @@ int CalculateCurseCounters(uint16 spell_id) return counters; } -int CalculateCorruptionCounters(uint16 spell_id) +int CalculateCorruptionCounters(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -1114,7 +1114,7 @@ int CalculateCorruptionCounters(uint16 spell_id) return counters; } -int CalculateCounters(uint16 spell_id) +int CalculateCounters(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -1139,7 +1139,7 @@ int CalculateCounters(uint16 spell_id) return counter; } -bool IsDisciplineBuff(uint16 spell_id) +bool IsDisciplineBuff(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1157,7 +1157,7 @@ bool IsDisciplineBuff(uint16 spell_id) return false; } -bool IsDiscipline(uint16 spell_id) +bool IsDiscipline(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1178,7 +1178,7 @@ bool IsDiscipline(uint16 spell_id) return false; } -bool IsCombatSkill(uint16 spell_id) +bool IsCombatSkill(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1200,7 +1200,7 @@ bool IsCombatSkill(uint16 spell_id) return false; } -bool IsResurrectionEffects(uint16 spell_id) +bool IsResurrectionEffects(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1217,7 +1217,7 @@ bool IsResurrectionEffects(uint16 spell_id) return false; } -int8 GetSpellResurrectionSicknessCheck(uint16 spell_id_one, uint16 spell_id_two) +int8 GetSpellResurrectionSicknessCheck(int32 spell_id_one, int32 spell_id_two) { if ( !IsValidSpell(spell_id_one) || @@ -1249,17 +1249,17 @@ int8 GetSpellResurrectionSicknessCheck(uint16 spell_id_one, uint16 spell_id_two) return NO_RES_EFFECTS_BLOCK; } -bool IsRuneSpell(uint16 spell_id) +bool IsRuneSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Rune); } -bool IsMagicRuneSpell(uint16 spell_id) +bool IsMagicRuneSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::AbsorbMagicAtt); } -bool IsManaTapSpell(uint16 spell_id) +bool IsManaTapSpell(int32 spell_id) { return ( IsEffectInSpell(spell_id, SpellEffect::CurrentMana) && @@ -1267,18 +1267,18 @@ bool IsManaTapSpell(uint16 spell_id) ); } -bool IsAllianceSpell(uint16 spell_id) +bool IsAllianceSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::AddFaction); } -bool IsDeathSaveSpell(uint16 spell_id) +bool IsDeathSaveSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::DeathSave); } // Deathsave spells with base of 1 are partial -bool IsPartialDeathSaveSpell(uint16 spell_id) +bool IsPartialDeathSaveSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1299,7 +1299,7 @@ bool IsPartialDeathSaveSpell(uint16 spell_id) } // Deathsave spells with base 2 are "full" -bool IsFullDeathSaveSpell(uint16 spell_id) +bool IsFullDeathSaveSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1319,32 +1319,32 @@ bool IsFullDeathSaveSpell(uint16 spell_id) return false; } -bool IsShadowStepSpell(uint16 spell_id) +bool IsShadowStepSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::ShadowStep); } -bool IsSuccorSpell(uint16 spell_id) +bool IsSuccorSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Succor); } -bool IsTeleportSpell(uint16 spell_id) +bool IsTeleportSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Teleport); } -bool IsTranslocateSpell(uint16 spell_id) +bool IsTranslocateSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Translocate); } -bool IsGateSpell(uint16 spell_id) +bool IsGateSpell(int32 spell_id) { return IsEffectInSpell(spell_id, SpellEffect::Gate); } -bool IsIllusionSpell(uint16 spell_id) +bool IsIllusionSpell(int32 spell_id) { return ( IsEffectInSpell(spell_id, SpellEffect::Illusion) && @@ -1352,7 +1352,7 @@ bool IsIllusionSpell(uint16 spell_id) ); } -int GetSpellEffectDescriptionNumber(uint16 spell_id) +int GetSpellEffectDescriptionNumber(int32 spell_id) { if (IsValidSpell(spell_id)) { return spells[spell_id].effect_description_id; @@ -1361,7 +1361,7 @@ int GetSpellEffectDescriptionNumber(uint16 spell_id) return -1; } -DmgShieldType GetDamageShieldType(uint16 spell_id, int damage_shield_type) +DmgShieldType GetDamageShieldType(int32 spell_id, int damage_shield_type) { if (!IsValidSpell(spell_id)) { return DS_THORNS; @@ -1400,7 +1400,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int damage_shield_type) return DS_THORNS; } -bool IsLDoNObjectSpell(uint16 spell_id) +bool IsLDoNObjectSpell(int32 spell_id) { return ( IsEffectInSpell(spell_id, SpellEffect::AppraiseLDonChest) || @@ -1409,17 +1409,17 @@ bool IsLDoNObjectSpell(uint16 spell_id) ); } -int GetSpellResistType(uint16 spell_id) +int GetSpellResistType(int32 spell_id) { return spells[spell_id].resist_type; } -int GetSpellTargetType(uint16 spell_id) +int GetSpellTargetType(int32 spell_id) { return static_cast(spells[spell_id].target_type); } -bool IsHealOverTimeSpell(uint16 spell_id) +bool IsHealOverTimeSpell(int32 spell_id) { if ( ( @@ -1434,7 +1434,7 @@ bool IsHealOverTimeSpell(uint16 spell_id) return false; } -bool IsCompleteHealSpell(uint16 spell_id) +bool IsCompleteHealSpell(int32 spell_id) { if ( ( @@ -1452,7 +1452,7 @@ bool IsCompleteHealSpell(uint16 spell_id) } -bool IsFastHealSpell(uint16 spell_id) { +bool IsFastHealSpell(int32 spell_id) { spell_id = ( IsEffectInSpell(spell_id, SpellEffect::CurrentHP) ? spell_id : @@ -1491,7 +1491,7 @@ bool IsFastHealSpell(uint16 spell_id) { return false; } -bool IsVeryFastHealSpell(uint16 spell_id) +bool IsVeryFastHealSpell(int32 spell_id) { spell_id = ( IsEffectInSpell(spell_id, SpellEffect::CurrentHP) ? @@ -1531,7 +1531,7 @@ bool IsVeryFastHealSpell(uint16 spell_id) return false; } -bool IsRegularSingleTargetHealSpell(uint16 spell_id) +bool IsRegularSingleTargetHealSpell(int32 spell_id) { spell_id = ( IsEffectInSpell(spell_id, SpellEffect::CurrentHP) ? @@ -1577,7 +1577,7 @@ bool IsRegularSingleTargetHealSpell(uint16 spell_id) return false; } -bool IsRegularPetHealSpell(uint16 spell_id) +bool IsRegularPetHealSpell(int32 spell_id) { spell_id = ( IsEffectInSpell(spell_id, SpellEffect::CurrentHP) ? @@ -1623,7 +1623,7 @@ bool IsRegularPetHealSpell(uint16 spell_id) return false; } -bool IsRegularGroupHealSpell(uint16 spell_id) +bool IsRegularGroupHealSpell(int32 spell_id) { spell_id = ( IsEffectInSpell(spell_id, SpellEffect::CurrentHP) ? @@ -1663,7 +1663,7 @@ bool IsRegularGroupHealSpell(uint16 spell_id) return false; } -bool IsGroupCompleteHealSpell(uint16 spell_id) { +bool IsGroupCompleteHealSpell(int32 spell_id) { if ( IsValidSpell(spell_id) && ( @@ -1680,7 +1680,7 @@ bool IsGroupCompleteHealSpell(uint16 spell_id) { return false; } -bool IsGroupHealOverTimeSpell(uint16 spell_id) { +bool IsGroupHealOverTimeSpell(int32 spell_id) { if ( IsValidSpell(spell_id) && ( @@ -1695,7 +1695,7 @@ bool IsGroupHealOverTimeSpell(uint16 spell_id) { return false; } -bool IsAnyHealSpell(uint16 spell_id) { +bool IsAnyHealSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -1724,7 +1724,7 @@ bool IsAnyHealSpell(uint16 spell_id) { return false; } -bool IsAnyBuffSpell(uint16 spell_id) { +bool IsAnyBuffSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -1742,7 +1742,7 @@ bool IsAnyBuffSpell(uint16 spell_id) { return false; } -bool IsDispelSpell(uint16 spell_id) { +bool IsDispelSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -1758,7 +1758,7 @@ bool IsDispelSpell(uint16 spell_id) { return false; } -bool IsEscapeSpell(uint16 spell_id) { +bool IsEscapeSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -1775,7 +1775,7 @@ bool IsEscapeSpell(uint16 spell_id) { ); } -bool IsDebuffSpell(uint16 spell_id) +bool IsDebuffSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1797,7 +1797,7 @@ bool IsDebuffSpell(uint16 spell_id) ); } -bool IsHateReduxSpell(uint16 spell_id) { +bool IsHateReduxSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -1818,7 +1818,7 @@ bool IsHateReduxSpell(uint16 spell_id) { ); } -bool IsResistDebuffSpell(uint16 spell_id) +bool IsResistDebuffSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1838,7 +1838,7 @@ bool IsResistDebuffSpell(uint16 spell_id) ); } -bool IsSelfConversionSpell(uint16 spell_id) +bool IsSelfConversionSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1854,7 +1854,7 @@ bool IsSelfConversionSpell(uint16 spell_id) } // returns true for both detrimental and beneficial buffs -bool IsBuffSpell(uint16 spell_id) +bool IsBuffSpell(int32 spell_id) { return ( IsValidSpell(spell_id) && @@ -1865,7 +1865,7 @@ bool IsBuffSpell(uint16 spell_id) ); } -bool IsPersistDeathSpell(uint16 spell_id) +bool IsPersistDeathSpell(int32 spell_id) { if ( IsValidSpell(spell_id) && @@ -1877,7 +1877,7 @@ bool IsPersistDeathSpell(uint16 spell_id) return false; } -bool IsSuspendableSpell(uint16 spell_id) +bool IsSuspendableSpell(int32 spell_id) { if ( IsValidSpell(spell_id) && @@ -1889,7 +1889,7 @@ bool IsSuspendableSpell(uint16 spell_id) return false; } -bool IsCastOnFadeDurationSpell(uint16 spell_id) +bool IsCastOnFadeDurationSpell(int32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) { if ( @@ -1904,7 +1904,7 @@ bool IsCastOnFadeDurationSpell(uint16 spell_id) return false; } -bool IsDistanceModifierSpell(uint16 spell_id) +bool IsDistanceModifierSpell(int32 spell_id) { if ( IsValidSpell(spell_id) && @@ -1920,7 +1920,7 @@ bool IsDistanceModifierSpell(uint16 spell_id) return false; } -int GetSpellPartialMeleeRuneReduction(uint16 spell_id) +int GetSpellPartialMeleeRuneReduction(int32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) { if (spells[spell_id].effect_id[i] == SpellEffect::MitigateMeleeDamage) { @@ -1931,7 +1931,7 @@ int GetSpellPartialMeleeRuneReduction(uint16 spell_id) return 0; } -int GetSpellPartialMagicRuneReduction(uint16 spell_id) +int GetSpellPartialMagicRuneReduction(int32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) { if (spells[spell_id].effect_id[i] == SpellEffect::MitigateSpellDamage) { @@ -1942,7 +1942,7 @@ int GetSpellPartialMagicRuneReduction(uint16 spell_id) return 0; } -int GetSpellPartialMeleeRuneAmount(uint16 spell_id) +int GetSpellPartialMeleeRuneAmount(int32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) { if (spells[spell_id].effect_id[i] == SpellEffect::MitigateMeleeDamage) { @@ -1953,7 +1953,7 @@ int GetSpellPartialMeleeRuneAmount(uint16 spell_id) return 0; } -int GetSpellPartialMagicRuneAmount(uint16 spell_id) +int GetSpellPartialMagicRuneAmount(int32 spell_id) { for (int i = 0; i < EFFECT_COUNT; ++i) { if (spells[spell_id].effect_id[i] == SpellEffect::MitigateSpellDamage) { @@ -1964,7 +1964,7 @@ int GetSpellPartialMagicRuneAmount(uint16 spell_id) return 0; } -bool IsRestAllowedSpell(uint16 spell_id) +bool IsRestAllowedSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1973,7 +1973,7 @@ bool IsRestAllowedSpell(uint16 spell_id) return spells[spell_id].allow_rest; } -bool IsNoDetrimentalSpellAggroSpell(uint16 spell_id) +bool IsNoDetrimentalSpellAggroSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1982,7 +1982,7 @@ bool IsNoDetrimentalSpellAggroSpell(uint16 spell_id) return spells[spell_id].no_detrimental_spell_aggro; } -bool IsStackableDOT(uint16 spell_id) +bool IsStackableDOT(int32 spell_id) { // rules according to client if (!IsValidSpell(spell_id)) { @@ -2014,7 +2014,7 @@ bool IsBardOnlyStackEffect(int effect_id) } } -bool IsCastWhileInvisibleSpell(uint16 spell_id) +bool IsCastWhileInvisibleSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -2170,7 +2170,7 @@ bool IsFocusLimit(int effect_id) } } -int GetSpellNimbusEffect(uint16 spell_id) +int GetSpellNimbusEffect(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -2179,7 +2179,7 @@ int GetSpellNimbusEffect(uint16 spell_id) return spells[spell_id].nimbus_effect; } -int GetSpellFuriousBash(uint16 spell_id) +int GetSpellFuriousBash(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -2206,7 +2206,7 @@ int GetSpellFuriousBash(uint16 spell_id) return 0; } -bool IsShortDurationBuff(uint16 spell_id) +bool IsShortDurationBuff(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -2215,7 +2215,7 @@ bool IsShortDurationBuff(uint16 spell_id) return spells[spell_id].short_buff_box != 0; } -bool IsSpellUsableInThisZoneType(uint16 spell_id, uint8 zone_type) +bool IsSpellUsableInThisZoneType(int32 spell_id, uint8 zone_type) { if (!IsValidSpell(spell_id)) { return false; @@ -2233,7 +2233,7 @@ bool IsSpellUsableInThisZoneType(uint16 spell_id, uint8 zone_type) return false; } -const char* GetSpellName(uint16 spell_id) +const char* GetSpellName(int32 spell_id) { if (!IsValidSpell(spell_id)) { return "INVALID SPELL ID IN GETSPELLNAME"; @@ -2242,7 +2242,7 @@ const char* GetSpellName(uint16 spell_id) return spells[spell_id].name; } -bool IsTargetRequiredForSpell(uint16 spell_id) +bool IsTargetRequiredForSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -2263,7 +2263,7 @@ bool IsTargetRequiredForSpell(uint16 spell_id) return true; } -bool IsInstrumentModifierAppliedToSpellEffect(uint16 spell_id, int effect_id) +bool IsInstrumentModifierAppliedToSpellEffect(int32 spell_id, int effect_id) { if (!IsValidSpell(spell_id)) { return false; @@ -2366,7 +2366,7 @@ bool IsInstrumentModifierAppliedToSpellEffect(uint16 spell_id, int effect_id) //Allowing anything not confirmed to be restricted / allowed to receive modifiers, as to not inhbit anyone making custom bard songs. } -bool IsPulsingBardSong(uint16 spell_id) +bool IsPulsingBardSong(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -2385,7 +2385,7 @@ bool IsPulsingBardSong(uint16 spell_id) return true; } -int GetSpellStatValue(uint16 spell_id, const char* stat_identifier, uint8 slot) +int GetSpellStatValue(int32 spell_id, const char* stat_identifier, uint8 slot) { if (!IsValidSpell(spell_id)) { return 0; @@ -2499,7 +2499,7 @@ int GetSpellStatValue(uint16 spell_id, const char* stat_identifier, uint8 slot) return 0; } -bool IsVirusSpell(uint16 spell_id) +bool IsVirusSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -2512,7 +2512,7 @@ bool IsVirusSpell(uint16 spell_id) ); } -int GetSpellViralMinimumSpreadTime(uint16 spell_id) +int GetSpellViralMinimumSpreadTime(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -2521,7 +2521,7 @@ int GetSpellViralMinimumSpreadTime(uint16 spell_id) return spells[spell_id].viral_targets; } -int GetSpellViralMaximumSpreadTime(uint16 spell_id) +int GetSpellViralMaximumSpreadTime(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -2530,7 +2530,7 @@ int GetSpellViralMaximumSpreadTime(uint16 spell_id) return spells[spell_id].viral_timer; } -int GetSpellViralSpreadRange(uint16 spell_id) +int GetSpellViralSpreadRange(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -2539,7 +2539,7 @@ int GetSpellViralSpreadRange(uint16 spell_id) return spells[spell_id].viral_range; } -int GetSpellProcLimitTimer(uint16 spell_id, int proc_type) +int GetSpellProcLimitTimer(int32 spell_id, int proc_type) { if (!IsValidSpell(spell_id)) { return 0; @@ -2582,7 +2582,7 @@ int GetSpellProcLimitTimer(uint16 spell_id, int proc_type) return 0; } -bool IsCastRestrictedSpell(uint16 spell_id) +bool IsCastRestrictedSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -2655,7 +2655,7 @@ bool IsCastRestrictedSpell(uint16 spell_id) } } -bool IsCastNotStandingSpell(uint16 spell_id) { +bool IsCastNotStandingSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -2668,7 +2668,7 @@ bool IsCastNotStandingSpell(uint16 spell_id) { return spells[spell_id].cast_not_standing; } -bool IsAegolismSpell(uint16 spell_id) { +bool IsAegolismSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return 0; @@ -2708,7 +2708,7 @@ bool IsAegolismSpell(uint16 spell_id) { } -bool AegolismStackingIsSymbolSpell(uint16 spell_id) { +bool AegolismStackingIsSymbolSpell(int32 spell_id) { /* This is hardcoded to be specific to the type of HP buffs that are removed if a mob has an Aegolism buff. @@ -2744,7 +2744,7 @@ bool AegolismStackingIsSymbolSpell(uint16 spell_id) { return 0; } -bool AegolismStackingIsArmorClassSpell(uint16 spell_id) { +bool AegolismStackingIsArmorClassSpell(int32 spell_id) { /* This is hardcoded to be specific to the type of AC buffs that are removed if a mob has an Aegolism buff. */ @@ -2773,7 +2773,7 @@ bool AegolismStackingIsArmorClassSpell(uint16 spell_id) { return 0; } -int8 SpellEffectsCount(uint16 spell_id) { +int8 SpellEffectsCount(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -2789,7 +2789,7 @@ int8 SpellEffectsCount(uint16 spell_id) { return x; } -bool IsLichSpell(uint16 spell_id) +bool IsLichSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -2805,7 +2805,7 @@ bool IsLichSpell(uint16 spell_id) ); } -bool IsInstantHealSpell(uint32 spell_id) { +bool IsInstantHealSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -2819,7 +2819,7 @@ bool IsInstantHealSpell(uint32 spell_id) { ); } -bool IsResurrectSpell(uint16 spell_id) +bool IsResurrectSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -2828,7 +2828,7 @@ bool IsResurrectSpell(uint16 spell_id) return IsEffectInSpell(spell_id, SpellEffect::Revive); } -bool IsResistanceBuffSpell(uint16 spell_id) { +bool IsResistanceBuffSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -2856,7 +2856,7 @@ bool IsResistanceBuffSpell(uint16 spell_id) { return false; } -bool IsResistanceOnlySpell(uint16 spell_id) { +bool IsResistanceOnlySpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -2886,7 +2886,7 @@ bool IsResistanceOnlySpell(uint16 spell_id) { return true; } -bool IsDamageShieldOnlySpell(uint16 spell_id) { +bool IsDamageShieldOnlySpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -2908,7 +2908,7 @@ bool IsDamageShieldOnlySpell(uint16 spell_id) { return true; } -bool IsDamageShieldAndResistSpell(uint16 spell_id) { +bool IsDamageShieldAndResistSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -2937,7 +2937,7 @@ bool IsDamageShieldAndResistSpell(uint16 spell_id) { return true; } -bool IsHateSpell(uint16 spell_id) { +bool IsHateSpell(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } diff --git a/common/spdat.h b/common/spdat.h index 7488a0f58..c294176e0 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -21,9 +21,8 @@ #include "common/item_data.h" #include "common/skills.h" -#define SPELL_UNKNOWN 0xFFFF -#define POISON_PROC 0xFFFE -#define SPELLBOOK_UNKNOWN 0xFFFFFFFF //player profile spells are 32 bit +#define SPELL_UNKNOWN -1 +#define POISON_PROC -2 //some spell IDs which will prolly change, but are needed #define SPELL_COMPLETE_HEAL 13 @@ -914,10 +913,10 @@ bool BotSpellTypeRequiresTarget(uint16 spell_type); bool BotSpellTypeRequiresAEChecks(uint16 spell_type); bool IsCommandedBotSpellType(uint16 spell_type); bool IsPullingBotSpellType(uint16 spell_type); -uint16 GetCorrectBotSpellType(uint16 spell_type, uint16 spell_id); +uint16 GetCorrectBotSpellType(uint16 spell_type, int32 spell_id); uint16 GetPetBotSpellType(uint16 spell_type); bool IsBotBuffSpellType(uint16 spell_type); -bool BotRequiresLoSToCast(uint16 spell_type, uint16 spell_id); +bool BotRequiresLoSToCast(uint16 spell_type, int32 spell_id); // These should not be used to determine spell category.. // They are a graphical affects (effects?) index only @@ -1762,157 +1761,157 @@ struct SPDat_Spell_Struct extern const SPDat_Spell_Struct* spells; extern int32 SPDAT_RECORDS; -bool IsTargetableAESpell(uint16 spell_id); -bool IsSacrificeSpell(uint16 spell_id); -bool IsLifetapSpell(uint16 spell_id); -bool IsMesmerizeSpell(uint16 spell_id); -bool SpellBreaksMez(uint16 spell_id); -bool IsStunSpell(uint16 spell_id); -bool IsSlowSpell(uint16 spell_id); -bool IsHasteSpell(uint16 spell_id); -bool IsHarmonySpell(uint16 spell_id); -bool IsPercentalHealSpell(uint16 spell_id); -bool IsGroupOnlySpell(uint16 spell_id); -bool IsBeneficialSpell(uint16 spell_id); -bool IsDetrimentalSpell(uint16 spell_id); -bool IsInvisibleSpell(uint16 spell_id); -bool IsInvulnerabilitySpell(uint16 spell_id); -bool IsCompleteHealDurationSpell(uint16 spell_id); -bool IsPoisonCounterSpell(uint16 spell_id); -bool IsDiseaseCounterSpell(uint16 spell_id); -bool IsSummonItemSpell(uint16 spell_id); -bool IsSummonSkeletonSpell(uint16 spell_id); -bool IsSummonPetSpell(uint16 spell_id); -bool IsSummonPCSpell(uint16 spell_id); -bool IsPetSpell(uint16 spell_id); -bool IsCharmSpell(uint16 spell_id); -bool IsResurrectionSicknessSpell(uint16 spell_id); -bool IsBlindSpell(uint16 spell_id); -bool IsHealthSpell(uint16 spell_id); -bool IsCastTimeReductionSpell(uint16 spell_id); -bool IsIncreaseDurationSpell(uint16 spell_id); -bool IsManaCostReductionSpell(uint16 spell_id); -bool IsIncreaseRangeSpell(uint16 spell_id); -bool IsImprovedHealingSpell(uint16 spell_id); -bool IsImprovedDamageSpell(uint16 spell_id); -bool IsAEDurationSpell(uint16 spell_id); -bool IsPureNukeSpell(uint16 spell_id); -bool IsAENukeSpell(uint16 spell_id); -bool IsPBAENukeSpell(uint16 spell_id); -bool IsAERainNukeSpell(uint16 spell_id); -bool IsAnyNukeOrStunSpell(uint16 spell_id); -bool IsAnyAESpell(uint16 spell_id); -bool IsAESpell(uint16 spell_id); -bool IsPBAESpell(uint16 spell_id); -bool IsAERainSpell(uint16 spell_id); -bool IsPartialResistableSpell(uint16 spell_id); -bool IsResistableSpell(uint16 spell_id); -bool IsGroupSpell(uint16 spell_id); -bool IsTGBCompatibleSpell(uint16 spell_id); -bool IsBardSong(uint16 spell_id); -bool IsEffectInSpell(uint16 spell_id, int effect_id); -uint16 GetSpellTriggerSpellID(uint16 spell_id, int effect_id); -bool IsBlankSpellEffect(uint16 spell_id, int effect_index); -bool IsValidSpell(uint32 spell_id); -bool IsSummonSpell(uint16 spell_id); -bool IsDamageSpell(uint16 spell_id); -bool IsAnyDamageSpell(uint16 spell_id); -bool IsDamageOverTimeSpell(uint16 spell_i); -bool IsFearSpell(uint16 spell_id); -bool IsCureSpell(uint16 spell_id); -bool IsHarmTouchSpell(uint16 spell_id); -int GetSpellEffectIndex(uint16 spell_id, int effect_id); -uint8 GetSpellMinimumLevel(uint16 spell_id); -uint8 GetSpellLevel(uint16 spell_id, uint8 class_id); +bool IsTargetableAESpell(int32 spell_id); +bool IsSacrificeSpell(int32 spell_id); +bool IsLifetapSpell(int32 spell_id); +bool IsMesmerizeSpell(int32 spell_id); +bool SpellBreaksMez(int32 spell_id); +bool IsStunSpell(int32 spell_id); +bool IsSlowSpell(int32 spell_id); +bool IsHasteSpell(int32 spell_id); +bool IsHarmonySpell(int32 spell_id); +bool IsPercentalHealSpell(int32 spell_id); +bool IsGroupOnlySpell(int32 spell_id); +bool IsBeneficialSpell(int32 spell_id); +bool IsDetrimentalSpell(int32 spell_id); +bool IsInvisibleSpell(int32 spell_id); +bool IsInvulnerabilitySpell(int32 spell_id); +bool IsCompleteHealDurationSpell(int32 spell_id); +bool IsPoisonCounterSpell(int32 spell_id); +bool IsDiseaseCounterSpell(int32 spell_id); +bool IsSummonItemSpell(int32 spell_id); +bool IsSummonSkeletonSpell(int32 spell_id); +bool IsSummonPetSpell(int32 spell_id); +bool IsSummonPCSpell(int32 spell_id); +bool IsPetSpell(int32 spell_id); +bool IsCharmSpell(int32 spell_id); +bool IsResurrectionSicknessSpell(int32 spell_id); +bool IsBlindSpell(int32 spell_id); +bool IsHealthSpell(int32 spell_id); +bool IsCastTimeReductionSpell(int32 spell_id); +bool IsIncreaseDurationSpell(int32 spell_id); +bool IsManaCostReductionSpell(int32 spell_id); +bool IsIncreaseRangeSpell(int32 spell_id); +bool IsImprovedHealingSpell(int32 spell_id); +bool IsImprovedDamageSpell(int32 spell_id); +bool IsAEDurationSpell(int32 spell_id); +bool IsPureNukeSpell(int32 spell_id); +bool IsAENukeSpell(int32 spell_id); +bool IsPBAENukeSpell(int32 spell_id); +bool IsAERainNukeSpell(int32 spell_id); +bool IsAnyNukeOrStunSpell(int32 spell_id); +bool IsAnyAESpell(int32 spell_id); +bool IsAESpell(int32 spell_id); +bool IsPBAESpell(int32 spell_id); +bool IsAERainSpell(int32 spell_id); +bool IsPartialResistableSpell(int32 spell_id); +bool IsResistableSpell(int32 spell_id); +bool IsGroupSpell(int32 spell_id); +bool IsTGBCompatibleSpell(int32 spell_id); +bool IsBardSong(int32 spell_id); +bool IsEffectInSpell(int32 spell_id, int effect_id); +int32 GetSpellTriggerSpellID(int32 spell_id, int effect_id); +bool IsBlankSpellEffect(int32 spell_id, int effect_index); +bool IsValidSpell(int32 spell_id); +bool IsSummonSpell(int32 spell_id); +bool IsDamageSpell(int32 spell_id); +bool IsAnyDamageSpell(int32 spell_id); +bool IsDamageOverTimeSpell(int32 spell_id); +bool IsFearSpell(int32 spell_id); +bool IsCureSpell(int32 spell_id); +bool IsHarmTouchSpell(int32 spell_id); +int GetSpellEffectIndex(int32 spell_id, int effect_id); +uint8 GetSpellMinimumLevel(int32 spell_id); +uint8 GetSpellLevel(int32 spell_id, uint8 class_id); int CalcBuffDuration_formula(int level, int formula, int duration); -int32 CalculatePoisonCounters(uint16 spell_id); -int32 CalculateDiseaseCounters(uint16 spell_id); -int32 CalculateCurseCounters(uint16 spell_id); -int32 CalculateCorruptionCounters(uint16 spell_id); -int32 CalculateCounters(uint16 spell_id); -bool IsDisciplineBuff(uint16 spell_id); -bool IsDiscipline(uint16 spell_id); -bool IsCombatSkill(uint16 spell_id); -bool IsResurrectionEffects(uint16 spell_id); -int8 GetSpellResurrectionSicknessCheck(uint16 spell_id_one, uint16 spell_id_two); -bool IsRuneSpell(uint16 spell_id); -bool IsMagicRuneSpell(uint16 spell_id); -bool IsManaTapSpell(uint16 spell_id); -bool IsAllianceSpell(uint16 spell_id); -bool IsDeathSaveSpell(uint16 spell_id); -bool IsFullDeathSaveSpell(uint16 spell_id); -bool IsPartialDeathSaveSpell(uint16 spell_id); -bool IsShadowStepSpell(uint16 spell_id); -bool IsSuccorSpell(uint16 spell_id); -bool IsTeleportSpell(uint16 spell_id); -bool IsTranslocateSpell(uint16 spell_id); -bool IsGateSpell(uint16 spell_id); -bool IsIllusionSpell(uint16 spell_id); -bool IsLDoNObjectSpell(uint16 spell_id); -int GetSpellResistType(uint16 spell_id); -int GetSpellTargetType(uint16 spell_id); -bool IsHealOverTimeSpell(uint16 spell_id); -bool IsCompleteHealSpell(uint16 spell_id); -bool IsFastHealSpell(uint16 spell_id); -bool IsVeryFastHealSpell(uint16 spell_id); -bool IsRegularSingleTargetHealSpell(uint16 spell_id); -bool IsRegularPetHealSpell(uint16 spell_id); -bool IsRegularGroupHealSpell(uint16 spell_id); -bool IsGroupCompleteHealSpell(uint16 spell_id); -bool IsGroupHealOverTimeSpell(uint16 spell_id); -bool IsAnyHealSpell(uint16 spell_id); -bool IsAnyBuffSpell(uint16 spell_id); -bool IsDispelSpell(uint16 spell_id); -bool IsEscapeSpell(uint16 spell_id); -bool IsDebuffSpell(uint16 spell_id); -bool IsHateReduxSpell(uint16 spell_id); -bool IsResistDebuffSpell(uint16 spell_id); -bool IsSelfConversionSpell(uint16 spell_id); -bool IsBuffSpell(uint16 spell_id); -bool IsPersistDeathSpell(uint16 spell_id); -bool IsSuspendableSpell(uint16 spell_id); -bool IsCastOnFadeDurationSpell(uint16 spell_id); -bool IsDistanceModifierSpell(uint16 spell_id); -int GetSpellPartialMeleeRuneReduction(uint16 spell_id); -int GetSpellPartialMagicRuneReduction(uint16 spell_id); -int GetSpellPartialMeleeRuneAmount(uint16 spell_id); -int GetSpellPartialMagicRuneAmount(uint16 spell_id); -bool IsNoDetrimentalSpellAggroSpell(uint16 spell_id); -bool IsStackableDOT(uint16 spell_id); +int32 CalculatePoisonCounters(int32 spell_id); +int32 CalculateDiseaseCounters(int32 spell_id); +int32 CalculateCurseCounters(int32 spell_id); +int32 CalculateCorruptionCounters(int32 spell_id); +int32 CalculateCounters(int32 spell_id); +bool IsDisciplineBuff(int32 spell_id); +bool IsDiscipline(int32 spell_id); +bool IsCombatSkill(int32 spell_id); +bool IsResurrectionEffects(int32 spell_id); +int8 GetSpellResurrectionSicknessCheck(int32 spell_id_one, int32 spell_id_two); +bool IsRuneSpell(int32 spell_id); +bool IsMagicRuneSpell(int32 spell_id); +bool IsManaTapSpell(int32 spell_id); +bool IsAllianceSpell(int32 spell_id); +bool IsDeathSaveSpell(int32 spell_id); +bool IsFullDeathSaveSpell(int32 spell_id); +bool IsPartialDeathSaveSpell(int32 spell_id); +bool IsShadowStepSpell(int32 spell_id); +bool IsSuccorSpell(int32 spell_id); +bool IsTeleportSpell(int32 spell_id); +bool IsTranslocateSpell(int32 spell_id); +bool IsGateSpell(int32 spell_id); +bool IsIllusionSpell(int32 spell_id); +bool IsLDoNObjectSpell(int32 spell_id); +int GetSpellResistType(int32 spell_id); +int GetSpellTargetType(int32 spell_id); +bool IsHealOverTimeSpell(int32 spell_id); +bool IsCompleteHealSpell(int32 spell_id); +bool IsFastHealSpell(int32 spell_id); +bool IsVeryFastHealSpell(int32 spell_id); +bool IsRegularSingleTargetHealSpell(int32 spell_id); +bool IsRegularPetHealSpell(int32 spell_id); +bool IsRegularGroupHealSpell(int32 spell_id); +bool IsGroupCompleteHealSpell(int32 spell_id); +bool IsGroupHealOverTimeSpell(int32 spell_id); +bool IsAnyHealSpell(int32 spell_id); +bool IsAnyBuffSpell(int32 spell_id); +bool IsDispelSpell(int32 spell_id); +bool IsEscapeSpell(int32 spell_id); +bool IsDebuffSpell(int32 spell_id); +bool IsHateReduxSpell(int32 spell_id); +bool IsResistDebuffSpell(int32 spell_id); +bool IsSelfConversionSpell(int32 spell_id); +bool IsBuffSpell(int32 spell_id); +bool IsPersistDeathSpell(int32 spell_id); +bool IsSuspendableSpell(int32 spell_id); +bool IsCastOnFadeDurationSpell(int32 spell_id); +bool IsDistanceModifierSpell(int32 spell_id); +int GetSpellPartialMeleeRuneReduction(int32 spell_id); +int GetSpellPartialMagicRuneReduction(int32 spell_id); +int GetSpellPartialMeleeRuneAmount(int32 spell_id); +int GetSpellPartialMagicRuneAmount(int32 spell_id); +bool IsNoDetrimentalSpellAggroSpell(int32 spell_id); +bool IsStackableDOT(int32 spell_id); bool IsBardOnlyStackEffect(int effect_id); -bool IsCastWhileInvisibleSpell(uint16 spell_id); +bool IsCastWhileInvisibleSpell(int32 spell_id); bool IsEffectIgnoredInStacking(int effect_id); bool IsFocusLimit(int effect_id); -bool IsTargetRequiredForSpell(uint16 spell_id); -bool IsVirusSpell(uint16 spell_id); -int GetSpellViralMinimumSpreadTime(uint16 spell_id); -int GetSpellViralMaximumSpreadTime(uint16 spell_id); -int GetSpellViralSpreadRange(uint16 spell_id); -bool IsInstrumentModifierAppliedToSpellEffect(uint16 spell_id, int effect_id); -bool IsPulsingBardSong(uint16 spell_id); -int GetSpellProcLimitTimer(uint16 spell_id, int proc_type); -bool IsCastNotStandingSpell(uint16 spell_id); -int GetSpellEffectDescriptionNumber(uint16 spell_id); -DmgShieldType GetDamageShieldType(uint16 spell_id, int damage_shield_type = 0); -bool IsRestAllowedSpell(uint16 spell_id); -int GetSpellNimbusEffect(uint16 spell_id); -int GetSpellFuriousBash(uint16 spell_id); -bool IsShortDurationBuff(uint16 spell_id); -bool IsSpellUsableInThisZoneType(uint16 spell_id, uint8 zone_type); -const char *GetSpellName(uint16 spell_id); -int GetSpellStatValue(uint16 spell_id, const char* stat_identifier, uint8 slot = 0); -bool IsCastRestrictedSpell(uint16 spell_id); -bool IsAegolismSpell(uint16 spell_id); -bool AegolismStackingIsSymbolSpell(uint16 spell_id); -bool AegolismStackingIsArmorClassSpell(uint16 spell_id); -int8 SpellEffectsCount(uint16 spell_id); -bool IsLichSpell(uint16 spell_id); -bool IsInstantHealSpell(uint32 spell_id); -bool IsResurrectSpell(uint16 spell_id); +bool IsTargetRequiredForSpell(int32 spell_id); +bool IsVirusSpell(int32 spell_id); +int GetSpellViralMinimumSpreadTime(int32 spell_id); +int GetSpellViralMaximumSpreadTime(int32 spell_id); +int GetSpellViralSpreadRange(int32 spell_id); +bool IsInstrumentModifierAppliedToSpellEffect(int32 spell_id, int effect_id); +bool IsPulsingBardSong(int32 spell_id); +int GetSpellProcLimitTimer(int32 spell_id, int proc_type); +bool IsCastNotStandingSpell(int32 spell_id); +int GetSpellEffectDescriptionNumber(int32 spell_id); +DmgShieldType GetDamageShieldType(int32 spell_id, int damage_shield_type = 0); +bool IsRestAllowedSpell(int32 spell_id); +int GetSpellNimbusEffect(int32 spell_id); +int GetSpellFuriousBash(int32 spell_id); +bool IsShortDurationBuff(int32 spell_id); +bool IsSpellUsableInThisZoneType(int32 spell_id, uint8 zone_type); +const char *GetSpellName(int32 spell_id); +int GetSpellStatValue(int32 spell_id, const char* stat_identifier, uint8 slot = 0); +bool IsCastRestrictedSpell(int32 spell_id); +bool IsAegolismSpell(int32 spell_id); +bool AegolismStackingIsSymbolSpell(int32 spell_id); +bool AegolismStackingIsArmorClassSpell(int32 spell_id); +int8 SpellEffectsCount(int32 spell_id); +bool IsLichSpell(int32 spell_id); +bool IsInstantHealSpell(int32 spell_id); +bool IsResurrectSpell(int32 spell_id); bool RequiresStackCheck(uint16 spell_type); -bool IsResistanceBuffSpell(uint16 spell_id); -bool IsResistanceOnlySpell(uint16 spell_id); -bool IsDamageShieldOnlySpell(uint16 spell_id); -bool IsDamageShieldAndResistSpell(uint16 spell_id); -bool IsHateSpell(uint16 spell_id); +bool IsResistanceBuffSpell(int32 spell_id); +bool IsResistanceOnlySpell(int32 spell_id); +bool IsDamageShieldOnlySpell(int32 spell_id); +bool IsDamageShieldAndResistSpell(int32 spell_id); +bool IsHateSpell(int32 spell_id); bool IsDisciplineTome(const EQ::ItemData* item); diff --git a/common/spdat_bot.cpp b/common/spdat_bot.cpp index 4601daf19..bbfe65ed5 100644 --- a/common/spdat_bot.cpp +++ b/common/spdat_bot.cpp @@ -432,7 +432,7 @@ bool IsPullingBotSpellType(uint16 spell_type) { return false; } -uint16 GetCorrectBotSpellType(uint16 spell_type, uint16 spell_id) { +uint16 GetCorrectBotSpellType(uint16 spell_type, int32 spell_id) { if (!IsValidSpell(spell_id)) { return UINT16_MAX; } @@ -504,7 +504,7 @@ bool IsBotBuffSpellType(uint16 spell_type) { return false; } -bool BotRequiresLoSToCast(uint16 spell_type, uint16 spell_id) { +bool BotRequiresLoSToCast(uint16 spell_type, int32 spell_id) { if (!BotSpellTypeRequiresTarget(spell_type)) { return false; } diff --git a/common/version.h b/common/version.h index 02f064096..91fbeb52e 100644 --- a/common/version.h +++ b/common/version.h @@ -38,6 +38,6 @@ * Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9328 -#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9055 +#define CURRENT_BINARY_DATABASE_VERSION 9329 +#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9056 #define CUSTOM_BINARY_DATABASE_VERSION 0 diff --git a/tob/opcodes.md b/tob/opcodes.md index 9c60dc50d..0539e74af 100644 --- a/tob/opcodes.md +++ b/tob/opcodes.md @@ -68,9 +68,8 @@ Below is a status list for the 450 opcodes we currently use on the server for th | `OP_BlockedBuffs` | 🟢 Verified | | | | `OP_BoardBoat` | 🟡 Unverified | | | | `OP_BookButton` | 🟡 Unverified | | | -| `OP_Buff` | 🟡 Unverified | | | -| `OP_BuffCreate` | 🟡 Unverified | | | -| `OP_BuffRemoveRequest` | 🟡 Unverified | | | +| `OP_BuffDefinition` | 🟢 Verified | | | +| `OP_BuffRemoveRequest` | 🟢 Verified | | | | `OP_Bug` | 🟡 Unverified | | | | `OP_BuyerItems` | 🔴 Not-Set | | | | `OP_CameraEffect` | 🟡 Unverified | | | @@ -395,7 +394,6 @@ Below is a status list for the 450 opcodes we currently use on the server for th | `OP_OpenInventory` | 🔴 Not-Set | | | | `OP_OpenTributeMaster` | 🔴 Not-Set | | | | `OP_PDeletePetition` | 🔴 Not-Set | | | -| `OP_PetBuffWindow` | 🔴 Not-Set | | | | `OP_PetCommands` | 🔴 Not-Set | | | | `OP_PetCommandState` | 🔴 Not-Set | | | | `OP_PetHoTT` | 🔴 Not-Set | | | @@ -451,6 +449,9 @@ Below is a status list for the 450 opcodes we currently use on the server for th | `OP_RecipesFavorite` | 🟡 Unverified | | | | `OP_RecipesSearch` | 🟡 Unverified | | | | `OP_ReclaimCrystals` | 🔴 Not-Set | | | +| `OP_RefreshBuffs` | 🟢 Verified | | | +| `OP_RefreshPetBuffs` | 🟢 Verified | | | +| `OP_RefreshTargetBuffs` | 🟢 Verified | | | | `OP_ReloadUI` | 🔴 Not-Set | | | | `OP_RemoveAllDoors` | 🟡 Unverified | | | | `OP_RemoveBlockedBuffs` | 🟢 Verified | | | @@ -551,7 +552,6 @@ Below is a status list for the 450 opcodes we currently use on the server for th | `OP_Surname` | 🔴 Not-Set | | | | `OP_SwapSpell` | 🟢 Verified | | | | `OP_SystemFingerprint` | 🔴 Not-Set | | | -| `OP_TargetBuffs` | 🔴 Not-Set | | | | `OP_TargetCommand` | 🟡 Unverified | | | | `OP_TargetHoTT` | 🔴 Not-Set | | | | `OP_TargetMouse` | 🟡 Unverified | | | diff --git a/utils/EQExtractor2/EQExtractor2/patch_April15-2013.conf b/utils/EQExtractor2/EQExtractor2/patch_April15-2013.conf index 4661c9f03..98fa92c92 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_April15-2013.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_April15-2013.conf @@ -173,7 +173,7 @@ OP_CastSpell=0x3f6d OP_Consider=0x3815 OP_FormattedMessage=0x52c0 OP_SimpleMessage=0x0e29 -OP_Buff=0x0dd5 +OP_BuffDefinition=0x0dd5 OP_Illusion=0x1182 OP_MoneyOnCorpse=0x05e8 OP_RandomReply=0x4b1a @@ -231,8 +231,8 @@ OP_TargetHoTT=0x2baa OP_XTargetResponse=0x0be2 OP_XTargetRequest=0x024c OP_XTargetAutoAddHaters=0x3729 -OP_TargetBuffs=0x241c -OP_BuffCreate=0x6878 +OP_RefreshTargetBuffs=0x241c +OP_RefreshBuffs=0x6878 OP_BuffRemoveRequest=0x78ab OP_DeleteSpawn=0x5279 OP_AutoAttack=0x1bf5 @@ -298,7 +298,7 @@ OP_SendFindableNPCs=0x743b OP_FindPersonRequest=0x3560 OP_FindPersonReply=0x0844 OP_Sound=0x1b73 -OP_PetBuffWindow=0x56c0 +OP_RefreshPetBuffs=0x56c0 OP_LevelAppearance=0x6698 OP_Translocate=0x091a OP_Sacrifice=0x5b22 diff --git a/utils/EQExtractor2/EQExtractor2/patch_Aug04-2011.conf b/utils/EQExtractor2/EQExtractor2/patch_Aug04-2011.conf index 44893bc82..934194134 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Aug04-2011.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Aug04-2011.conf @@ -169,7 +169,7 @@ OP_CastSpell=0x7286 # OP_Consider=0x0000 # OP_FormattedMessage=0x32c6 # OP_SimpleMessage=0x0000 # C 0x0000 -OP_Buff=0x0000 # +OP_BuffDefinition=0x0000 # OP_Illusion=0x0000 # OP_MoneyOnCorpse=0x0000 # OP_RandomReply=0x0000 # @@ -224,8 +224,8 @@ OP_TargetMouse=0x5f5e # OP_MobHealth=0x0000 # OP_InitialMobHealth=0x0000 # OP_TargetHoTT=0x0000 # -OP_TargetBuffs=0x0000 # -OP_BuffCreate=0x0000 +OP_RefreshTargetBuffs=0x0000 # +OP_RefreshBuffs=0x0000 OP_DeleteSpawn=0x725a # OP_AutoAttack=0x1df9 # OP_AutoAttack2=0x0000 # @@ -290,7 +290,7 @@ OP_SendFindableNPCs=0x0786 # OP_FindPersonRequest=0x0000 # OP_FindPersonReply=0x0000 # OP_Sound=0x0000 # -OP_PetBuffWindow=0x0000 # +OP_RefreshPetBuffs=0x0000 # OP_LevelAppearance=0x0000 # OP_Translocate=0x0000 # OP_Sacrifice=0x0000 # diff --git a/utils/EQExtractor2/EQExtractor2/patch_August15-2012.conf b/utils/EQExtractor2/EQExtractor2/patch_August15-2012.conf index 6549d6dfd..f2c8c9566 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_August15-2012.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_August15-2012.conf @@ -177,7 +177,7 @@ OP_CastSpell=0x0000 # OP_Consider=0x0000 # OP_FormattedMessage=0x0000 # OP_SimpleMessage=0x0000 # -OP_Buff=0x0000 # +OP_BuffDefinition=0x0000 # OP_Illusion=0x0000 # OP_MoneyOnCorpse=0x0000 # OP_RandomReply=0x0000 # @@ -234,8 +234,8 @@ OP_TargetMouse=0x0000 # OP_MobHealth=0x0000 # OP_InitialMobHealth=0x0000 # OP_TargetHoTT=0x0000 # -OP_TargetBuffs=0x0000 # -OP_BuffCreate=0x0000 # +OP_RefreshTargetBuffs=0x0000 # +OP_RefreshBuffs=0x0000 # OP_BuffRemoveRequest=0x0000 OP_DeleteSpawn=0x0000 # OP_AutoAttack=0x0000 # @@ -302,7 +302,7 @@ OP_SendFindableNPCs=0x6c36 # OP_FindPersonRequest=0x0000 # OP_FindPersonReply=0x0000 # OP_Sound=0x0000 # -OP_PetBuffWindow=0x0000 # +OP_RefreshPetBuffs=0x0000 # OP_LevelAppearance=0x0000 # OP_Translocate=0x0000 # OP_Sacrifice=0x0000 # diff --git a/utils/EQExtractor2/EQExtractor2/patch_Dec10-2012.conf b/utils/EQExtractor2/EQExtractor2/patch_Dec10-2012.conf index 5dbbda600..2a9e10ccc 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Dec10-2012.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Dec10-2012.conf @@ -173,7 +173,7 @@ OP_CastSpell=0x1cb5 OP_Consider=0x4d8d OP_FormattedMessage=0x6afe OP_SimpleMessage=0x02a5 -OP_Buff=0x08ed +OP_BuffDefinition=0x08ed OP_Illusion=0x6c43 OP_MoneyOnCorpse=0x1837 OP_RandomReply=0x6525 @@ -231,8 +231,8 @@ OP_TargetHoTT=0x3af5 OP_XTargetResponse=0x7f64 OP_XTargetRequest=0x6753 OP_XTargetAutoAddHaters=0x5f51 -OP_TargetBuffs=0x1c71 -OP_BuffCreate=0x71f5 +OP_RefreshTargetBuffs=0x1c71 +OP_RefreshBuffs=0x71f5 OP_BuffRemoveRequest=0x7efd OP_DeleteSpawn=0x3b06 OP_AutoAttack=0x0d14 @@ -298,7 +298,7 @@ OP_SendFindableNPCs=0x34c3 OP_FindPersonRequest=0x2f3b OP_FindPersonReply=0x44f7 OP_Sound=0x3cec -OP_PetBuffWindow=0x7197 +OP_RefreshPetBuffs=0x7197 OP_LevelAppearance=0x7c4d OP_Translocate=0x6f01 OP_Sacrifice=0x76ab diff --git a/utils/EQExtractor2/EQExtractor2/patch_Dec7-2010.conf b/utils/EQExtractor2/EQExtractor2/patch_Dec7-2010.conf index 570e31cce..9c4334b8a 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Dec7-2010.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Dec7-2010.conf @@ -169,7 +169,7 @@ OP_CastSpell=0x7286 # C OP_Consider=0x0000 # C OP_FormattedMessage=0x0000 # C OP_SimpleMessage=0x0000 # C 0x0000 -OP_Buff=0x0000 # C +OP_BuffDefinition=0x0000 # C OP_Illusion=0x0000 # C OP_MoneyOnCorpse=0x0000 # C OP_RandomReply=0x0000 # C @@ -224,8 +224,8 @@ OP_TargetMouse=0x36f8 # C 0x0000 OP_MobHealth=0x0000 # C OP_InitialMobHealth=0x0000 # C OP_TargetHoTT=0x0000 # C -OP_TargetBuffs=0x0000 # C -OP_BuffCreate=0x6bfb # V +OP_RefreshTargetBuffs=0x0000 # C +OP_RefreshBuffs=0x6bfb # V OP_DeleteSpawn=0x7434 # was 0x7434 OP_AutoAttack=0x0000 # C OP_AutoAttack2=0x0000 # C @@ -290,7 +290,7 @@ OP_SendFindableNPCs=0x49f6 # C OP_FindPersonRequest=0x0000 # C OP_FindPersonReply=0x0000 # C OP_Sound=0x0000 # C -OP_PetBuffWindow=0x0000 # C +OP_RefreshPetBuffs=0x0000 # C OP_LevelAppearance=0x0000 # C OP_Translocate=0x0000 # C OP_Sacrifice=0x0000 # C diff --git a/utils/EQExtractor2/EQExtractor2/patch_Feb11-2013.conf b/utils/EQExtractor2/EQExtractor2/patch_Feb11-2013.conf index fa04ec9f8..cae71ac8b 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Feb11-2013.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Feb11-2013.conf @@ -173,7 +173,7 @@ OP_CastSpell=0x0e18 OP_Consider=0x0fcd OP_FormattedMessage=0x748e OP_SimpleMessage=0x3ecd -OP_Buff=0x1a9b +OP_BuffDefinition=0x1a9b OP_Illusion=0x359a OP_MoneyOnCorpse=0x1107 OP_RandomReply=0x5cc5 @@ -231,8 +231,8 @@ OP_TargetHoTT=0x1fd6 OP_XTargetResponse=0x6d47 OP_XTargetRequest=0x2603 OP_XTargetAutoAddHaters=0x5fe3 -OP_TargetBuffs=0x4c77 -OP_BuffCreate=0x20ee +OP_RefreshTargetBuffs=0x4c77 +OP_RefreshBuffs=0x20ee OP_BuffRemoveRequest=0x7ca3 OP_DeleteSpawn=0x0ead OP_AutoAttack=0x12fb @@ -298,7 +298,7 @@ OP_SendFindableNPCs=0x7b8a OP_FindPersonRequest=0x5d79 OP_FindPersonReply=0x2b23 OP_Sound=0x03fa -OP_PetBuffWindow=0x1e1c +OP_RefreshPetBuffs=0x1e1c OP_LevelAppearance=0x0442 OP_Translocate=0x2e84 OP_Sacrifice=0x0d88 diff --git a/utils/EQExtractor2/EQExtractor2/patch_Feb8-2011.conf b/utils/EQExtractor2/EQExtractor2/patch_Feb8-2011.conf index b4f2c3415..8212d2062 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Feb8-2011.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Feb8-2011.conf @@ -169,7 +169,7 @@ OP_CastSpell=0x7286 # C OP_Consider=0x0000 # C OP_FormattedMessage=0x0000 # C OP_SimpleMessage=0x0000 # C 0x0000 -OP_Buff=0x0000 # C +OP_BuffDefinition=0x0000 # C OP_Illusion=0x0000 # C OP_MoneyOnCorpse=0x0000 # C OP_RandomReply=0x0000 # C @@ -224,8 +224,8 @@ OP_TargetMouse=0x36f8 # C 0x0000 OP_MobHealth=0x0000 # C OP_InitialMobHealth=0x0000 # C OP_TargetHoTT=0x0000 # C -OP_TargetBuffs=0x0000 # C -OP_BuffCreate=0x6bfb # V +OP_RefreshTargetBuffs=0x0000 # C +OP_RefreshBuffs=0x6bfb # V OP_DeleteSpawn=0x7434 # was 0x7434 OP_AutoAttack=0x0000 # C OP_AutoAttack2=0x0000 # C @@ -290,7 +290,7 @@ OP_SendFindableNPCs=0x7eeb # C OP_FindPersonRequest=0x0000 # C OP_FindPersonReply=0x0000 # C OP_Sound=0x0000 # C -OP_PetBuffWindow=0x0000 # C +OP_RefreshPetBuffs=0x0000 # C OP_LevelAppearance=0x0000 # C OP_Translocate=0x0000 # C OP_Sacrifice=0x0000 # C diff --git a/utils/EQExtractor2/EQExtractor2/patch_Jan16-2013.conf b/utils/EQExtractor2/EQExtractor2/patch_Jan16-2013.conf index a2fea9ca6..ffbd37c25 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Jan16-2013.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Jan16-2013.conf @@ -173,7 +173,7 @@ OP_CastSpell=0x6bd3 OP_Consider=0x1184 OP_FormattedMessage=0x1bc4 OP_SimpleMessage=0x4926 -OP_Buff=0x3526 +OP_BuffDefinition=0x3526 OP_Illusion=0x02e6 OP_MoneyOnCorpse=0x2a0f OP_RandomReply=0x0b4b @@ -231,8 +231,8 @@ OP_TargetHoTT=0x43ec OP_XTargetResponse=0x18c5 OP_XTargetRequest=0x47bc OP_XTargetAutoAddHaters=0x48f8 -OP_TargetBuffs=0x0a99 -OP_BuffCreate=0x1cc2 +OP_RefreshTargetBuffs=0x0a99 +OP_RefreshBuffs=0x1cc2 OP_BuffRemoveRequest=0x1338 OP_DeleteSpawn=0x781f OP_AutoAttack=0x1740 @@ -298,7 +298,7 @@ OP_SendFindableNPCs=0x5de1 OP_FindPersonRequest=0x4150 OP_FindPersonReply=0x65f0 OP_Sound=0x797b -OP_PetBuffWindow=0x12cd +OP_RefreshPetBuffs=0x12cd OP_LevelAppearance=0x34b9 OP_Translocate=0x7121 OP_Sacrifice=0x609b diff --git a/utils/EQExtractor2/EQExtractor2/patch_July13-2012.conf b/utils/EQExtractor2/EQExtractor2/patch_July13-2012.conf index 5f53a8eaa..8238d518b 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_July13-2012.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_July13-2012.conf @@ -177,7 +177,7 @@ OP_CastSpell=0x8543 # OP_Consider=0x70c6 # OP_FormattedMessage=0x4675 # OP_SimpleMessage=0x0698 # -OP_Buff=0x4658 # +OP_BuffDefinition=0x4658 # OP_Illusion=0x10b7 # OP_MoneyOnCorpse=0x4074 # OP_RandomReply=0x07fb # @@ -234,8 +234,8 @@ OP_TargetMouse=0x3edc # OP_MobHealth=0x5cb0 # OP_InitialMobHealth=0x0000 # OP_TargetHoTT=0x460e # -OP_TargetBuffs=0x7c24 # -OP_BuffCreate=0x0c98 # +OP_RefreshTargetBuffs=0x7c24 # +OP_RefreshBuffs=0x0c98 # OP_BuffRemoveRequest=0x3567 OP_DeleteSpawn=0x3164 # OP_AutoAttack=0x2257 # @@ -302,7 +302,7 @@ OP_SendFindableNPCs=0x50c1 # OP_FindPersonRequest=0x19a8 # OP_FindPersonReply=0x7e45 # OP_Sound=0x2d1d # -OP_PetBuffWindow=0x4895 # +OP_RefreshPetBuffs=0x4895 # OP_LevelAppearance=0x78b9 # OP_Translocate=0x42ef # OP_Sacrifice=0x2dc6 # diff --git a/utils/EQExtractor2/EQExtractor2/patch_June25-2012.conf b/utils/EQExtractor2/EQExtractor2/patch_June25-2012.conf index 3be014ca9..935bb4698 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_June25-2012.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_June25-2012.conf @@ -177,7 +177,7 @@ OP_CastSpell=0x8543 # OP_Consider=0x70c6 # OP_FormattedMessage=0x4675 # OP_SimpleMessage=0x0698 # -OP_Buff=0x4658 # +OP_BuffDefinition=0x4658 # OP_Illusion=0x10b7 # OP_MoneyOnCorpse=0x4074 # OP_RandomReply=0x07fb # @@ -234,8 +234,8 @@ OP_TargetMouse=0x3edc # OP_MobHealth=0x5cb0 # OP_InitialMobHealth=0x0000 # OP_TargetHoTT=0x460e # -OP_TargetBuffs=0x7c24 # -OP_BuffCreate=0x0c98 # +OP_RefreshTargetBuffs=0x7c24 # +OP_RefreshBuffs=0x0c98 # OP_BuffRemoveRequest=0x3567 OP_DeleteSpawn=0x3164 # OP_AutoAttack=0x2257 # @@ -302,7 +302,7 @@ OP_SendFindableNPCs=0x099e # OP_FindPersonRequest=0x19a8 # OP_FindPersonReply=0x7e45 # OP_Sound=0x2d1d # -OP_PetBuffWindow=0x4895 # +OP_RefreshPetBuffs=0x4895 # OP_LevelAppearance=0x78b9 # OP_Translocate=0x42ef # OP_Sacrifice=0x2dc6 # diff --git a/utils/EQExtractor2/EQExtractor2/patch_Mar13-2013.conf b/utils/EQExtractor2/EQExtractor2/patch_Mar13-2013.conf index 25ff533bb..a337d8e8d 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Mar13-2013.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Mar13-2013.conf @@ -173,7 +173,7 @@ OP_CastSpell=0x56ab OP_Consider=0x476f OP_FormattedMessage=0x69aa OP_SimpleMessage=0x0e87 -OP_Buff=0x2acd +OP_BuffDefinition=0x2acd OP_Illusion=0x739c OP_MoneyOnCorpse=0x43c4 OP_RandomReply=0x467d @@ -231,8 +231,8 @@ OP_TargetHoTT=0x72b0 OP_XTargetResponse=0x38c9 OP_XTargetRequest=0x616b OP_XTargetAutoAddHaters=0x0ef7 -OP_TargetBuffs=0x0aa5 -OP_BuffCreate=0x3e45 +OP_RefreshTargetBuffs=0x0aa5 +OP_RefreshBuffs=0x3e45 OP_BuffRemoveRequest=0x063f OP_DeleteSpawn=0x49e0 OP_AutoAttack=0x18e2 @@ -298,7 +298,7 @@ OP_SendFindableNPCs=0x6788 OP_FindPersonRequest=0x6ccd OP_FindPersonReply=0x1f1c OP_Sound=0x6957 -OP_PetBuffWindow=0x66a7 +OP_RefreshPetBuffs=0x66a7 OP_LevelAppearance=0x3714 OP_Translocate=0x4613 OP_Sacrifice=0x1502 diff --git a/utils/EQExtractor2/EQExtractor2/patch_Mar15-2012.conf b/utils/EQExtractor2/EQExtractor2/patch_Mar15-2012.conf index 23248f238..de4efdb37 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Mar15-2012.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Mar15-2012.conf @@ -175,7 +175,7 @@ OP_CastSpell=0x8543 # OP_Consider=0x70c6 # OP_FormattedMessage=0x4675 # OP_SimpleMessage=0x0698 # -OP_Buff=0x4658 # +OP_BuffDefinition=0x4658 # OP_Illusion=0x10b7 # OP_MoneyOnCorpse=0x4074 # OP_RandomReply=0x07fb # @@ -232,8 +232,8 @@ OP_TargetMouse=0x3edc # OP_MobHealth=0x5cb0 # OP_InitialMobHealth=0x0000 # OP_TargetHoTT=0x460e # -OP_TargetBuffs=0x7c24 # -OP_BuffCreate=0x0c98 # +OP_RefreshTargetBuffs=0x7c24 # +OP_RefreshBuffs=0x0c98 # OP_BuffRemoveRequest=0x3567 OP_DeleteSpawn=0x3164 # OP_AutoAttack=0x2257 # @@ -300,7 +300,7 @@ OP_SendFindableNPCs=0x3015 # OP_FindPersonRequest=0x19a8 # OP_FindPersonReply=0x7e45 # OP_Sound=0x2d1d # -OP_PetBuffWindow=0x4895 # +OP_RefreshPetBuffs=0x4895 # OP_LevelAppearance=0x78b9 # OP_Translocate=0x42ef # OP_Sacrifice=0x2dc6 # diff --git a/utils/EQExtractor2/EQExtractor2/patch_March15-2011.conf b/utils/EQExtractor2/EQExtractor2/patch_March15-2011.conf index b693f0619..9356c1857 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_March15-2011.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_March15-2011.conf @@ -169,7 +169,7 @@ OP_CastSpell=0x7286 # C OP_Consider=0x0000 # C OP_FormattedMessage=0x0000 # C OP_SimpleMessage=0x0000 # C 0x0000 -OP_Buff=0x0000 # C +OP_BuffDefinition=0x0000 # C OP_Illusion=0x0000 # C OP_MoneyOnCorpse=0x0000 # C OP_RandomReply=0x0000 # C @@ -224,8 +224,8 @@ OP_TargetMouse=0x36f8 # C 0x0000 OP_MobHealth=0x0000 # C OP_InitialMobHealth=0x0000 # C OP_TargetHoTT=0x0000 # C -OP_TargetBuffs=0x0000 # C -OP_BuffCreate=0x6bfb # V +OP_RefreshTargetBuffs=0x0000 # C +OP_RefreshBuffs=0x6bfb # V OP_DeleteSpawn=0x7434 # was 0x7434 OP_AutoAttack=0x0000 # C OP_AutoAttack2=0x0000 # C @@ -290,7 +290,7 @@ OP_SendFindableNPCs=0x7eeb # C OP_FindPersonRequest=0x0000 # C OP_FindPersonReply=0x0000 # C OP_Sound=0x0000 # C -OP_PetBuffWindow=0x0000 # C +OP_RefreshPetBuffs=0x0000 # C OP_LevelAppearance=0x0000 # C OP_Translocate=0x0000 # C OP_Sacrifice=0x0000 # C diff --git a/utils/EQExtractor2/EQExtractor2/patch_May12-2010.conf b/utils/EQExtractor2/EQExtractor2/patch_May12-2010.conf index dacd2248f..59b75ca71 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_May12-2010.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_May12-2010.conf @@ -170,7 +170,7 @@ OP_CastSpell=0x50c2 # C OP_Consider=0x3c2d # C OP_FormattedMessage=0x3b52 # C OP_SimpleMessage=0x1f4d # C 0x5448 -OP_Buff=0x0d1d # C +OP_BuffDefinition=0x0d1d # C OP_Illusion=0x231f # C OP_MoneyOnCorpse=0x4a83 # C OP_RandomReply=0x6d5d # C @@ -225,8 +225,8 @@ OP_TargetMouse=0x5f5e # C 0x7bbb OP_MobHealth=0x15de # C OP_InitialMobHealth=0x5cb0 # C OP_TargetHoTT=0x4d56 # C -OP_TargetBuffs=0x3f24 # C -OP_BuffCreate=0x2121 # V +OP_RefreshTargetBuffs=0x3f24 # C +OP_RefreshBuffs=0x2121 # V OP_DeleteSpawn=0x58c5 # C OP_AutoAttack=0x1df9 # C OP_AutoAttack2=0x517b # C @@ -291,7 +291,7 @@ OP_SendFindableNPCs=0x6193 # C OP_FindPersonRequest=0x1e04 # C OP_FindPersonReply=0x7cae # C OP_Sound=0x737a # C -OP_PetBuffWindow=0x7b87 # C +OP_RefreshPetBuffs=0x7b87 # C OP_LevelAppearance=0x1bd4 # C OP_Translocate=0x3d9c # C OP_Sacrifice=0x301b # C diff --git a/utils/EQExtractor2/EQExtractor2/patch_May12-2011.conf b/utils/EQExtractor2/EQExtractor2/patch_May12-2011.conf index 572967ead..1367ea267 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_May12-2011.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_May12-2011.conf @@ -169,7 +169,7 @@ OP_CastSpell=0x7286 # C OP_Consider=0x0000 # C OP_FormattedMessage=0x0000 # C OP_SimpleMessage=0x0000 # C 0x0000 -OP_Buff=0x0000 # C +OP_BuffDefinition=0x0000 # C OP_Illusion=0x0000 # C OP_MoneyOnCorpse=0x0000 # C OP_RandomReply=0x0000 # C @@ -224,8 +224,8 @@ OP_TargetMouse=0x36f8 # C 0x0000 OP_MobHealth=0x0000 # C OP_InitialMobHealth=0x0000 # C OP_TargetHoTT=0x0000 # C -OP_TargetBuffs=0x0000 # C -OP_BuffCreate=0x6bfb # V +OP_RefreshTargetBuffs=0x0000 # C +OP_RefreshBuffs=0x6bfb # V OP_DeleteSpawn=0x7434 # was 0x7434 OP_AutoAttack=0x0000 # C OP_AutoAttack2=0x0000 # C @@ -290,7 +290,7 @@ OP_SendFindableNPCs=0x390c # C OP_FindPersonRequest=0x0000 # C OP_FindPersonReply=0x0000 # C OP_Sound=0x0000 # C -OP_PetBuffWindow=0x0000 # C +OP_RefreshPetBuffs=0x0000 # C OP_LevelAppearance=0x0000 # C OP_Translocate=0x0000 # C OP_Sacrifice=0x0000 # C diff --git a/utils/EQExtractor2/EQExtractor2/patch_Nov17-2011.conf b/utils/EQExtractor2/EQExtractor2/patch_Nov17-2011.conf index 91dc487ba..a77eab374 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Nov17-2011.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Nov17-2011.conf @@ -160,7 +160,7 @@ OP_CastSpell=0x7286 # OP_Consider=0x70c6 #c OP_FormattedMessage=0x32c6 # OP_SimpleMessage=0x0000 # C 0x0000 -OP_Buff=0x0000 # +OP_BuffDefinition=0x0000 # OP_Illusion=0x4843 #c OP_MoneyOnCorpse=0x0000 # OP_RandomReply=0x0000 # @@ -215,8 +215,8 @@ OP_TargetMouse=0x3edc # OP_MobHealth=0x5cb0 #c OP_InitialMobHealth=0x0000 # OP_TargetHoTT=0x0000 # -OP_TargetBuffs=0x0000 # -OP_BuffCreate=0x0000 +OP_RefreshTargetBuffs=0x0000 # +OP_RefreshBuffs=0x0000 OP_DeleteSpawn=0x58c5 #c OP_AutoAttack=0x1df9 # OP_AutoAttack2=0x0000 # @@ -281,7 +281,7 @@ OP_SendFindableNPCs=0x3015 # OP_FindPersonRequest=0x0000 # OP_FindPersonReply=0x0000 # OP_Sound=0x0000 # -OP_PetBuffWindow=0x0000 # +OP_RefreshPetBuffs=0x0000 # OP_LevelAppearance=0x0000 # OP_Translocate=0x0000 # OP_Sacrifice=0x0000 # diff --git a/utils/EQExtractor2/EQExtractor2/patch_Sep01-2010.conf b/utils/EQExtractor2/EQExtractor2/patch_Sep01-2010.conf index 5cb16815b..913363212 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Sep01-2010.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Sep01-2010.conf @@ -170,7 +170,7 @@ OP_CastSpell=0x7286 # C OP_Consider=0x0000 # C OP_FormattedMessage=0x0000 # C OP_SimpleMessage=0x0000 # C 0x0000 -OP_Buff=0x0000 # C +OP_BuffDefinition=0x0000 # C OP_Illusion=0x0000 # C OP_MoneyOnCorpse=0x0000 # C OP_RandomReply=0x0000 # C @@ -225,8 +225,8 @@ OP_TargetMouse=0x36f8 # C 0x0000 OP_MobHealth=0x0000 # C OP_InitialMobHealth=0x0000 # C OP_TargetHoTT=0x0000 # C -OP_TargetBuffs=0x0000 # C -OP_BuffCreate=0x0000 # V +OP_RefreshTargetBuffs=0x0000 # C +OP_RefreshBuffs=0x0000 # V OP_DeleteSpawn=0x7434 # C OP_AutoAttack=0x0000 # C OP_AutoAttack2=0x0000 # C @@ -291,7 +291,7 @@ OP_SendFindableNPCs=0x162d # C OP_FindPersonRequest=0x0000 # C OP_FindPersonReply=0x0000 # C OP_Sound=0x0000 # C -OP_PetBuffWindow=0x0000 # C +OP_RefreshPetBuffs=0x0000 # C OP_LevelAppearance=0x0000 # C OP_Translocate=0x0000 # C OP_Sacrifice=0x0000 # C diff --git a/utils/EQExtractor2/EQExtractor2/patch_Sep22-2010.conf b/utils/EQExtractor2/EQExtractor2/patch_Sep22-2010.conf index feb6eaf12..5d921774f 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_Sep22-2010.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_Sep22-2010.conf @@ -170,7 +170,7 @@ OP_CastSpell=0x0000 # C OP_Consider=0x0000 # C OP_FormattedMessage=0x0000 # C OP_SimpleMessage=0x0000 # C 0x0000 -OP_Buff=0x0000 # C +OP_BuffDefinition=0x0000 # C OP_Illusion=0x0000 # C OP_MoneyOnCorpse=0x0000 # C OP_RandomReply=0x0000 # C @@ -225,8 +225,8 @@ OP_TargetMouse=0x36f8 # C 0x0000 OP_MobHealth=0x0000 # C OP_InitialMobHealth=0x0000 # C OP_TargetHoTT=0x0000 # C -OP_TargetBuffs=0x0000 # C -OP_BuffCreate=0x0000 # V +OP_RefreshTargetBuffs=0x0000 # C +OP_RefreshBuffs=0x0000 # V OP_DeleteSpawn=0x7434 # was 0x7434 OP_AutoAttack=0x0000 # C OP_AutoAttack2=0x0000 # C @@ -291,7 +291,7 @@ OP_SendFindableNPCs=0x6b67 # was 0x162d OP_FindPersonRequest=0x0000 # C OP_FindPersonReply=0x0000 # C OP_Sound=0x0000 # C -OP_PetBuffWindow=0x0000 # C +OP_RefreshPetBuffs=0x0000 # C OP_LevelAppearance=0x0000 # C OP_Translocate=0x0000 # C OP_Sacrifice=0x0000 # C diff --git a/utils/EQExtractor2/EQExtractor2/patch_SoD.conf b/utils/EQExtractor2/EQExtractor2/patch_SoD.conf index 3ae82376b..599d94657 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_SoD.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_SoD.conf @@ -172,7 +172,7 @@ OP_CastSpell=0x3582 # C OP_Consider=0x6024 # C OP_FormattedMessage=0x1318 # C OP_SimpleMessage=0x5448 # C -OP_Buff=0x7ea8 # C +OP_BuffDefinition=0x7ea8 # C OP_Illusion=0x48f9 # C OP_MoneyOnCorpse=0x6546 # C OP_RandomReply=0x6cdc # C @@ -227,7 +227,7 @@ OP_TargetMouse=0x7bbb # C OP_MobHealth=0x47ea # C OP_InitialMobHealth=0x2d25 # C OP_TargetHoTT=0x3ec7 # C -OP_TargetBuffs=0x3df8 +OP_RefreshTargetBuffs=0x3df8 OP_DeleteSpawn=0x3164 # C OP_AutoAttack=0x3d86 # C OP_AutoAttack2=0x4ca1 # C @@ -293,7 +293,7 @@ OP_SendFindableNPCs=0x5360 OP_FindPersonRequest=0x3168 # C OP_FindPersonReply=0x1ac8 # C OP_Sound=0x303e # C -OP_PetBuffWindow=0x2dd3 # C +OP_RefreshPetBuffs=0x2dd3 # C OP_LevelAppearance=0x6dc3 # C OP_Translocate=0x2042 # C OP_Sacrifice=0x5805 # C diff --git a/utils/EQExtractor2/EQExtractor2/patch_TestServer-Feb5-2013.conf b/utils/EQExtractor2/EQExtractor2/patch_TestServer-Feb5-2013.conf index a633e4f37..b835930b7 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_TestServer-Feb5-2013.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_TestServer-Feb5-2013.conf @@ -173,7 +173,7 @@ OP_CastSpell=0x568e OP_Consider=0x0ea4 OP_FormattedMessage=0x7cd3 OP_SimpleMessage=0x4a83 -OP_Buff=0x3c26 +OP_BuffDefinition=0x3c26 OP_Illusion=0x25dd OP_MoneyOnCorpse=0x6fbd OP_RandomReply=0x3939 @@ -231,8 +231,8 @@ OP_TargetHoTT=0x042a OP_XTargetResponse=0x5473 OP_XTargetRequest=0x45a9 OP_XTargetAutoAddHaters=0x5af8 -OP_TargetBuffs=0x156f -OP_BuffCreate=0x2013 +OP_RefreshTargetBuffs=0x156f +OP_RefreshBuffs=0x2013 OP_BuffRemoveRequest=0x718c OP_DeleteSpawn=0x69b2 OP_AutoAttack=0x702f @@ -298,7 +298,7 @@ OP_SendFindableNPCs=0x6516 OP_FindPersonRequest=0x4e65 OP_FindPersonReply=0x5e04 OP_Sound=0x6ad4 -OP_PetBuffWindow=0x5be1 +OP_RefreshPetBuffs=0x5be1 OP_LevelAppearance=0x7a6f OP_Translocate=0x3a61 OP_Sacrifice=0x18a6 diff --git a/utils/EQExtractor2/EQExtractor2/patch_TestServer-Jan16-2013.conf b/utils/EQExtractor2/EQExtractor2/patch_TestServer-Jan16-2013.conf index 5a8baa8fa..62afc1735 100644 --- a/utils/EQExtractor2/EQExtractor2/patch_TestServer-Jan16-2013.conf +++ b/utils/EQExtractor2/EQExtractor2/patch_TestServer-Jan16-2013.conf @@ -173,7 +173,7 @@ OP_CastSpell=0x5c4b OP_Consider=0x0e31 OP_FormattedMessage=0x3735 OP_SimpleMessage=0x4645 -OP_Buff=0x7fb5 +OP_BuffDefinition=0x7fb5 OP_Illusion=0x3772 OP_MoneyOnCorpse=0x4ab0 OP_RandomReply=0x76ea @@ -231,8 +231,8 @@ OP_TargetHoTT=0x1be6 OP_XTargetResponse=0x0ad9 OP_XTargetRequest=0x3034 OP_XTargetAutoAddHaters=0x7efd -OP_TargetBuffs=0x5e3b -OP_BuffCreate=0x51da +OP_RefreshTargetBuffs=0x5e3b +OP_RefreshBuffs=0x51da OP_BuffRemoveRequest=0x6ce2 OP_DeleteSpawn=0x0ef8 OP_AutoAttack=0x577f @@ -298,7 +298,7 @@ OP_SendFindableNPCs=0x62da OP_FindPersonRequest=0x41fb OP_FindPersonReply=0x23e2 OP_Sound=0x622a -OP_PetBuffWindow=0x53f8 +OP_RefreshPetBuffs=0x53f8 OP_LevelAppearance=0x5b03 OP_Translocate=0x5e10 OP_Sacrifice=0x2ee4 diff --git a/utils/patches/opcodes.conf b/utils/patches/opcodes.conf index 3f5e87b5a..0469ce50e 100644 --- a/utils/patches/opcodes.conf +++ b/utils/patches/opcodes.conf @@ -175,7 +175,7 @@ OP_SetRunMode=0x4aba # ShowEQ 10/27/05 OP_SimpleMessage=0x673c # ShowEQ 10/27/05 OP_SaveOnZoneReq=0x1540 # ShowEQ 10/27/05 OP_SenseHeading=0x05ac # ShowEQ 10/27/05 -OP_Buff=0x6a53 # ShowEQ 10/27/05 +OP_BuffDefinition=0x6a53 # ShowEQ 10/27/05 OP_LootComplete=0x0a94 # ShowEQ 10/27/05 OP_EnvDamage=0x31b3 # ShowEQ 10/27/05 OP_Split=0x4848 # ShowEQ 10/27/05 diff --git a/utils/patches/patch_RoF.conf b/utils/patches/patch_RoF.conf index f961afadf..c4def424a 100644 --- a/utils/patches/patch_RoF.conf +++ b/utils/patches/patch_RoF.conf @@ -179,7 +179,7 @@ OP_CastSpell=0x1cb5 OP_Consider=0x4d8d OP_FormattedMessage=0x6afe OP_SimpleMessage=0x02a5 -OP_Buff=0x08ed +OP_BuffDefinition=0x08ed OP_Illusion=0x6c43 OP_MoneyOnCorpse=0x1837 OP_RandomReply=0x6525 @@ -241,8 +241,8 @@ OP_XTargetRequest=0x6753 OP_XTargetAutoAddHaters=0x5f51 OP_XTargetOpen=0x7423 OP_XTargetOpenResponse=0x27e8 -OP_TargetBuffs=0x1c71 -OP_BuffCreate=0x71f5 +OP_RefreshTargetBuffs=0x1c71 +OP_RefreshBuffs=0x71f5 OP_BuffRemoveRequest=0x7efd OP_DeleteSpawn=0x3b06 OP_AutoAttack=0x0d14 @@ -312,7 +312,7 @@ OP_FindPersonRequest=0x2f3b OP_FindPersonReply=0x44f7 OP_Sound=0x3cec OP_CashReward=0x17a5 -OP_PetBuffWindow=0x7197 +OP_RefreshPetBuffs=0x7197 OP_LevelAppearance=0x7c4d OP_Translocate=0x6f01 OP_Sacrifice=0x76ab diff --git a/utils/patches/patch_RoF2.conf b/utils/patches/patch_RoF2.conf index e5d9173cf..bff232bf9 100644 --- a/utils/patches/patch_RoF2.conf +++ b/utils/patches/patch_RoF2.conf @@ -183,7 +183,7 @@ OP_CastSpell=0x1287 OP_Consider=0x742b OP_FormattedMessage=0x1024 OP_SimpleMessage=0x213f -OP_Buff=0x659c +OP_BuffDefinition=0x659c OP_Illusion=0x312a OP_MoneyOnCorpse=0x5f44 OP_RandomReply=0x106b @@ -241,13 +241,13 @@ OP_TargetMouse=0x075d OP_MobHealth=0x37b1 OP_InitialMobHealth=0x0000 # Unused? OP_TargetHoTT=0x0272 -OP_TargetBuffs=0x4f4b +OP_RefreshTargetBuffs=0x4f4b OP_XTargetResponse=0x4d59 OP_XTargetRequest=0x3763 OP_XTargetAutoAddHaters=0x672f OP_XTargetOpen=0x61df OP_XTargetOpenResponse=0x3ef8 -OP_BuffCreate=0x3377 +OP_RefreshBuffs=0x3377 OP_BuffRemoveRequest=0x64f2 OP_DeleteSpawn=0x7280 OP_AutoAttack=0x109d @@ -316,7 +316,7 @@ OP_FindPersonRequest=0x5cea OP_FindPersonReply=0x7e58 OP_Sound=0x1a30 OP_CashReward=0x5f7a -OP_PetBuffWindow=0x5882 +OP_RefreshPetBuffs=0x5882 OP_LevelAppearance=0x3bc9 OP_Translocate=0x6580 OP_Sacrifice=0x1821 diff --git a/utils/patches/patch_SoD.conf b/utils/patches/patch_SoD.conf index b79f1441c..da5ca33cf 100644 --- a/utils/patches/patch_SoD.conf +++ b/utils/patches/patch_SoD.conf @@ -178,7 +178,7 @@ OP_CastSpell=0x3582 # C OP_Consider=0x6024 # C OP_FormattedMessage=0x1318 # C OP_SimpleMessage=0x5448 # C -OP_Buff=0x7ea8 # C +OP_BuffDefinition=0x7ea8 # C OP_Illusion=0x48f9 # C OP_MoneyOnCorpse=0x6546 # C OP_RandomReply=0x6cdc # C @@ -236,7 +236,7 @@ OP_TargetMouse=0x7bbb # C OP_MobHealth=0x47ea # C OP_InitialMobHealth=0x2d25 # C OP_TargetHoTT=0x3ec7 # C -OP_TargetBuffs=0x3df8 +OP_RefreshTargetBuffs=0x3df8 OP_BuffRemoveRequest=0x6f9d OP_DeleteSpawn=0x3164 # C OP_AutoAttack=0x3d86 # C @@ -308,7 +308,7 @@ OP_FindPersonRequest=0x3168 # C OP_FindPersonReply=0x1ac8 # C OP_Sound=0x303e # C OP_CashReward=0x3703 -OP_PetBuffWindow=0x2dd3 # C +OP_RefreshPetBuffs=0x2dd3 # C OP_LevelAppearance=0x6dc3 # C OP_Translocate=0x2042 # C OP_Sacrifice=0x5805 # C diff --git a/utils/patches/patch_SoF.conf b/utils/patches/patch_SoF.conf index 91d5c7660..a523730d3 100644 --- a/utils/patches/patch_SoF.conf +++ b/utils/patches/patch_SoF.conf @@ -175,7 +175,7 @@ OP_CastSpell=0x7F5D #SEQ 12/04/08 OP_Consider=0x32E1 #SEQ 12/04/08 OP_FormattedMessage=0x5B9E #SEQ 12/04/08 OP_SimpleMessage=0x553E #SEQ 12/04/08 -OP_Buff=0x7BD6 #SEQ 12/04/08 +OP_BuffDefinition=0x7BD6 #SEQ 12/04/08 OP_Illusion=0x7F86 #SEQ 12/04/08 OP_MoneyOnCorpse=0x51C9 #SEQ 12/04/08 OP_RandomReply=0x649C #SEQ 12/04/08 @@ -300,7 +300,7 @@ OP_FindPersonRequest=0x07F0 #Derision 2009 OP_FindPersonReply=0x7770 #Derision 2009 OP_Sound=0x2B02 #Derision 2009 OP_CashReward=0x5e80 -OP_PetBuffWindow=0x124A #Derision 2009 +OP_RefreshPetBuffs=0x124A #Derision 2009 OP_LevelAppearance=0x3EC8 #Derision 2009 OP_Translocate=0x1F0F #Derision 2009 OP_Sacrifice=0x55C9 #Derision 2009 diff --git a/utils/patches/patch_TOB.conf b/utils/patches/patch_TOB.conf index de96f6841..895b19c17 100644 --- a/utils/patches/patch_TOB.conf +++ b/utils/patches/patch_TOB.conf @@ -178,7 +178,10 @@ OP_CastSpell=0x1d63 OP_Consider=0x4568 OP_FormattedMessage=0x29b4 OP_SimpleMessage=0x5b2d -OP_Buff=0x2427 +OP_BuffDefinition=0x2427 +OP_RefreshBuffs=0x754c +OP_RefreshTargetBuffs=0x197f +OP_RefreshPetBuffs=0x4f42 OP_Illusion=0x7fb0 OP_MoneyOnCorpse=0x6f63 OP_RandomReply=0x1234 @@ -236,13 +239,11 @@ OP_TargetMouse=0x7f48 OP_MobHealth=0x445e OP_InitialMobHealth=0x0000 # Unused? OP_TargetHoTT=0x0000 -OP_TargetBuffs=0x0000 OP_XTargetResponse=0x0000 OP_XTargetRequest=0x0000 OP_XTargetAutoAddHaters=0x0000 OP_XTargetOpen=0x0000 OP_XTargetOpenResponse=0x0000 -OP_BuffCreate=0x754c OP_BuffRemoveRequest=0x0c06 OP_DeleteSpawn=0x33fa OP_AutoAttack=0x3ced @@ -310,7 +311,6 @@ OP_FindPersonRequest=0x0000 OP_FindPersonReply=0x0000 OP_Sound=0x5949 OP_CashReward=0x3237 -OP_PetBuffWindow=0x0000 OP_LevelAppearance=0x5eb5 OP_Translocate=0x0611 OP_Sacrifice=0x4b76 diff --git a/utils/patches/patch_Titanium.conf b/utils/patches/patch_Titanium.conf index 8d39d3ec1..2181e1fe1 100644 --- a/utils/patches/patch_Titanium.conf +++ b/utils/patches/patch_Titanium.conf @@ -188,7 +188,7 @@ OP_AutoFire=0x6c53 OP_Consider=0x65ca # ShowEQ 10/27/05 OP_Emote=0x547a # ShowEQ 10/27/05 OP_PetCommands=0x10a1 # ShowEQ 10/27/05 -OP_PetBuffWindow=0x4e31 +OP_RefreshPetBuffs=0x4e31 OP_SpawnAppearance=0x7c32 # ShowEQ 10/27/05 OP_DeleteSpawn=0x55bc # ShowEQ 10/27/05 OP_FormattedMessage=0x5a48 # ShowEQ 10/27/05 @@ -199,7 +199,7 @@ OP_SetRunMode=0x4aba # ShowEQ 10/27/05 OP_SimpleMessage=0x673c # ShowEQ 10/27/05 OP_SaveOnZoneReq=0x1540 # ShowEQ 10/27/05 OP_SenseHeading=0x05ac # ShowEQ 10/27/05 -OP_Buff=0x6a53 # ShowEQ 10/27/05 +OP_BuffDefinition=0x6a53 # ShowEQ 10/27/05 OP_LootComplete=0x0a94 # ShowEQ 10/27/05 OP_EnvDamage=0x31b3 # ShowEQ 10/27/05 OP_Split=0x4848 # ShowEQ 10/27/05 diff --git a/utils/patches/patch_UF.conf b/utils/patches/patch_UF.conf index aa3beb3a2..c3c916989 100644 --- a/utils/patches/patch_UF.conf +++ b/utils/patches/patch_UF.conf @@ -187,7 +187,7 @@ OP_CastSpell=0x50c2 # C OP_Consider=0x3c2d # C OP_FormattedMessage=0x3b52 # C OP_SimpleMessage=0x1f4d # C 0x5448 -OP_Buff=0x0d1d # C +OP_BuffDefinition=0x0d1d # C OP_Illusion=0x231f # C OP_MoneyOnCorpse=0x4a83 # C OP_RandomReply=0x6d5d # C @@ -252,8 +252,8 @@ OP_XTargetRequest=0x4750 # OP_XTargetAutoAddHaters=0x1a28 # OP_XTargetOpen=0x11ae OP_XTargetOpenResponse=0x45d3 -OP_TargetBuffs=0x3f24 # C -OP_BuffCreate=0x2121 # V +OP_RefreshTargetBuffs=0x3f24 # C +OP_RefreshBuffs=0x2121 # V OP_BuffRemoveRequest=0x4065 OP_DeleteSpawn=0x58c5 # C OP_AutoAttack=0x1df9 # C @@ -324,7 +324,7 @@ OP_FindPersonRequest=0x1e04 # C OP_FindPersonReply=0x7cae # C OP_Sound=0x737a # C OP_CashReward=0x039d -OP_PetBuffWindow=0x7b87 # C +OP_RefreshPetBuffs=0x7b87 # C OP_LevelAppearance=0x1bd4 # C OP_Translocate=0x3d9c # C OP_Sacrifice=0x301b # C diff --git a/utils/scripts/opcode_scripts/patch_NEW.conf b/utils/scripts/opcode_scripts/patch_NEW.conf index 29bc320d9..37852598b 100644 --- a/utils/scripts/opcode_scripts/patch_NEW.conf +++ b/utils/scripts/opcode_scripts/patch_NEW.conf @@ -174,7 +174,7 @@ OP_CastSpell=0x1287 OP_Consider=0x742b OP_FormattedMessage=0x1024 OP_SimpleMessage=0x213f -OP_Buff=0x659c +OP_BuffDefinition=0x659c OP_Illusion=0x312a OP_MoneyOnCorpse=0x5f44 OP_RandomReply=0x106b @@ -232,8 +232,8 @@ OP_TargetHoTT=0x0272 OP_XTargetResponse=0x672f OP_XTargetRequest=0x45be OP_XTargetAutoAddHaters=0x792c -OP_TargetBuffs=0x4f4b -OP_BuffCreate=0x3377 +OP_RefreshTargetBuffs=0x4f4b +OP_RefreshBuffs=0x3377 OP_BuffRemoveRequest=0x64f2 OP_DeleteSpawn=0x7280 OP_AutoAttack=0x109d @@ -301,7 +301,7 @@ OP_SendFindableNPCs=0x4613 OP_FindPersonRequest=0x5cea OP_FindPersonReply=0x7e58 OP_Sound=0x1a30 -OP_PetBuffWindow=0x5882 +OP_RefreshPetBuffs=0x5882 OP_LevelAppearance=0x3bc9 OP_Translocate=0x6580 OP_Sacrifice=0x1821 diff --git a/utils/scripts/opcode_scripts/patch_OLD.conf b/utils/scripts/opcode_scripts/patch_OLD.conf index 589c47468..6ebb2df91 100644 --- a/utils/scripts/opcode_scripts/patch_OLD.conf +++ b/utils/scripts/opcode_scripts/patch_OLD.conf @@ -174,7 +174,7 @@ OP_CastSpell=0x1287 OP_Consider=0x742b OP_FormattedMessage=0x1024 OP_SimpleMessage=0x213f -OP_Buff=0x659c +OP_BuffDefinition=0x659c OP_Illusion=0x312a OP_MoneyOnCorpse=0x5f44 OP_RandomReply=0x106b @@ -232,8 +232,8 @@ OP_TargetHoTT=0x0272 OP_XTargetResponse=0x672f OP_XTargetRequest=0x45be OP_XTargetAutoAddHaters=0x792c -OP_TargetBuffs=0x4f4b -OP_BuffCreate=0x3377 +OP_RefreshTargetBuffs=0x4f4b +OP_RefreshBuffs=0x3377 OP_BuffRemoveRequest=0x64f2 OP_DeleteSpawn=0x7280 OP_AutoAttack=0x109d @@ -301,7 +301,7 @@ OP_SendFindableNPCs=0x3897 OP_FindPersonRequest=0x5cea OP_FindPersonReply=0x7e58 OP_Sound=0x1a30 -OP_PetBuffWindow=0x5882 +OP_RefreshPetBuffs=0x5882 OP_LevelAppearance=0x3bc9 OP_Translocate=0x6580 OP_Sacrifice=0x1821 diff --git a/utils/sql/merc_tables_bootstrap.sql b/utils/sql/merc_tables_bootstrap.sql index a527df283..463ca3ae0 100644 --- a/utils/sql/merc_tables_bootstrap.sql +++ b/utils/sql/merc_tables_bootstrap.sql @@ -73,7 +73,7 @@ CREATE TABLE `merc_buffs` ( `MercBuffId` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `MercId` int(10) UNSIGNED NOT NULL DEFAULT 0, - `SpellId` int(10) UNSIGNED NOT NULL DEFAULT 0, + `SpellId` int(10) NOT NULL DEFAULT 0, `CasterLevel` int(10) UNSIGNED NOT NULL DEFAULT 0, `DurationFormula` int(10) UNSIGNED NOT NULL DEFAULT 0, `TicsRemaining` int(11) NOT NULL DEFAULT 0, @@ -941,7 +941,7 @@ CREATE TABLE `merc_spell_list_entries` ( `merc_spell_list_entry_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `merc_spell_list_id` int(10) UNSIGNED NOT NULL, - `spell_id` int(10) UNSIGNED NOT NULL, + `spell_id` int(10) NOT NULL, `spell_type` int(10) UNSIGNED NOT NULL DEFAULT 0, `stance_id` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, `minlevel` tinyint(3) UNSIGNED NOT NULL DEFAULT 1, diff --git a/zone/aa.cpp b/zone/aa.cpp index 984386d40..1985420fd 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -45,7 +45,7 @@ extern WorldServer worldserver; extern QueryServ* QServ; -void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, uint32 duration_override, bool followme, bool sticktarg, uint16 *eye_id) { +void Mob::TemporaryPets(int32 spell_id, Mob *targ, const char *name_override, uint32 duration_override, bool followme, bool sticktarg, uint16 *eye_id) { //It might not be a bad idea to put these into the database, eventually.. @@ -288,7 +288,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid delete made_npc; } -void Mob::WakeTheDead(uint16 spell_id, Corpse *corpse_to_use, Mob *tar, uint32 duration) { +void Mob::WakeTheDead(int32 spell_id, Corpse *corpse_to_use, Mob *tar, uint32 duration) { /* SPA 299 Wake The Dead, 'animateDead' should be temp pet, always spawns 1 pet from corpse, max value is duration diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 0b51fbc11..4e62dca51 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -1348,7 +1348,7 @@ bool Mob::CheckPositioningLosFN(Mob* other, float x, float y, float z) { } //offensive spell aggro -int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool is_proc) +int32 Mob::CheckAggroAmount(int32 spell_id, Mob *target, bool is_proc) { if (IsNoDetrimentalSpellAggroSpell(spell_id)) { return 0; @@ -1536,7 +1536,7 @@ int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool is_proc) } //healing and buffing aggro -int32 Mob::CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possible) +int32 Mob::CheckHealAggroAmount(int32 spell_id, Mob *target, uint32 heal_possible) { int32 AggroAmount = 0; auto target_level = target ? target->GetLevel() : 1; @@ -1662,7 +1662,7 @@ bool Mob::IsOnFeignMemory(Mob *attacker) const return feign_memory_list.find(attacker->GetID()) != feign_memory_list.end(); } -bool Mob::PassCharismaCheck(Mob* caster, uint16 spell_id) { +bool Mob::PassCharismaCheck(Mob* caster, int32 spell_id) { /* Charm formula is correct based on over 50 hours of personal live parsing - Kayen diff --git a/zone/attack.cpp b/zone/attack.cpp index 9ee46b31c..db7dd8482 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1774,7 +1774,7 @@ bool Mob::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } } -void Client::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) +void Client::Damage(Mob* other, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) { if (dead || IsCorpse()) return; @@ -1811,7 +1811,7 @@ void Client::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::Skill } } -bool Client::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillType attack_skill, KilledByTypes killed_by, bool is_buff_tic) +bool Client::Death(Mob* killer_mob, int64 damage, int32 spell, EQ::skills::SkillType attack_skill, KilledByTypes killed_by, bool is_buff_tic) { if (!ClientFinishedLoading() || dead) { return false; @@ -2430,7 +2430,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool return has_hit; } -void NPC::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) { +void NPC::Damage(Mob* other, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) { if (spell_id == 0) spell_id = SPELL_UNKNOWN; @@ -2467,7 +2467,7 @@ void NPC::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::SkillTyp CommonDamage(other, damage, spell_id, attack_skill, avoidable, buffslot, iBuffTic, special); } -bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillType attack_skill, KilledByTypes killed_by, bool is_buff_tic) +bool NPC::Death(Mob* killer_mob, int64 damage, int32 spell, EQ::skills::SkillType attack_skill, KilledByTypes killed_by, bool is_buff_tic) { LogCombat( "Fatal blow dealt by [{}] with [{}] damage, spell [{}], skill [{}]", @@ -3051,7 +3051,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy return true; } -void Mob::AddToHateList(Mob* other, int64 hate /*= 0*/, int64 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/, uint16 spell_id, bool pet_command) +void Mob::AddToHateList(Mob* other, int64 hate /*= 0*/, int64 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/, int32 spell_id, bool pet_command) { if (!other) return; @@ -3312,7 +3312,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { int DS = 0; int rev_ds = 0; - uint16 spellid = 0; + int32 spellid = 0; if (!spell_ds) { @@ -3388,7 +3388,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { //Reverse DS //this is basically a DS, but the spell is on the attacker, not the attackee //if we've gotten to this point, we know we know "attacker" hit "this" (us) for damage & we aren't invulnerable - uint16 rev_ds_spell_id = SPELL_UNKNOWN; + int32 rev_ds_spell_id = SPELL_UNKNOWN; if (IsValidSpell(spellbonuses.ReverseDamageShieldSpellID)) { rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID; @@ -3676,7 +3676,7 @@ int64 Mob::ReduceDamage(int64 damage) return(damage); } -int64 Mob::AffectMagicalDamage(int64 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker) +int64 Mob::AffectMagicalDamage(int64 damage, int32 spell_id, const bool iBuffTic, Mob* attacker) { if (damage <= 0) return damage; @@ -4020,7 +4020,7 @@ bool Mob::CheckDoubleAttack() return zone->random.Int(1, 500) <= chance; } -void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, const EQ::skills::SkillType skill_used, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks special) { +void Mob::CommonDamage(Mob* attacker, int64 &damage, const int32 spell_id, const EQ::skills::SkillType skill_used, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks special) { #ifdef LUA_EQEMU int64 lua_ret = 0; bool ignore_default = false; @@ -4776,7 +4776,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons } } -void Mob::HealDamage(uint64 amount, Mob* caster, uint16 spell_id) +void Mob::HealDamage(uint64 amount, Mob* caster, int32 spell_id) { #ifdef LUA_EQEMU uint64 lua_ret = 0; @@ -5266,7 +5266,7 @@ void Mob::TrySpellProc(const EQ::ItemInstance *inst, const EQ::ItemData *weapon, if (poison_slot > -1) { bool one_shot = !RuleB(Combat, UseExtendedPoisonProcs); float chance = (one_shot) ? 100.0f : ProcChance * (static_cast(SpellProcs[poison_slot].chance) / 100.0f); - uint16 spell_id = SpellProcs[poison_slot].spellID; + int32 spell_id = SpellProcs[poison_slot].spellID; if (zone->random.Roll(chance)) { LogCombat("Poison proc [{}] procing spell [{}] ([{}] percent chance)", poison_slot, spell_id, chance); @@ -5986,8 +5986,8 @@ void Mob::TrySkillProc(Mob *on, EQ::skills::SkillType skill, uint16 ReuseTime, b */ bool CanProc = true; - uint16 base_spell_id = 0; - uint16 proc_spell_id = 0; + int32 base_spell_id = 0; + int32 proc_spell_id = 0; float ProcMod = 0; float chance = 0; diff --git a/zone/aura.cpp b/zone/aura.cpp index 64e69e3d3..8f55a606c 100644 --- a/zone/aura.cpp +++ b/zone/aura.cpp @@ -871,7 +871,7 @@ void Aura::Depop(bool skip_strip) p_depop = true; } -void Mob::MakeAura(uint16 spell_id) +void Mob::MakeAura(int32 spell_id) { // TODO: verify room in AuraMgr if (!IsValidSpell(spell_id)) { @@ -944,7 +944,7 @@ void Mob::MakeAura(uint16 spell_id) } } -bool ZoneDatabase::GetAuraEntry(uint16 spell_id, AuraRecord& r) +bool ZoneDatabase::GetAuraEntry(int32 spell_id, AuraRecord& r) { const auto& l = AurasRepository::GetWhere( *this, diff --git a/zone/beacon.cpp b/zone/beacon.cpp index 8968f3396..a1f7a8cd4 100644 --- a/zone/beacon.cpp +++ b/zone/beacon.cpp @@ -148,7 +148,7 @@ bool Beacon::Process() return true; } -void Beacon::AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 in_resist_adjust) +void Beacon::AELocationSpell(Mob *caster, int32 cast_spell_id, int16 in_resist_adjust) { if (!IsValidSpell(cast_spell_id) || !caster) { return; diff --git a/zone/beacon.h b/zone/beacon.h index 1adaab60e..513b1d3d1 100644 --- a/zone/beacon.h +++ b/zone/beacon.h @@ -32,8 +32,8 @@ public: ~Beacon(); //abstract virtual function implementations requird by base abstract class - virtual bool Death(Mob* killer_mob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false) { return true; } - virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; } + virtual bool Death(Mob* killer_mob, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false) { return true; } + virtual void Damage(Mob* from, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; } virtual bool HasRaid() { return false; } virtual bool HasGroup() { return false; } virtual Raid* GetRaid() { return 0; } @@ -44,13 +44,13 @@ public: bool IsBeacon() const { return true; } bool Process(); virtual void Depop(bool not_used = true) { remove_me = true; } - void AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 in_resist_adjust); + void AELocationSpell(Mob *caster, int32 cast_spell_id, int16 in_resist_adjust); protected: Timer remove_timer; bool remove_me; - uint16 spell_id; + int32 spell_id; int16 resist_adjust; int spell_iterations; Timer spell_timer; diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 131bf0f27..51c0e1dbe 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -1851,7 +1851,7 @@ void Mob::CalcSpellBonuses(StatBonuses* newbon) newbon->ManaRegen = 0; // Bards do not get mana regen from spells. } -void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *new_bonus, uint16 casterId, +void Mob::ApplySpellsBonuses(int32 spell_id, uint8 casterlevel, StatBonuses *new_bonus, uint16 casterId, uint8 WornType, int32 ticsremaining, int buffslot, int instrument_mod, bool IsAISpellEffect, uint16 effect_id, int32 se_base, int32 se_limit, int32 se_max) { @@ -4108,7 +4108,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) { return changed; } -uint8 Mob::IsFocusEffect(uint16 spell_id,int effect_index, bool AA,uint32 aa_effect) +uint8 Mob::IsFocusEffect(int32 spell_id,int effect_index, bool AA,uint32 aa_effect) { uint16 effect = 0; @@ -4212,7 +4212,7 @@ uint8 Mob::IsFocusEffect(uint16 spell_id,int effect_index, bool AA,uint32 aa_eff return 0; } -void Mob::NegateSpellEffectBonuses(uint16 spell_id) +void Mob::NegateSpellEffectBonuses(int32 spell_id) { if (!IsValidSpell(spell_id)) return; diff --git a/zone/bot.cpp b/zone/bot.cpp index f48f4a175..40c4801af 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -509,7 +509,7 @@ void Bot::SetBotID(uint32 botID) { npctype_id = botID; } -void Bot::SetBotSpellID(uint32 newSpellID) { +void Bot::SetBotSpellID(int32 newSpellID) { npc_spells_id = newSpellID; } @@ -1542,7 +1542,7 @@ bool Bot::LoadPet() if (!pet_index) return true; - uint32 saved_pet_spell_id = 0; + int32 saved_pet_spell_id = 0; database.botdb.LoadPetSpellID(GetBotID(), saved_pet_spell_id); if (!IsValidSpell(saved_pet_spell_id)) { @@ -1554,7 +1554,7 @@ bool Bot::LoadPet() std::string pet_name; uint32 pet_mana = 0; uint32 pet_hp = 0; - uint32 pet_spell_id = 0; + int32 pet_spell_id = 0; if (!database.botdb.LoadPetStats(GetBotID(), pet_name, pet_mana, pet_hp, pet_spell_id)) { return false; @@ -2321,7 +2321,7 @@ void Bot::AI_Process() } if (!at_combat_range && RuleB(Bots, UseSpellPulling)) { - uint16 pull_spell_id = RuleI(Bots, PullSpellID); + int32 pull_spell_id = RuleI(Bots, PullSpellID); if (IsValidSpell(pull_spell_id) && tar_distance <= spells[pull_spell_id].range) { at_combat_range = true; @@ -2363,7 +2363,7 @@ void Bot::AI_Process() } if (RuleB(Bots, UseSpellPulling)) { - uint16 pull_spell_id = RuleI(Bots, PullSpellID); + int32 pull_spell_id = RuleI(Bots, PullSpellID); if (IsValidSpell(pull_spell_id) && tar_distance <= spells[pull_spell_id].range) { StopMoving(CalculateHeadingToTarget(tar->GetX(), tar->GetY())); @@ -4920,7 +4920,7 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client* } } -bool Bot::Death(Mob *killer_mob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by, bool is_buff_tic) +bool Bot::Death(Mob *killer_mob, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by, bool is_buff_tic) { if (!NPC::Death(killer_mob, damage, spell_id, attack_skill)) { return false; @@ -4966,7 +4966,7 @@ bool Bot::Death(Mob *killer_mob, int64 damage, uint16 spell_id, EQ::skills::Skil return true; } -void Bot::Damage(Mob *from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) { +void Bot::Damage(Mob *from, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) { if (!from) { return; } @@ -5598,7 +5598,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { classattack_timer.Start(reuse / HasteModifier); } -void Bot::MakePet(uint16 spell_id, const char* pettype, const char *petname) { +void Bot::MakePet(int32 spell_id, const char* pettype, const char *petname) { Mob::MakePet(spell_id, pettype, petname); } @@ -5800,7 +5800,7 @@ void Bot::SetAttackTimer() { } } -int32 Bot::GetActSpellDuration(uint16 spell_id, int32 duration) { +int32 Bot::GetActSpellDuration(int32 spell_id, int32 duration) { int increase = 100; increase += GetFocusEffect(focusSpellDuration, spell_id); int64 tic_inc = 0; @@ -5832,7 +5832,7 @@ int32 Bot::GetActSpellDuration(uint16 spell_id, int32 duration) { return (((duration * increase) / 100) + tic_inc); } -float Bot::GetAOERange(uint16 spell_id) { +float Bot::GetAOERange(int32 spell_id) { float range; range = spells[spell_id].aoe_range; if (range == 0) @@ -5849,7 +5849,7 @@ float Bot::GetAOERange(uint16 spell_id) { return range; } -bool Bot::SpellEffect(Mob* caster, uint16 spell_id, float partial) { +bool Bot::SpellEffect(Mob* caster, int32 spell_id, float partial) { bool Result = false; Result = Mob::SpellEffect(caster, spell_id, partial); if (IsGrouped()) { @@ -5871,7 +5871,7 @@ void Bot::DoBuffTic(const Buffs_Struct &buff, int slot, Mob* caster) { } bool Bot::CastSpell( - uint16 spell_id, + int32 spell_id, uint16 target_id, EQ::spells::CastingSlot slot, int32 cast_time, @@ -5951,7 +5951,7 @@ bool Bot::CastSpell( } bool Bot::SpellOnTarget( - uint16 spell_id, + int32 spell_id, Mob *spelltar, int reflect_effectiveness, bool use_resist_adjust, @@ -5988,7 +5988,7 @@ bool Bot::SpellOnTarget( return false; } -bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { +bool Bot::IsImmuneToSpell(int32 spell_id, Mob *caster) { bool Result = false; if (!caster) return false; @@ -6018,7 +6018,7 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { return Result; } -bool Bot::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction, EQ::spells::CastingSlot slot) { +bool Bot::DetermineSpellTargets(int32 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction, EQ::spells::CastingSlot slot) { bool Result = false; SpellTargetType target_type = spells[spell_id].target_type; @@ -6034,7 +6034,7 @@ bool Bot::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce return Result; } -bool Bot::DoCastSpell(uint16 spell_id, uint16 target_id, EQ::spells::CastingSlot slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 aa_id) { +bool Bot::DoCastSpell(int32 spell_id, uint16 target_id, EQ::spells::CastingSlot slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 aa_id) { bool Result = false; if (GetClass() == Class::Bard) cast_time = 0; @@ -6158,7 +6158,7 @@ void Bot::GenerateSpecialAttacks() { SetSpecialAbility(SpecialAbility::TripleAttack, 1); } -bool Bot::DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool& stopLogic) { +bool Bot::DoFinishedSpellSingleTarget(int32 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool& stopLogic) { if ( spellTarget && @@ -6252,7 +6252,7 @@ bool Bot::DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spe return true; } -bool Bot::DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool& stopLogic) { +bool Bot::DoFinishedSpellGroupTarget(int32 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool& stopLogic) { bool isMainGroupMGB = false; if (isMainGroupMGB && (GetClass() != Class::Bard)) { @@ -7688,7 +7688,7 @@ void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) { return; } -uint8 Bot::GetNumberNeedingHealedInGroup(Mob* tar, uint16 spell_type, uint16 spell_id, float range) { +uint8 Bot::GetNumberNeedingHealedInGroup(Mob* tar, uint16 spell_type, int32 spell_id, float range) { if (!TargetValidation(tar)) { return 0; } @@ -7871,7 +7871,7 @@ bool Bot::GetNeedsHateRedux(Mob *tar) { return false; } -bool Bot::HasOrMayGetAggro(bool sit_aggro, uint32 spell_id) { +bool Bot::HasOrMayGetAggro(bool sit_aggro, int32 spell_id) { if ( !GetTarget() || !GetTarget()->GetHateTop() @@ -7950,7 +7950,7 @@ void Bot::RaidGroupSay(const char* msg, ...) { } } -bool Bot::UseDiscipline(uint32 spell_id, uint32 target) { +bool Bot::UseDiscipline(int32 spell_id, uint32 target) { if (!IsValidSpell(spell_id)) { RaidGroupSay("Not a valid spell."); return false; @@ -8270,7 +8270,7 @@ void Bot::SetBotEnforceSpellSetting(bool enforceSpellSettings) AI_AddBotSpells(GetBotSpellID()); } -bool Bot::AddBotSpellSetting(uint16 spell_id, BotSpellSetting* bs) +bool Bot::AddBotSpellSetting(int32 spell_id, BotSpellSetting* bs) { if (!IsValidSpell(spell_id) || !bs) { return false; @@ -8300,7 +8300,7 @@ bool Bot::AddBotSpellSetting(uint16 spell_id, BotSpellSetting* bs) return true; } -bool Bot::DeleteBotSpellSetting(uint16 spell_id) +bool Bot::DeleteBotSpellSetting(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; @@ -8323,7 +8323,7 @@ bool Bot::DeleteBotSpellSetting(uint16 spell_id) return true; } -BotSpellSetting* Bot::GetBotSpellSetting(uint16 spell_id) +BotSpellSetting* Bot::GetBotSpellSetting(int32 spell_id) { if (!IsValidSpell(spell_id) || !bot_spell_settings.count(spell_id)) { return nullptr; @@ -8464,7 +8464,7 @@ void Bot::LoadBotSpellSettings() } } -bool Bot::UpdateBotSpellSetting(uint16 spell_id, BotSpellSetting* bs) +bool Bot::UpdateBotSpellSetting(int32 spell_id, BotSpellSetting* bs) { if (!IsValidSpell(spell_id) || !bs) { return false; @@ -8669,7 +8669,7 @@ int32 Bot::GetRawItemAC() return Total; } -void Bot::SendSpellAnim(uint16 target_id, uint16 spell_id) +void Bot::SendSpellAnim(uint16 target_id, int32 spell_id) { if (!target_id || !IsValidSpell(spell_id)) { return; @@ -8866,7 +8866,7 @@ void Bot::AddBotStartingItems(uint16 race_id, uint8 class_id) } } -void Bot::SetSpellRecastTimer(uint16 spell_id, int32 recast_delay) { +void Bot::SetSpellRecastTimer(int32 spell_id, int32 recast_delay) { if (!IsValidSpell(spell_id)) { OwnerMessage("Failed to set spell recast timer."); return; @@ -8911,7 +8911,7 @@ void Bot::SetSpellRecastTimer(uint16 spell_id, int32 recast_delay) { } } -uint32 Bot::GetSpellRecastTimer(uint16 spell_id) +uint32 Bot::GetSpellRecastTimer(int32 spell_id) { uint32 result = 0; @@ -8944,7 +8944,7 @@ uint32 Bot::GetSpellRecastTimer(uint16 spell_id) return result; } -uint32 Bot::GetSpellRecastRemainingTime(uint16 spell_id) +uint32 Bot::GetSpellRecastRemainingTime(int32 spell_id) { uint32 result = 0; @@ -8955,7 +8955,7 @@ uint32 Bot::GetSpellRecastRemainingTime(uint16 spell_id) return result; } -bool Bot::CheckSpellRecastTimer(uint16 spell_id) +bool Bot::CheckSpellRecastTimer(int32 spell_id) { ClearExpiredTimers(); @@ -8971,7 +8971,7 @@ bool Bot::CheckSpellRecastTimer(uint16 spell_id) return false; } -void Bot::SetDisciplineReuseTimer(uint16 spell_id, int32 reuse_timer) +void Bot::SetDisciplineReuseTimer(int32 spell_id, int32 reuse_timer) { if (!IsValidSpell(spell_id)) { OwnerMessage("Failed to set discipline reuse timer."); @@ -9017,7 +9017,7 @@ void Bot::SetDisciplineReuseTimer(uint16 spell_id, int32 reuse_timer) } } -uint32 Bot::GetDisciplineReuseTimer(uint16 spell_id) +uint32 Bot::GetDisciplineReuseTimer(int32 spell_id) { uint32 result = 0; @@ -9045,7 +9045,7 @@ uint32 Bot::GetDisciplineReuseTimer(uint16 spell_id) return result; } -uint32 Bot::GetDisciplineReuseRemainingTime(uint16 spell_id) { +uint32 Bot::GetDisciplineReuseRemainingTime(int32 spell_id) { uint32 result = 0; if (GetDisciplineReuseTimer(spell_id) > Timer::GetCurrentTime()) { @@ -9055,7 +9055,7 @@ uint32 Bot::GetDisciplineReuseRemainingTime(uint16 spell_id) { return result; } -bool Bot::CheckDisciplineReuseTimer(uint16 spell_id) +bool Bot::CheckDisciplineReuseTimer(int32 spell_id) { ClearExpiredTimers(); @@ -9189,7 +9189,7 @@ uint32 Bot::GetItemReuseRemainingTime(uint32 item_id) return result; } -uint32 Bot::CalcSpellRecastTimer(uint16 spell_id) +uint32 Bot::CalcSpellRecastTimer(int32 spell_id) { uint32 result = 0; @@ -9206,7 +9206,7 @@ uint32 Bot::CalcSpellRecastTimer(uint16 spell_id) return result; } -void Bot::ClearDisciplineReuseTimer(uint16 spell_id) +void Bot::ClearDisciplineReuseTimer(int32 spell_id) { if (spell_id && !IsValidSpell(spell_id)) { OwnerMessage( @@ -9283,7 +9283,7 @@ void Bot::ClearItemReuseTimer(uint32 item_id) ClearExpiredTimers(); } -void Bot::ClearSpellRecastTimer(uint16 spell_id) +void Bot::ClearSpellRecastTimer(int32 spell_id) { if (spell_id && !IsValidSpell(spell_id)) { OwnerMessage( @@ -9546,7 +9546,7 @@ bool Bot::PrecastChecks(Mob* tar, uint16 spell_type) { return true; } -bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool prechecks, bool ae_check) { +bool Bot::CastChecks(int32 spell_id, Mob* tar, uint16 spell_type, bool prechecks, bool ae_check) { if (prechecks) { if (!tar || tar->GetAppearance() == eaDead || tar->GetHP() < 0) { LogBotSpellChecksDetail("{} says, 'Cancelling cast due to CastChecks !tar.'", GetCleanName()); @@ -9866,7 +9866,7 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool precheck return true; } -bool Bot::CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar) { +bool Bot::CanCastSpellType(uint16 spell_type, int32 spell_id, Mob* tar) { if (!spell_id || !tar) { LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to failsafe checks.'", GetCleanName(), (spell_id ? GetSpellName(spell_id) : (spell_type ? GetSpellTypeNameByID(spell_type) : "Unknown")), (tar ? tar->GetCleanName() : "Unknown")); return false; @@ -10081,7 +10081,7 @@ bool Bot::CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar) { return true; } -bool Bot::BotHasEnoughMana(uint16 spell_id) { +bool Bot::BotHasEnoughMana(int32 spell_id) { if (!IsValidSpell(spell_id)) { return false; } @@ -10095,7 +10095,7 @@ bool Bot::BotHasEnoughMana(uint16 spell_id) { return true; } -bool Bot::IsTargetAlreadyReceivingSpell(Mob* tar, uint16 spell_id) { +bool Bot::IsTargetAlreadyReceivingSpell(Mob* tar, int32 spell_id) { if (!tar || !spell_id) { return true; } @@ -10126,7 +10126,7 @@ bool Bot::IsTargetAlreadyReceivingSpell(Mob* tar, uint16 spell_id) { return false; } -bool Bot::DoResistCheck(Mob* tar, uint16 spell_id, int32 resist_limit) { +bool Bot::DoResistCheck(Mob* tar, int32 spell_id, int32 resist_limit) { if (!tar || spell_id == 0) { return false; @@ -10173,7 +10173,7 @@ bool Bot::DoResistCheck(Mob* tar, uint16 spell_id, int32 resist_limit) { return true; } -bool Bot::DoResistCheckBySpellType(Mob* tar, uint16 spell_id, uint16 spell_type) { +bool Bot::DoResistCheckBySpellType(Mob* tar, int32 spell_id, uint16 spell_type) { if (!tar || !IsValidSpell(spell_id)) { return false; } @@ -10185,7 +10185,7 @@ bool Bot::DoResistCheckBySpellType(Mob* tar, uint16 spell_id, uint16 spell_type) return DoResistCheck(tar, spell_id, GetSpellTypeResistLimit(spell_type)); } -bool Bot::IsValidTargetType(uint16 spell_id, int target_type, uint8 body_type) { +bool Bot::IsValidTargetType(int32 spell_id, int target_type, uint8 body_type) { if (!spell_id) { return false; } @@ -10294,7 +10294,7 @@ bool Bot::IsMobEngagedByAnyone(Mob* tar) { return false; } -bool Bot::IsValidMezTarget(Mob* owner, Mob* npc, uint16 spell_id) { +bool Bot::IsValidMezTarget(Mob* owner, Mob* npc, int32 spell_id) { if (npc->GetSpecialAbility(SpecialAbility::MesmerizeImmunity)) { return false; } @@ -11326,7 +11326,7 @@ bool Bot::AttemptAICastSpell(uint16 spell_type, Mob* tar) { return result; } -bool Bot::AttemptAACastSpell(Mob* tar, uint16 spell_id, AA::Rank* rank) { +bool Bot::AttemptAACastSpell(Mob* tar, int32 spell_id, AA::Rank* rank) { if (!IsValidSpell(spell_id)) { return false; } @@ -11431,7 +11431,7 @@ bool Bot::AttemptAACastSpell(Mob* tar, uint16 spell_id, AA::Rank* rank) { return true; } -bool Bot::AttemptForcedCastSpell(Mob* tar, uint16 spell_id, bool is_disc) { +bool Bot::AttemptForcedCastSpell(Mob* tar, int32 spell_id, bool is_disc) { if (!IsValidSpell(spell_id)) { return false; } @@ -11636,7 +11636,7 @@ bool Bot::IsValidBotSpellType(uint16 spell_type) { ); } -bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id) { +bool Bot::IsValidSpellTypeBySpellID(uint16 spell_type, int32 spell_id) { if (IsAEBotSpellType(spell_type) && !IsAnyAESpell(spell_id)) { return false; } @@ -12249,7 +12249,7 @@ bool Bot::HasRequiredLoSForPositioning(Mob* tar) { return true; } -bool Bot::HasValidAETarget(Bot* caster, uint16 spell_id, uint16 spell_type, Mob* tar) { +bool Bot::HasValidAETarget(Bot* caster, int32 spell_id, uint16 spell_type, Mob* tar) { int spell_range = caster->GetActSpellRange(spell_id, spells[spell_id].range); int spell_ae_range = caster->GetAOERange(spell_id); int target_count = 0; @@ -12474,7 +12474,7 @@ bool Bot::ValidStateCheck(Mob* other, bool same_raid_group) { return true; } -bool Bot::IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, uint16 spell_id) { +bool Bot::IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, int32 spell_id) { if (sub_type == UINT16_MAX) { return true; } @@ -12586,8 +12586,8 @@ bool Bot::IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, uint16 spe return false; } -uint16 Bot::GetSpellByAA(int id, AA::Rank*& rank) { - uint16 spell_id = 0; +int32 Bot::GetSpellByAA(int id, AA::Rank*& rank) { + int32 spell_id = 0; std::pair aa_ability = std::make_pair(nullptr, nullptr); AA::Ability* ability = zone->GetAlternateAdvancementAbility(id); @@ -12612,7 +12612,7 @@ uint16 Bot::GetSpellByAA(int id, AA::Rank*& rank) { return spell_id; } -void Bot::SetBotBlockedBuff(uint16 spell_id, bool block) +void Bot::SetBotBlockedBuff(int32 spell_id, bool block) { if (!IsValidSpell(spell_id)) { OwnerMessage("Failed to set blocked buff."); @@ -12659,7 +12659,7 @@ bool Bot::IsBlockedBuff(int32 spell_id) return result; } -void Bot::SetBotBlockedPetBuff(uint16 spell_id, bool block) +void Bot::SetBotBlockedPetBuff(int32 spell_id, bool block) { if (!IsValidSpell(spell_id)) { OwnerMessage("Failed to set blocked pet buff."); @@ -13319,7 +13319,7 @@ uint8 Bot::GetUltimateSpellTypeMaxThreshold(uint16 spell_type, Mob* tar) { return GetSpellTypeMaxThreshold(spell_type); } -bool Bot::IsImmuneToBotSpell(uint16 spell_id, Mob* caster) { +bool Bot::IsImmuneToBotSpell(int32 spell_id, Mob* caster) { int effect_index; if (!caster) { diff --git a/zone/bot.h b/zone/bot.h index 9511cf9ee..6da3b3f3c 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -270,8 +270,8 @@ public: Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType *npcTypeData); //abstract virtual override function implementations requird by base abstract class - bool Death(Mob* killer_mob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false) override; - void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, + bool Death(Mob* killer_mob, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false) override; + void Damage(Mob* from, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) override; bool HasRaid() final { return GetRaid() != nullptr; } @@ -320,7 +320,7 @@ public: void DoClassAttacks(Mob *target, bool IsRiposte=false); void CalcBonuses() override; - void MakePet(uint16 spell_id, const char* pettype, const char *petname = nullptr) override; + void MakePet(int32 spell_id, const char* pettype, const char *petname = nullptr) override; FACTION_VALUE GetReverseFactionCon(Mob* iOther) override; inline bool IsPet() override { return false; } bool IsNPC() const override { return false; } @@ -331,8 +331,8 @@ public: void SetAttackTimer() override; uint64 GetClassHPFactor(); int64 CalcMaxHP() override; - bool DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool &stopLogic); - bool DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool &stopLogic); + bool DoFinishedSpellSingleTarget(int32 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool &stopLogic); + bool DoFinishedSpellGroupTarget(int32 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool &stopLogic); void Camp(bool save_to_database = true); void SetTarget(Mob* mob) override; void Zone(); @@ -361,11 +361,11 @@ public: bool GetReturningFlag() const { return m_returning_flag; } bool GetIsUsingItemClick() { return is_using_item_click; } void SetIsUsingItemClick(bool flag = true) { is_using_item_click = flag; } - bool UseDiscipline(uint32 spell_id, uint32 target); - uint8 GetNumberNeedingHealedInGroup(Mob* tar, uint16 spell_type, uint16 spell_id, float range); + bool UseDiscipline(int32 spell_id, uint32 target); + uint8 GetNumberNeedingHealedInGroup(Mob* tar, uint16 spell_type, int32 spell_id, float range); bool GetNeedsCured(Mob *tar); bool GetNeedsHateRedux(Mob *tar); - bool HasOrMayGetAggro(bool SitAggro, uint32 spell_id = 0); + bool HasOrMayGetAggro(bool SitAggro, int32 spell_id = 0); void SetDefaultBotStance(); void SetSurname(std::string_view bot_surname); void SetTitle(std::string_view bot_title); @@ -428,10 +428,10 @@ public: EQ::ItemInstance* GetClickItem(uint16 slot_id); void DoItemClick(const EQ::ItemData* inst, uint16 slot_id); - bool AI_AddBotSpells(uint32 bot_spell_id); + bool AI_AddBotSpells(int32 bot_spell_id); void AddSpellToBotList( int16 iPriority, - uint16 iSpellID, + int32 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, @@ -447,7 +447,7 @@ public: void AddSpellToBotEnforceList( int16 iPriority, - uint16 iSpellID, + int32 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, @@ -466,8 +466,8 @@ public: // AI Methods bool AICastSpell(Mob* tar, uint8 chance, uint16 spell_type, uint16 sub_target_type = UINT16_MAX, uint16 sub_type = UINT16_MAX); bool AttemptAICastSpell(uint16 spell_type, Mob* tar = nullptr); - bool AttemptAACastSpell(Mob* tar, uint16 spell_id, AA::Rank* rank); - bool AttemptForcedCastSpell(Mob* tar, uint16 spell_id, bool is_disc = false); + bool AttemptAACastSpell(Mob* tar, int32 spell_id, AA::Rank* rank); + bool AttemptForcedCastSpell(Mob* tar, int32 spell_id, bool is_disc = false); bool AttemptCloseBeneficialSpells(uint16 spell_type); bool AI_EngagedCastCheck() override; bool AI_PursueCastCheck() override; @@ -483,7 +483,7 @@ public: void SetGuardMode(); void SetHoldMode(); - bool IsValidSpellRange(uint16 spell_id, Mob* tar); + bool IsValidSpellRange(int32 spell_id, Mob* tar); // Bot AI Methods void AI_Bot_Init(); @@ -495,14 +495,14 @@ public: // Mob Spell Virtual Override Methods void SpellProcess() override; - int32 GetActSpellDuration(uint16 spell_id, int32 duration) override; - float GetAOERange(uint16 spell_id) override; - virtual bool SpellEffect(Mob* caster, uint16 spell_id, float partial = 100); + int32 GetActSpellDuration(int32 spell_id, int32 duration) override; + float GetAOERange(int32 spell_id) override; + virtual bool SpellEffect(Mob* caster, int32 spell_id, float partial = 100); void DoBuffTic(const Buffs_Struct &buff, int slot, Mob* caster = nullptr) override; - virtual bool CastSpell(uint16 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0, + virtual bool CastSpell(int32 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0, uint32 item_slot = 0xFFFFFFFF, int16 *resist_adjust = nullptr, uint32 aa_id = 0); bool SpellOnTarget( - uint16 spell_id, + int32 spell_id, Mob* spelltar, int reflect_effectiveness = 0, bool use_resist_adjust = false, @@ -512,11 +512,11 @@ public: int duration_override = 0, bool disable_buff_overwrite = false ) final; - bool IsImmuneToSpell(uint16 spell_id, Mob *caster) override; - virtual bool DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction, EQ::spells::CastingSlot slot); - virtual bool DoCastSpell(uint16 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, int32 mana_cost = -1, + bool IsImmuneToSpell(int32 spell_id, Mob *caster) override; + virtual bool DetermineSpellTargets(int32 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction, EQ::spells::CastingSlot slot); + virtual bool DoCastSpell(int32 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = nullptr, uint32 item_slot = 0xFFFFFFFF, uint32 aa_id = 0); - inline int64 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false) override + inline int64 GetFocusEffect(focusType type, int32 spell_id, Mob *caster = nullptr, bool from_buff_tic = false) override { return Mob::GetFocusEffect(type, spell_id, caster, from_buff_tic); } inline bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) override @@ -536,21 +536,21 @@ public: // Targeting std::vector GatherSpellTargets(bool entireRaid = false, Mob* target = nullptr, bool no_clients = false, bool no_bots = false); - bool HasValidAETarget(Bot* caster, uint16 spell_id, uint16 spell_type, Mob* tar); + bool HasValidAETarget(Bot* caster, int32 spell_id, uint16 spell_type, Mob* tar); void SetHasLoS(bool has_los) { _hasLoS = has_los; } bool HasLoS() const { return _hasLoS; } - bool IsValidMezTarget(Mob* owner, Mob* npc, uint16 spell_id); + bool IsValidMezTarget(Mob* owner, Mob* npc, int32 spell_id); // Cast checks bool PrecastChecks(Mob* tar, uint16 spell_type); - bool CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool prechecks = false, bool ae_check = false); - bool IsImmuneToBotSpell(uint16 spell_id, Mob* caster); - bool CanCastSpellType(uint16 spell_type, uint16 spell_id, Mob* tar); - bool BotHasEnoughMana(uint16 spell_id); - bool IsTargetAlreadyReceivingSpell(Mob* tar, uint16 spell_id); - bool DoResistCheck(Mob* target, uint16 spell_id, int32 resist_limit); - bool DoResistCheckBySpellType(Mob* tar, uint16 spell_id, uint16 spell_type); - bool IsValidTargetType(uint16 spell_id, int target_type, uint8 body_type); + bool CastChecks(int32 spell_id, Mob* tar, uint16 spell_type, bool prechecks = false, bool ae_check = false); + bool IsImmuneToBotSpell(int32 spell_id, Mob* caster); + bool CanCastSpellType(uint16 spell_type, int32 spell_id, Mob* tar); + bool BotHasEnoughMana(int32 spell_id); + bool IsTargetAlreadyReceivingSpell(Mob* tar, int32 spell_id); + bool DoResistCheck(Mob* target, int32 spell_id, int32 resist_limit); + bool DoResistCheckBySpellType(Mob* tar, int32 spell_id, uint16 spell_type); + bool IsValidTargetType(int32 spell_id, int target_type, uint8 body_type); // Spell checks static bool IsValidBotSpellType(uint16 spell_type); @@ -598,8 +598,8 @@ public: void ClearBotBlockedBuffs() { bot_blocked_buffs.clear(); } bool IsBlockedBuff(int32 spell_id) override; bool IsBlockedPetBuff(int32 spell_id) override; - void SetBotBlockedBuff(uint16 spell_id, bool block); - void SetBotBlockedPetBuff(uint16 spell_id, bool block); + void SetBotBlockedBuff(int32 spell_id, bool block); + void SetBotBlockedPetBuff(int32 spell_id, bool block); std::vector GetBotBlockedBuffs() { return bot_blocked_buffs; } void SetBotBlockedBuffs(std::vector blocked_buffs) { bot_blocked_buffs = blocked_buffs; } @@ -665,16 +665,16 @@ public: // Spell lists std::list GetSpellTypesPrioritized(uint8 priority_type); static uint16 GetParentSpellType(uint16 spell_type); - static bool IsValidSpellTypeBySpellID(uint16 spell_type, uint16 spell_id); + static bool IsValidSpellTypeBySpellID(uint16 spell_type, int32 spell_id); inline uint16 GetCastedSpellType() const { return _castedSpellType; } void SetCastedSpellType(uint16 spell_type); - bool IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, uint16 spell_id); + bool IsValidSpellTypeSubType(uint16 spell_type, uint16 sub_type, int32 spell_id); static bool IsValidBotSpellCategory(uint8 setting_type); static std::string GetBotSpellCategoryName(uint8 setting_type); static std::string GetBotSpellCategoryShortName(uint8 setting_type); static uint16 GetBotSpellCategoryIDByShortName(std::string setting_string); void AssignBotSpellsToTypes(std::vector& AIBot_spells, std::unordered_map>& AIBot_spells_by_type); - uint16 GetSpellByAA(int id, AA::Rank*& rank); + int32 GetSpellByAA(int id, AA::Rank*& rank); // Spell Type static uint16 GetSpellTypeIDByShortName(std::string spellType_string); @@ -745,7 +745,7 @@ public: static BotSpell GetBestBotSpellForGroupCompleteHeal(Bot* caster, Mob* tar, uint16 spell_type = BotSpellTypes::RegularHeal); static BotSpell GetBestBotSpellForGroupHeal(Bot* caster, Mob* tar, uint16 spell_type = BotSpellTypes::RegularHeal); - static Mob* GetFirstIncomingMobToMez(Bot* caster, uint16 spell_id, uint16 spell_type, bool AE); + static Mob* GetFirstIncomingMobToMez(Bot* caster, int32 spell_id, uint16 spell_type, bool AE); static BotSpell GetBestBotSpellForMez(Bot* caster, uint16 spell_type = BotSpellTypes::Mez); static BotSpell GetBestBotMagicianPetSpell(Bot* caster, uint16 spell_type = BotSpellTypes::Pet); static std::string GetBotMagicianPetType(Bot* caster); @@ -778,7 +778,7 @@ public: // "GET" Class Methods uint32 GetBotID() const { return _botID; } uint32 GetBotOwnerCharacterID() const { return _botOwnerCharacterID; } - uint32 GetBotSpellID() const { return npc_spells_id; } + int32 GetBotSpellID() const { return npc_spells_id; } Mob* GetBotOwner() { return this->_botOwner; } uint32 GetBotRangedValue(); EQ::ItemInstance* GetBotItem(uint16 slot_id); @@ -889,8 +889,8 @@ public: inline const InspectMessage_Struct& GetInspectMessage() const { return _botInspectMessage; } // "Quest API" Methods - bool HasBotSpellEntry(uint16 spell_id); - bool CanUseBotSpell(uint16 spell_id); + bool HasBotSpellEntry(int32 spell_id); + bool CanUseBotSpell(int32 spell_id); void ApplySpell(int spell_id, int duration = 0, int level = -1, ApplySpellType apply_type = ApplySpellType::Solo, bool allow_pets = false, bool is_raid_group_only = true); void BreakInvis(); void Escape(); @@ -899,11 +899,11 @@ public: int32 GetItemIDAt(int16 slot_id); int32 GetAugmentIDAt(int16 slot_id, uint8 augslot); int32 GetRawItemAC(); - void SendSpellAnim(uint16 targetid, uint16 spell_id); + void SendSpellAnim(uint16 targetid, int32 spell_id); void SetSpellDuration(int spell_id, int duration = 0, int level = -1, ApplySpellType apply_type = ApplySpellType::Solo, bool allow_pets = false, bool is_raid_group_only = true); // "SET" Class Methods - void SetBotSpellID(uint32 newSpellID); + void SetBotSpellID(int32 newSpellID); void SetSpawnStatus(bool spawnStatus) { _spawnStatus = spawnStatus; } void SetPetChooserID(uint8 id) { _petChooserID = id; } void SetBotRangedSetting(bool value) { _botRangedSetting = value; } @@ -911,21 +911,21 @@ public: void SetBotOwner(Mob* botOwner) { this->_botOwner = botOwner; } void SetRangerAutoWeaponSelect(bool enable) { GetClass() == Class::Ranger ? _rangerAutoWeaponSelect = enable : _rangerAutoWeaponSelect = false; } void SetBotStance(uint8 stance_id) { _botStance = Stance::IsValid(stance_id) ? stance_id : Stance::Passive; } - uint32 GetSpellRecastTimer(uint16 spell_id = 0); - bool CheckSpellRecastTimer(uint16 spell_id = 0); - uint32 GetSpellRecastRemainingTime(uint16 spell_id = 0); - void SetSpellRecastTimer(uint16 spell_id, int32 recast_delay = 0); - uint32 CalcSpellRecastTimer(uint16 spell_id); - uint32 GetDisciplineReuseTimer(uint16 spell_id = 0); - bool CheckDisciplineReuseTimer(uint16 spell_id = 0); - uint32 GetDisciplineReuseRemainingTime(uint16 spell_id = 0); - void SetDisciplineReuseTimer(uint16 spell_id, int32 reuse_timer = 0); + uint32 GetSpellRecastTimer(int32 spell_id = 0); + bool CheckSpellRecastTimer(int32 spell_id = 0); + uint32 GetSpellRecastRemainingTime(int32 spell_id = 0); + void SetSpellRecastTimer(int32 spell_id, int32 recast_delay = 0); + uint32 CalcSpellRecastTimer(int32 spell_id); + uint32 GetDisciplineReuseTimer(int32 spell_id = 0); + bool CheckDisciplineReuseTimer(int32 spell_id = 0); + uint32 GetDisciplineReuseRemainingTime(int32 spell_id = 0); + void SetDisciplineReuseTimer(int32 spell_id, int32 reuse_timer = 0); uint32 GetItemReuseTimer(uint32 item_id = 0); bool CheckItemReuseTimer(uint32 item_id = 0); void SetItemReuseTimer(uint32 item_id, uint32 reuse_timer = 0); - void ClearDisciplineReuseTimer(uint16 spell_id = 0); + void ClearDisciplineReuseTimer(int32 spell_id = 0); void ClearItemReuseTimer(uint32 item_id = 0); - void ClearSpellRecastTimer(uint16 spell_id = 0); + void ClearSpellRecastTimer(int32 spell_id = 0); uint32 GetItemReuseRemainingTime(uint32 item_id = 0); void ClearExpiredTimers(); void SetBeardColor(uint8 value) { beardcolor = value; } @@ -947,12 +947,12 @@ public: std::string GetHPString(int8 min_hp, int8 max_hp); - bool AddBotSpellSetting(uint16 spell_id, BotSpellSetting* bs); - bool DeleteBotSpellSetting(uint16 spell_id); - BotSpellSetting* GetBotSpellSetting(uint16 spell_id); + bool AddBotSpellSetting(int32 spell_id, BotSpellSetting* bs); + bool DeleteBotSpellSetting(int32 spell_id); + BotSpellSetting* GetBotSpellSetting(int32 spell_id); void ListBotSpellSettings(); void LoadBotSpellSettings(); - bool UpdateBotSpellSetting(uint16 spell_id, BotSpellSetting* bs); + bool UpdateBotSpellSetting(int32 spell_id, BotSpellSetting* bs); void SetBotEnforceSpellSetting(bool enforceSpellSettings); bool GetBotEnforceSpellSetting() { return _enforceSpellSettings; } @@ -1257,4 +1257,4 @@ private: int32 CalcItemATKCap() final; }; -bool IsSpellInBotList(DBbotspells_Struct* spell_list, uint16 spell_id); +bool IsSpellInBotList(DBbotspells_Struct* spell_list, int32 spell_id); diff --git a/zone/bot_commands/bot_blocked_buffs.cpp b/zone/bot_commands/bot_blocked_buffs.cpp index 14195cb40..9d63b4e94 100644 --- a/zone/bot_commands/bot_blocked_buffs.cpp +++ b/zone/bot_commands/bot_blocked_buffs.cpp @@ -87,7 +87,7 @@ void bot_command_blocked_buffs(Client* c, const Seperator* sep) bool remove = false; bool list = false; bool wipe = false; - uint16 spell_id; + int32 spell_id; if (!arg1.compare("add")) { if (!sep->IsNumber(2) || !IsValidSpell(atoi(sep->arg[2])) || !IsBeneficialSpell(atoi(sep->arg[2]))) { @@ -325,7 +325,7 @@ void bot_command_blocked_pet_buffs(Client* c, const Seperator* sep) bool remove = false; bool list = false; bool wipe = false; - uint16 spell_id; + int32 spell_id; if (!arg1.compare("add")) { if (!sep->IsNumber(2) || !IsValidSpell(atoi(sep->arg[2])) || !IsBeneficialSpell(atoi(sep->arg[2]))) { diff --git a/zone/bot_commands/bot_cast.cpp b/zone/bot_commands/bot_cast.cpp index 0f9e954dc..669755c6f 100644 --- a/zone/bot_commands/bot_cast.cpp +++ b/zone/bot_commands/bot_cast.cpp @@ -177,7 +177,7 @@ void bot_command_cast(Client* c, const Seperator* sep) bool aa_type = false; int aa_id = 0; bool by_spell_id = false; - uint16 chosen_spell_id = UINT16_MAX; + int32 chosen_spell_id = -1; if (!arg1.compare("aa") || !arg1.compare("harmtouch") || !arg1.compare("layonhands")) { if (!RuleB(Bots, AllowCastAAs)) { @@ -536,7 +536,7 @@ void bot_command_cast(Client* c, const Seperator* sep) AA::Rank* temp_rank = nullptr; AA::Rank*& rank = temp_rank; - uint16 spell_id = bot_iter->GetSpellByAA(aa_id, rank); + int32 spell_id = bot_iter->GetSpellByAA(aa_id, rank); if (!IsValidSpell(spell_id)) { continue; diff --git a/zone/bot_commands/bot_discipline.cpp b/zone/bot_commands/bot_discipline.cpp index a726c4a5c..3a093694f 100644 --- a/zone/bot_commands/bot_discipline.cpp +++ b/zone/bot_commands/bot_discipline.cpp @@ -85,7 +85,7 @@ void bot_command_discipline(Client* c, const Seperator* sep) bool aggressive = false; bool defensive = false; Mob* tar = c->GetTarget(); - uint16 spell_id = UINT16_MAX; + int32 spell_id = -1; if (!arg1.compare("aggressive")) { aggressive = true; diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index a8f1952cb..287eae502 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -1252,7 +1252,7 @@ bool BotDatabase::LoadPetIndex(const uint32 bot_id, uint32& pet_index) return true; } -bool BotDatabase::LoadPetSpellID(const uint32 bot_id, uint32& pet_spell_id) +bool BotDatabase::LoadPetSpellID(const uint32 bot_id, int32& pet_spell_id) { if (!bot_id) { return false; @@ -1277,7 +1277,7 @@ bool BotDatabase::LoadPetSpellID(const uint32 bot_id, uint32& pet_spell_id) return true; } -bool BotDatabase::LoadPetStats(const uint32 bot_id, std::string& pet_name, uint32& pet_mana, uint32& pet_hp, uint32& pet_spell_id) +bool BotDatabase::LoadPetStats(const uint32 bot_id, std::string& pet_name, uint32& pet_mana, uint32& pet_hp, int32& pet_spell_id) { if (!bot_id) { return false; @@ -1315,7 +1315,7 @@ bool BotDatabase::LoadPetStats(const uint32 bot_id, std::string& pet_name, uint3 return true; } -bool BotDatabase::SavePetStats(const uint32 bot_id, const std::string& pet_name, const uint32 pet_mana, const uint32 pet_hp, const uint32 pet_spell_id) +bool BotDatabase::SavePetStats(const uint32 bot_id, const std::string& pet_name, const uint32 pet_mana, const uint32 pet_hp, const int32 pet_spell_id) { if (!bot_id || pet_name.empty() || !pet_spell_id || pet_spell_id > SPDAT_RECORDS) { return false; @@ -2572,7 +2572,7 @@ bool BotDatabase::DeleteBotBlockedBuffs(const uint32 bot_id) void BotDatabase::CheckBotSpells() { auto spell_list = BotSpellsEntriesRepository::All(content_db); - uint16 spell_id; + int32 spell_id; SPDat_Spell_Struct spell; for (const auto& s : spell_list) { diff --git a/zone/bot_database.h b/zone/bot_database.h index 8fb2aa1d2..9f5cd95c9 100644 --- a/zone/bot_database.h +++ b/zone/bot_database.h @@ -90,10 +90,10 @@ public: /* Bot pet functions */ bool LoadPetIndex(const uint32 bot_id, uint32& pet_index); - bool LoadPetSpellID(const uint32 bot_id, uint32& pet_spell_id); + bool LoadPetSpellID(const uint32 bot_id, int32& pet_spell_id); - bool LoadPetStats(const uint32 bot_id, std::string& pet_name, uint32& pet_mana, uint32& pet_hp, uint32& pet_spell_id); - bool SavePetStats(const uint32 bot_id, const std::string& pet_name, const uint32 pet_mana, const uint32 pet_hp, const uint32 pet_spell_id); + bool LoadPetStats(const uint32 bot_id, std::string& pet_name, uint32& pet_mana, uint32& pet_hp, int32& pet_spell_id); + bool SavePetStats(const uint32 bot_id, const std::string& pet_name, const uint32 pet_mana, const uint32 pet_hp, const int32 pet_spell_id); bool DeletePetStats(const uint32 bot_id); bool LoadPetBuffs(const uint32 bot_id, SpellBuff_Struct* pet_buffs); diff --git a/zone/bot_structs.h b/zone/bot_structs.h index 8805622cb..62165a6ac 100644 --- a/zone/bot_structs.h +++ b/zone/bot_structs.h @@ -33,7 +33,7 @@ struct BotsAvailableList { }; struct BotSpell { - uint16 SpellId; + int32 SpellId; int SpellIndex; int16 ManaCost; }; @@ -64,7 +64,7 @@ struct BotSpellSetting { struct BotSpells { uint32 type; // 0 = never, must be one (and only one) of the defined values - uint16 spellid; // <= 0 = no spell + int32 spellid; // <= 0 = no spell int16 manacost; // -1 = use spdat, -2 = no cast time uint32 time_cancast; // when we can cast this spell next int32 recast_delay; @@ -82,7 +82,7 @@ struct BotSpells { struct BotSpells_wIndex { uint32 index; //index of AIBot_spells uint32 type; // 0 = never, must be one (and only one) of the defined values - uint16 spellid; // <= 0 = no spell + int32 spellid; // <= 0 = no spell int16 manacost; // -1 = use spdat, -2 = no cast time uint32 time_cancast; // when we can cast this spell next int32 recast_delay; @@ -103,7 +103,7 @@ struct BotTimer { uint32 recast_time; bool is_spell; bool is_disc; - uint16 spell_id; + int32 spell_id; bool is_item; uint32 item_id; }; @@ -138,7 +138,7 @@ struct BotSpellTypeOrder { struct BotBlockedBuffs { uint32_t bot_id; - uint32_t spell_id; + int32_t spell_id; uint8_t blocked; uint8_t blocked_pet; }; diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index c666a33f6..06cd76e7b 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -1335,7 +1335,7 @@ BotSpell Bot::GetBestBotSpellForGroupHeal(Bot* caster, Mob* tar, uint16 spell_ty for (std::list::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { if (IsRegularGroupHealSpell(bot_spell_list_itr->SpellId)) { - uint16 spell_id = bot_spell_list_itr->SpellId; + int32 spell_id = bot_spell_list_itr->SpellId; if (caster->TargetValidation(tar) && !caster->IsCommandedSpell() && caster->IsValidSpellRange(spell_id, tar)) { target_count = caster->GetNumberNeedingHealedInGroup(tar, spell_type, spell_id, caster->GetAOERange(spell_id)); @@ -1373,7 +1373,7 @@ BotSpell Bot::GetBestBotSpellForGroupHealOverTime(Bot* caster, Mob* tar, uint16 for (std::list::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { if (IsGroupHealOverTimeSpell(bot_spell_list_itr->SpellId)) { - uint16 spell_id = bot_spell_list_itr->SpellId; + int32 spell_id = bot_spell_list_itr->SpellId; if (caster->TargetValidation(tar) && !caster->IsCommandedSpell() && caster->IsValidSpellRange(spell_id, tar)) { target_count = caster->GetNumberNeedingHealedInGroup(tar, spell_type, spell_id, caster->GetAOERange(spell_id)); @@ -1411,7 +1411,7 @@ BotSpell Bot::GetBestBotSpellForGroupCompleteHeal(Bot* caster, Mob* tar, uint16 for (std::list::iterator bot_spell_list_itr = bot_spell_list.begin(); bot_spell_list_itr != bot_spell_list.end(); ++bot_spell_list_itr) { if (IsGroupCompleteHealSpell(bot_spell_list_itr->SpellId)) { - uint16 spell_id = bot_spell_list_itr->SpellId; + int32 spell_id = bot_spell_list_itr->SpellId; if (caster->TargetValidation(tar) && !caster->IsCommandedSpell() && caster->IsValidSpellRange(spell_id, tar)) { target_count = caster->GetNumberNeedingHealedInGroup(tar, spell_type, spell_id, caster->GetAOERange(spell_id)); @@ -1459,7 +1459,7 @@ BotSpell Bot::GetBestBotSpellForMez(Bot* caster, uint16 spell_type) { return result; } -Mob* Bot::GetFirstIncomingMobToMez(Bot* caster, uint16 spell_id, uint16 spell_type, bool AE) { +Mob* Bot::GetFirstIncomingMobToMez(Bot* caster, int32 spell_id, uint16 spell_type, bool AE) { Mob* result = nullptr; if (caster && caster->GetOwner()) { @@ -2184,7 +2184,7 @@ uint8 Bot::GetChanceToCastBySpellType(uint16 spell_type) return RuleI(Bots, PercentChanceToCastOtherType); } -bool Bot::AI_AddBotSpells(uint32 bot_spell_id) { +bool Bot::AI_AddBotSpells(int32 bot_spell_id) { // ok, this function should load the list, and the parent list then shove them into the struct and sort npc_spells_id = bot_spell_id; AIBot_spells.clear(); @@ -2486,7 +2486,7 @@ bool Bot::AI_AddBotSpells(uint32 bot_spell_id) { return true; } -bool IsSpellInBotList(DBbotspells_Struct* spell_list, uint16 iSpellID) { +bool IsSpellInBotList(DBbotspells_Struct* spell_list, int32 iSpellID) { auto it = std::find_if ( spell_list->entries.begin(), spell_list->entries.end(), @@ -2498,7 +2498,7 @@ bool IsSpellInBotList(DBbotspells_Struct* spell_list, uint16 iSpellID) { return it != spell_list->entries.end(); } -DBbotspells_Struct* ZoneDatabase::GetBotSpells(uint32 bot_spell_id) +DBbotspells_Struct* ZoneDatabase::GetBotSpells(int32 bot_spell_id) { if (!bot_spell_id) { return nullptr; @@ -2591,7 +2591,7 @@ DBbotspells_Struct* ZoneDatabase::GetBotSpells(uint32 bot_spell_id) // adds a spell to the list, taking into account priority and resorting list as needed. void Bot::AddSpellToBotList( int16 in_priority, - uint16 in_spell_id, + int32 in_spell_id, uint32 in_type, int16 in_mana_cost, int32 in_recast_delay, @@ -2637,7 +2637,7 @@ void Bot::AddSpellToBotList( // adds spells to the list ^spells that are returned if ^enforce is enabled void Bot::AddSpellToBotEnforceList( int16 iPriority, - uint16 iSpellID, + int32 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, @@ -2703,7 +2703,7 @@ void Bot::AI_Bot_Event_SpellCastFinished(bool iCastSucceeded, uint16 slot) { } } -bool Bot::HasBotSpellEntry(uint16 spell_id) { +bool Bot::HasBotSpellEntry(int32 spell_id) { auto* spell_list = content_db.GetBotSpells(GetBotSpellID()); if (!spell_list) { @@ -2720,7 +2720,7 @@ bool Bot::HasBotSpellEntry(uint16 spell_id) { return false; } -bool Bot::CanUseBotSpell(uint16 spell_id) { +bool Bot::CanUseBotSpell(int32 spell_id) { if (AIBot_spells.empty()) { return false; } @@ -2744,7 +2744,7 @@ bool Bot::CanUseBotSpell(uint16 spell_id) { return false; } -bool Bot::IsValidSpellRange(uint16 spell_id, Mob* tar) { +bool Bot::IsValidSpellRange(int32 spell_id, Mob* tar) { if (!IsValidSpell(spell_id) || !tar) { return false; } diff --git a/zone/client.cpp b/zone/client.cpp index dd9f0e6b2..030515807 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -3344,7 +3344,7 @@ void Client::GMKill() { safe_delete(outapp); } -void Client::MemorizeSpell(uint32 slot, uint32 spell_id, uint32 scribing, uint32 reduction){ +void Client::MemorizeSpell(uint32 slot, int32 spell_id, uint32 scribing, uint32 reduction){ if ( !EQ::ValueWithin( slot, @@ -3811,10 +3811,10 @@ void Client::MessageString(uint32 type, uint32 string_id, uint32 distance) return; if (distance > 0) - Message::CloseMessageString(this, false, static_cast(distance))( + ClientPatch::BroadcastMessageStringInRadius(this, false, static_cast(distance))( type, string_id); else - Message::MessageString(this, type, string_id); + ClientPatch::SendMessageString(this, type, string_id); } // @@ -3843,10 +3843,10 @@ void Client::MessageString(uint32 type, uint32 string_id, const char* message1, type = 4; if (distance > 0) - Message::CloseMessageString(this, false, static_cast(distance))(type, string_id, message1, + ClientPatch::BroadcastMessageStringInRadius(this, false, static_cast(distance))(type, string_id, message1, message2, message3, message4, message5, message6, message7, message8, message9); else - Message::MessageString(this, type, string_id, message1, message2, message3, message4, message5, + ClientPatch::SendMessageString(this, type, string_id, message1, message2, message3, message4, message5, message6, message7, message8, message9); } @@ -4393,7 +4393,7 @@ void Client::Sacrifice(Mob *caster) } } -void Client::SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID) { +void Client::SendOPTranslocateConfirm(Mob *Caster, int32 SpellID) { if(!Caster || PendingTranslocate) return; @@ -6326,8 +6326,7 @@ void Client::SuspendMinion(int value) if(value >= 1) { CurrentPet->SetPetState(m_suspendedminion.Buffs, m_suspendedminion.Items); - - CurrentPet->SendPetBuffsToClient(); + ClientPatch::SendFullBuffRefresh(CurrentPet); } CurrentPet->CalcBonuses(); @@ -6362,7 +6361,7 @@ void Client::SuspendMinion(int value) } else { - uint16 SpellID = CurrentPet->GetPetSpellID(); + int32 SpellID = CurrentPet->GetPetSpellID(); if(SpellID) { @@ -7103,7 +7102,7 @@ void Client::ConsentCorpses(std::string consent_name, bool deny) } } -void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_override, int pet_count, int pet_duration) +void Client::Doppelganger(int32 spell_id, Mob *target, const char *name_override, int pet_count, int pet_duration) { if(!target || !IsValidSpell(spell_id) || GetID() == target->GetID()) return; @@ -8931,7 +8930,7 @@ int Client::GetQuiverHaste(int delay) return (pi->GetItem()->BagWR * 0.0025f * delay) + 1; } -void Client::SendColoredText(uint32 color, std::string message) +void Client::SendColoredText(uint32 color, const std::string& message) { // arbitrary size limit if (message.size() > 512) // live does send this with empty strings sometimes ... @@ -10714,7 +10713,7 @@ void Client::Fling(float value, float target_x, float target_y, float target_z, std::vector Client::GetLearnableDisciplines(uint8 min_level, uint8 max_level) { std::vector learnable_disciplines; - for (uint16 spell_id = 0; spell_id < SPDAT_RECORDS; ++spell_id) { + for (int32 spell_id = 0; spell_id < SPDAT_RECORDS; ++spell_id) { bool learnable = true; if (!IsValidSpell(spell_id)) { continue; @@ -10785,7 +10784,7 @@ std::vector Client::GetScribeableSpells(uint8 min_level, uint8 max_level) { std::vector scribeable_spells; std::unordered_map> spell_group_cache = LoadSpellGroupCache(min_level, max_level); - for (uint16 spell_id = 0; spell_id < SPDAT_RECORDS; ++spell_id) { + for (int32 spell_id = 0; spell_id < SPDAT_RECORDS; ++spell_id) { bool scribeable = true; if (!IsValidSpell(spell_id)) { continue; diff --git a/zone/client.h b/zone/client.h index 0fe3dd597..bd9bed621 100644 --- a/zone/client.h +++ b/zone/client.h @@ -277,8 +277,8 @@ public: bool GotoPlayerRaid(const std::string& player_name); //abstract virtual function implementations required by base abstract class - virtual bool Death(Mob* killer_mob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false); - virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None); + virtual bool Death(Mob* killer_mob, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false); + virtual void Damage(Mob* from, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None); virtual bool HasRaid() { return (GetRaid() ? true : false); } virtual bool HasGroup() { return (GetGroup() ? true : false); } virtual Raid* GetRaid() { return entity_list.GetRaidByClient(this); } @@ -355,7 +355,7 @@ public: const char *message7 = nullptr, const char *message8 = nullptr, const char *message9 = nullptr); void Tell_StringID(uint32 string_id, const char *who, const char *message); - void SendColoredText(uint32 color, std::string message); + void SendColoredText(uint32 color, const std::string& message); void SendTraderItem(uint32 item_id,uint16 quantity, TraderRepository::Trader &trader); void DoBazaarSearch(BazaarSearchCriteria_Struct search_criteria); uint16 FindTraderItem(int32 SerialNumber,uint16 Quantity); @@ -678,7 +678,7 @@ public: inline virtual int32 GetDelayDeath() const { return aabonuses.DelayDeath + spellbonuses.DelayDeath + itembonuses.DelayDeath + 11; } - virtual bool CheckFizzle(uint16 spell_id); + virtual bool CheckFizzle(int32 spell_id); virtual int GetCurrentBuffSlots() const; virtual int GetCurrentSongSlots() const; virtual int GetCurrentDiscSlots() const { return 1; } @@ -928,8 +928,8 @@ public: bool CanHaveSkill(EQ::skills::SkillType skill_id) const; void SetSkill(EQ::skills::SkillType skill_num, uint16 value); void AddSkill(EQ::skills::SkillType skillid, uint16 value); - void CheckSpecializeIncrease(uint16 spell_id); - void CheckSongSkillIncrease(uint16 spell_id); + void CheckSpecializeIncrease(int32 spell_id); + void CheckSongSkillIncrease(int32 spell_id); bool CheckIncreaseSkill(EQ::skills::SkillType skillid, Mob *against_who, int chancemodi = 0); void CheckLanguageSkillIncrease(uint8 language_id, uint8 teacher_skill); void SetLanguageSkill(uint8 language_id, uint8 language_skill); @@ -955,13 +955,13 @@ public: inline void SetDuelTarget(uint32 set_id) { duel_target = set_id; } inline void SetDueling(bool duel) { duelaccepted = duel; } // use this one instead - void MemSpell(uint16 spell_id, int slot, bool update_client = true); + void MemSpell(int32 spell_id, int slot, bool update_client = true); void UnmemSpell(int slot, bool update_client = true); void UnmemSpellBySpellID(int32 spell_id); void UnmemSpellAll(bool update_client = true); int FindEmptyMemSlot(); uint16 FindMemmedSpellBySlot(int slot); - int FindMemmedSpellBySpellID(uint16 spell_id); + int FindMemmedSpellBySpellID(int32 spell_id); int MemmedCount(); std::vector GetLearnableDisciplines(uint8 min_level = 1, uint8 max_level = 0); std::vector GetLearnedDisciplines(); @@ -969,7 +969,7 @@ public: std::vector GetScribeableSpells(uint8 min_level = 1, uint8 max_level = 0); std::vector GetScribedSpells(); // defer save used when bulk saving - void ScribeSpell(uint16 spell_id, int slot, bool update_client = true, bool defer_save = false); + void ScribeSpell(int32 spell_id, int slot, bool update_client = true, bool defer_save = false); void SaveSpells(); void SaveDisciplines(); @@ -985,12 +985,12 @@ public: // defer save used when bulk saving void UnscribeSpell(int slot, bool update_client = true, bool defer_save = false); void UnscribeSpellAll(bool update_client = true); - void UnscribeSpellBySpellID(uint16 spell_id, bool update_client = true); + void UnscribeSpellBySpellID(int32 spell_id, bool update_client = true); void UntrainDisc(int slot, bool update_client = true, bool defer_save = false); void UntrainDiscAll(bool update_client = true); - void UntrainDiscBySpellID(uint16 spell_id, bool update_client = true); - bool SpellGlobalCheck(uint16 spell_id, uint32 char_id); - bool SpellBucketCheck(uint16 spell_id, uint32 char_id); + void UntrainDiscBySpellID(int32 spell_id, bool update_client = true); + bool SpellGlobalCheck(int32 spell_id, uint32 char_id); + bool SpellBucketCheck(int32 spell_id, uint32 char_id); uint8 GetCharMaxLevelFromQGlobal(); uint8 GetCharMaxLevelFromBucket(); @@ -1013,7 +1013,7 @@ public: inline bool AutoConsentRaidEnabled() const { return m_pp.raidAutoconsent != 0; } inline bool AutoConsentGuildEnabled() const { return m_pp.guildAutoconsent != 0; } - void SummonHorse(uint16 spell_id); + void SummonHorse(int32 spell_id); void SetHorseId(uint16 horseid_in); inline void SetControlledMobId(uint16 mob_id_in) { controlled_mob_id = mob_id_in; } uint16 GetControlledMobId() const{ return controlled_mob_id; } @@ -1111,7 +1111,7 @@ public: inline uint32 GetAAPercent() const { return m_epp.perAA; } void SetAATitle(std::string title); void SetTitleSuffix(std::string suffix); - void MemorizeSpell(uint32 slot, uint32 spell_id, uint32 scribing, uint32 reduction = 0); + void MemorizeSpell(uint32 slot, int32 spell_id, uint32 scribing, uint32 reduction = 0); int GetAAEXPPercentage(); int GetEXPPercentage(); @@ -1243,15 +1243,15 @@ public: void ResetDisciplineTimer(uint32 timer_id); void SendDisciplineUpdate(); void SendDisciplineTimer(uint32 timer_id, uint32 duration); - bool UseDiscipline(uint32 spell_id, uint32 target); - bool HasDisciplineLearned(uint16 spell_id); + bool UseDiscipline(int32 spell_id, uint32 target); + bool HasDisciplineLearned(int32 spell_id); void SetLinkedSpellReuseTimer(uint32 timer_id, uint32 duration); bool IsLinkedSpellReuseTimerReady(uint32 timer_id); void ResetCastbarCooldownBySlot(int slot); void ResetAllCastbarCooldowns(); - void ResetCastbarCooldownBySpellID(uint32 spell_id); + void ResetCastbarCooldownBySpellID(int32 spell_id); bool CheckTitle(int title_set); void EnableTitle(int title_set, bool insert = true); @@ -1268,20 +1268,15 @@ public: const std::string GetAutoLoginCharacterName(); bool SetAutoLoginCharacterName(const std::string& character_name); - //This is used to later set the buff duration of the spell, in slot to duration. - //Doesn't appear to work directly after the client recieves an action packet. - void SendBuffDurationPacket(Buffs_Struct &buff, int slot); - void SendBuffNumHitPacket(Buffs_Struct &buff, int slot); - void ProcessInspectRequest(Client* requestee, Client* requester); bool ClientFinishedLoading() { return (conn_state == ClientConnectFinished); } - int FindSpellBookSlotBySpellID(uint16 spellid); - uint32 GetSpellIDByBookSlot(int book_slot); + int FindSpellBookSlotBySpellID(int32 spellid); + int32 GetSpellIDByBookSlot(int book_slot); int GetNextAvailableSpellBookSlot(int starting_slot = 0); int GetNextAvailableDisciplineSlot(int starting_slot = 0); - inline uint32 GetSpellByBookSlot(int book_slot) { return m_pp.spell_book[book_slot]; } + inline int32 GetSpellByBookSlot(int book_slot) { return m_pp.spell_book[book_slot]; } inline bool HasSpellScribed(int spellid) { return FindSpellBookSlotBySpellID(spellid) != -1; } - uint32 GetHighestScribedSpellinSpellGroup(uint32 spell_group); + int32 GetHighestScribedSpellinSpellGroup(uint32 spell_group); std::unordered_map> LoadSpellGroupCache(uint8 min_level, uint8 max_level); uint16 GetMaxSkillAfterSpecializationRules(EQ::skills::SkillType skillid, uint16 maxSkill); void SendPopupToClient(const char *Title, const char *Text, uint32 PopupID = 0, uint32 Buttons = 0, uint32 Duration = 0); @@ -1292,7 +1287,7 @@ public: bool PendingSacrifice; uint16 sacrifice_caster_id; PendingTranslocate_Struct PendingTranslocateData; - void SendOPTranslocateConfirm(Mob *Caster, uint16 SpellID); + void SendOPTranslocateConfirm(Mob *Caster, int32 SpellID); // Help Window std::string SendBotCommandHelpWindow(const BotCommandHelpParams& params); @@ -1665,7 +1660,7 @@ public: } void SuspendMinion(int value); - void Doppelganger(uint16 spell_id, Mob *target, const char *name_override, int pet_count, int pet_duration); + void Doppelganger(int32 spell_id, Mob *target, const char *name_override, int pet_count, int pet_duration); void NotifyNewTitlesAvailable(); void Signal(int signal_id); void SendPayload(int payload_id, std::string payload_value = std::string()); @@ -1698,7 +1693,7 @@ public: bool RemoveRespawnOption(std::string option_name); bool RemoveRespawnOption(uint8 position); void ClearRespawnOptions() { respawn_options.clear(); } - void SetPendingRezzData(int XP, uint32 DBID, uint16 SpellID, const char *CorpseName) { PendingRezzXP = XP; PendingRezzDBID = DBID; PendingRezzSpellID = SpellID; PendingRezzCorpseName = CorpseName; } + void SetPendingRezzData(int XP, uint32 DBID, int32 SpellID, const char *CorpseName) { PendingRezzXP = XP; PendingRezzDBID = DBID; PendingRezzSpellID = SpellID; PendingRezzCorpseName = CorpseName; } bool IsRezzPending() { return PendingRezzSpellID > 0; } void ClearHover(); inline bool IsBlockedBuff(int32 SpellID) { return PlayerBlockedBuffs.find(SpellID) != PlayerBlockedBuffs.end(); } @@ -1798,7 +1793,7 @@ public: void SendWebLink(const char* website); void SendMarqueeMessage(uint32 type, std::string message, uint32 duration = 3000); void SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string message); - void SendSpellAnim(uint16 targetid, uint16 spell_id); + void SendSpellAnim(uint16 targetid, int32 spell_id); void DuplicateLoreMessage(uint32 ItemID); void GarbleMessage(char *, uint8); @@ -1956,7 +1951,6 @@ public: protected: friend class Mob; void CalcEdibleBonuses(StatBonuses* newbon); - void MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message = true); bool client_data_loaded; @@ -1989,7 +1983,7 @@ private: eqFilterMode ClientFilters[_FilterCount]; int32 HandlePacket(const EQApplicationPacket *app); void OPTGB(const EQApplicationPacket *app); - void OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 InstanceID, float x, float y, float z); + void OPRezzAnswer(uint32 Action, int32 SpellID, uint16 ZoneID, uint16 InstanceID, float x, float y, float z); void OPMemorizeSpell(const EQApplicationPacket *app); void OPMoveCoin(const EQApplicationPacket* app); void MoveItemCharges(EQ::ItemInstance &from, int16 to_slot, uint8 type); @@ -2309,7 +2303,7 @@ private: bool PendingGuildInvitation; int PendingRezzXP; uint32 PendingRezzDBID; - uint16 PendingRezzSpellID; // Only used for resurrect while hovering. + int32 PendingRezzSpellID; // Only used for resurrect while hovering. std::string PendingRezzCorpseName; // Only used for resurrect while hovering. std::set PlayerBlockedBuffs; diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 63b5b1fe4..3d950f9dc 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -1441,7 +1441,7 @@ int32 Client::CalcATK() return (ATK); } -uint32 Mob::GetInstrumentMod(uint16 spell_id) +uint32 Mob::GetInstrumentMod(int32 spell_id) { if (GetClass() != Class::Bard || spells[spell_id].is_discipline || spell_id == SPELL_AMPLIFICATION) { //Other classes can get a base effects mod using SPA 413 diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 7dc0dab17..768a63ba6 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -37,6 +37,7 @@ #include "common/rulesys.h" #include "common/shared_tasks.h" #include "zone/bot.h" +#include "zone/client_version.h" #include "zone/dialogue_window.h" #include "zone/dynamic_zone.h" #include "zone/event_codes.h" @@ -139,7 +140,7 @@ void MapOpcodes() ConnectedOpcodes[OP_BlockedBuffs] = &Client::Handle_OP_BlockedBuffs; ConnectedOpcodes[OP_BoardBoat] = &Client::Handle_OP_BoardBoat; ConnectedOpcodes[OP_BookButton] = &Client::Handle_OP_BookButton; - ConnectedOpcodes[OP_Buff] = &Client::Handle_OP_Buff; + ConnectedOpcodes[OP_BuffDefinition] = &Client::Handle_OP_BuffDefinition; ConnectedOpcodes[OP_BuffRemoveRequest] = &Client::Handle_OP_BuffRemoveRequest; ConnectedOpcodes[OP_Bug] = &Client::Handle_OP_Bug; ConnectedOpcodes[OP_Camp] = &Client::Handle_OP_Camp; @@ -758,7 +759,7 @@ void Client::CompleteConnect() Mob* pet = GetPet(); if (pet) { pet->SendWearChangeAndLighting(EQ::textures::LastTexture); - pet->SendPetBuffsToClient(); + ClientPatch::SendFullBuffRefresh(pet); } if (GetGroup()) @@ -933,10 +934,7 @@ void Client::CompleteConnect() delete pack; } - if (IsClient() && CastToClient()->ClientVersionBit() & EQ::versions::maskUFAndLater) { - EQApplicationPacket *outapp = MakeBuffsPacket(false); - CastToClient()->FastQueuePacket(&outapp); - } + ClientPatch::SendFullBuffRefresh(this); // TODO: load these states // We at least will set them to the correct state for now @@ -1560,7 +1558,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) m_pp.buffs[i].num_hits = buffs[i].hit_number; } else { - m_pp.buffs[i].spellid = SPELLBOOK_UNKNOWN; + m_pp.buffs[i].spellid = SPELL_UNKNOWN; m_pp.buffs[i].bard_modifier = 10; m_pp.buffs[i].effect_type = 0; m_pp.buffs[i].player_id = 0; @@ -4163,14 +4161,14 @@ void Client::Handle_OP_BookButton(const EQApplicationPacket* app) QueuePacket(&outapp); } -void Client::Handle_OP_Buff(const EQApplicationPacket *app) +void Client::Handle_OP_BuffDefinition(const EQApplicationPacket *app) { /* Note: if invisibility is on client, this will force it to drop. */ if (app->size != sizeof(SpellBuffPacket_Struct)) { - LogError("Size mismatch in OP_Buff. expected [{}] got [{}]", sizeof(SpellBuffPacket_Struct), app->size); + LogError("Size mismatch in OP_BuffDefinition. expected [{}] got [{}]", sizeof(SpellBuffPacket_Struct), app->size); DumpPacket(app); return; } @@ -4228,7 +4226,7 @@ void Client::Handle_OP_BuffRemoveRequest(const EQApplicationPacket *app) if (brrs->SlotID > (uint32)m->GetMaxTotalSlots()) return; - uint16 SpellID = m->GetSpellIDFromSlot(brrs->SlotID); + int32 SpellID = m->GetSpellIDFromSlot(brrs->SlotID); if (SpellID && (GetGM() || ((IsBeneficialSpell(SpellID) || IsEffectInSpell(SpellID, SpellEffect::BindSight)) && !spells[SpellID].no_remove))) { m->BuffFadeBySlot(brrs->SlotID, true); @@ -4419,9 +4417,9 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) if (inst && inst->IsClassCommon()) { const EQ::ItemData* item = inst->GetItem(); - if (item->Click.Effect != (uint32)castspell->spell_id) + if (item->Click.Effect != castspell->spell_id) { - std::string message = fmt::format("OP_CastSpell with item, tried to cast a different spell than what was on item - item spell id [{}] attempted [{}]", item->Click.Effect, (uint32)castspell->spell_id); + std::string message = fmt::format("OP_CastSpell with item, tried to cast a different spell than what was on item - item spell id [{}] attempted [{}]", item->Click.Effect, castspell->spell_id); RecordPlayerEventLog(PlayerEvent::POSSIBLE_HACK, PlayerEvent::PossibleHackEvent{.message = message}); InterruptSpell(castspell->spell_id); //CHEATER!! return; @@ -5841,8 +5839,8 @@ void Client::Handle_OP_DeleteSpell(const EQApplicationPacket *app) if (dss->spell_slot < 0 || dss->spell_slot >= EQ::spells::DynamicLookup(ClientVersion(), GetGM())->SpellbookSize) return; - if (m_pp.spell_book[dss->spell_slot] != SPELLBOOK_UNKNOWN) { - m_pp.spell_book[dss->spell_slot] = SPELLBOOK_UNKNOWN; + if (m_pp.spell_book[dss->spell_slot] != SPELL_UNKNOWN) { + m_pp.spell_book[dss->spell_slot] = SPELL_UNKNOWN; database.DeleteCharacterSpell(CharacterID(), dss->spell_slot); dss->success = 1; } @@ -15108,30 +15106,7 @@ void Client::Handle_OP_TargetMouse(const EQApplicationPacket *app) if (nt) { SetTarget(nt); - bool inspect_buffs = false; - // rank 1 gives you ability to see NPC buffs in target window (SoD+) - if (nt->IsNPC()) { - if (IsRaidGrouped()) { - Raid *raid = GetRaid(); - if (raid) { - uint32 gid = raid->GetGroup(this); - if (gid < 12 && raid->GroupCount(gid) > 2) - inspect_buffs = raid->GetLeadershipAA(groupAAInspectBuffs, gid); - } - } - else { - Group *group = GetGroup(); - if (group && group->GroupCount() > 2) - inspect_buffs = group->GetLeadershipAA(groupAAInspectBuffs); - } - } - if (GetGM() || RuleB(Spells, AlwaysSendTargetsBuffs) || nt == this || inspect_buffs || (nt->IsClient() && !nt->CastToClient()->GetPVP()) || - (nt->IsPet() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()) || - (nt->IsBot() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()) || // TODO: bot pets - (nt->IsMerc() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP())) - { - nt->SendBuffsToClient(this); - } + ClientPatch::SendFullBuffRefresh(nt); } else { @@ -15866,7 +15841,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) } if (its->Complete == 1) { - uint32 spell_id = PendingTranslocateData.spell_id; + int32 spell_id = PendingTranslocateData.spell_id; bool in_translocate_zone = ( zone->GetZoneID() == PendingTranslocateData.zone_id && zone->GetInstanceID() == PendingTranslocateData.instance_id diff --git a/zone/client_packet.h b/zone/client_packet.h index 0946f0438..36c3b77f0 100644 --- a/zone/client_packet.h +++ b/zone/client_packet.h @@ -72,7 +72,7 @@ void Handle_OP_BlockedBuffs(const EQApplicationPacket *app); void Handle_OP_BoardBoat(const EQApplicationPacket *app); void Handle_OP_BookButton(const EQApplicationPacket *app); - void Handle_OP_Buff(const EQApplicationPacket *app); + void Handle_OP_BuffDefinition(const EQApplicationPacket *app); void Handle_OP_BuffRemoveRequest(const EQApplicationPacket *app); void Handle_OP_Bug(const EQApplicationPacket *app); void Handle_OP_Camp(const EQApplicationPacket *app); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 6953a6728..49605010d 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -45,6 +45,8 @@ #include +#include "client_version.h" + extern QueryServ* QServ; extern Zone* zone; extern volatile bool is_zone_loaded; @@ -1031,7 +1033,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){ return 0; } -void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 InstanceID, float x, float y, float z) +void Client::OPRezzAnswer(uint32 Action, int32 SpellID, uint16 ZoneID, uint16 InstanceID, float x, float y, float z) { if(PendingRezzXP < 0) { // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer @@ -1046,7 +1048,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I // corpse is in has shutdown since the rez spell was cast. database.MarkCorpseAsResurrected(PendingRezzDBID); LogSpells("Player [{}] got a [{}] Rezz spellid [{}] in zone[{}] instance id [{}]", - name, (uint16)spells[SpellID].base_value[0], + name, spells[SpellID].base_value[0], SpellID, ZoneID, InstanceID); const bool use_old_resurrection = ( @@ -1059,7 +1061,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I ) ); - const uint16 resurrection_sickness_spell_id = ( + const int32 resurrection_sickness_spell_id = ( use_old_resurrection ? RuleI(Character, OldResurrectionSicknessSpellID) : RuleI(Character, ResurrectionSicknessSpellID) @@ -2307,11 +2309,7 @@ void Client::ClearHover() entity_list.QueueClients(this, outapp, false); safe_delete(outapp); - if (IsClient() && CastToClient()->ClientVersionBit() & EQ::versions::maskUFAndLater) - { - EQApplicationPacket *outapp = MakeBuffsPacket(false); - CastToClient()->FastQueuePacket(&outapp); - } + ClientPatch::SendFullBuffRefresh(this); dead = false; } diff --git a/zone/client_version.cpp b/zone/client_version.cpp index 1efc15835..052a554c2 100644 --- a/zone/client_version.cpp +++ b/zone/client_version.cpp @@ -27,3 +27,130 @@ void Client::SetClientVersion(Version client_version) } Version Client::GetClientVersion() const { return m_ClientVersion; } + +void ClientPatch::InterruptSpell(Client* c, uint32_t message, uint32_t spawn_id, const char* spell_link) { + QueuePacket(c, &IMessage::InterruptSpell, GetClientComponent(c), message, spawn_id, spell_link); +} + +void ClientPatch::InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id, const char* name, + const char* spell_link) { + QueueCloseClients(sender, true, RuleI(Range, SongMessages), nullptr, true, + sender->IsClient() ? FilterPCSpells : FilterNPCSpells)( + &IMessage::InterruptSpellOther, GetClientComponent, sender, message, spawn_id, name, spell_link); +} + +static bool ShouldSendTargetBuffs(Client* c) { + // this function checks for server rules against LAA and GM status to determine if a buffs packet should be sent + // to a client (c) for targeted mobs + if (c->GetGM() || RuleB(Spells, AlwaysSendTargetsBuffs)) { // this rule bypasses LAA abilities, always return true + if (c->GetGM()) { + if (!c->EntityVariableExists(SEE_BUFFS_FLAG)) { // This flag just ensures that the following message is only sent once + c->Message(Chat::White, + "Your GM flag allows you to always see your targets' buffs."); + c->SetEntityVariable(SEE_BUFFS_FLAG, "1"); + } + } + return true; + } + + if (c->IsRaidGrouped()) { + Raid* raid = c->GetRaid(); + if (raid) { + uint32 gid = raid->GetGroup(c); + if (gid < MAX_RAID_GROUPS && raid->GroupCount(gid) >= 3) { + if (raid->GetLeadershipAA(groupAAInspectBuffs, gid)) + return true; + } + } + } else { + Group* group = c->GetGroup(); + if (group && group->GroupCount() >= 3) { + if (group->GetLeadershipAA(groupAAInspectBuffs)) { + return true; + } + } + } + + return false; +} + +static void SetRefreshType(std::unique_ptr& packet, Mob* source, Client* target) +{ + uint8_t type = 0; + if (target->GetID() == source->GetID()) + type = 1; + else if (source->IsPet()) + type = 2; + else if (target->HasGroup() && source->GetGroup() == target->GetGroup()) + type = 4; + else if (source->IsClient()) + type = 5; + else + type = 7; + + ClientPatch::GetClientComponent(target)->SetRefreshType(packet, type); +} + +void ClientPatch::SendFullBuffRefresh(Mob* sender, bool remove, bool ackreq) { + bool suspended = zone->BuffTimersSuspended(); + std::vector slots; + + // first, send to self if self is client + if (sender->IsClient()) { + Client* c = sender->CastToClient(); + FastQueuePacket(c, &IBuff::RefreshBuffs, GetClientComponent(c), OP_RefreshBuffs, sender, false, suspended, slots); + } + + // next, send to owner if self is a pet to a client + if (sender->IsPet() && sender->GetOwner()->IsClient()) { + if (Mob* owner = sender->GetOwner(); owner != nullptr && owner->IsClient()) { + Client* c = owner->CastToClient(); + FastQueuePacket(c, &IBuff::RefreshBuffs, GetClientComponent(c), OP_RefreshPetBuffs, sender, false, suspended, slots); + } + } + + // finally send to all clients targeting the mob, will need to mutate the packet to set the type + auto mutate = [sender](std::unique_ptr& packet, Client* c) { + SetRefreshType(packet, sender, c); + }; + + QueueClientsByTarget(sender, ackreq, ShouldSendTargetBuffs, mutate)( + &IBuff::RefreshBuffs, GetClientComponent, OP_RefreshTargetBuffs, sender, false, suspended, slots); + + // if we have remove set, this will clear any target windows that shouldn't see the buffs + if (remove) + QueueClientsByTarget(sender, ackreq, [](Client* c) { return !ShouldSendTargetBuffs(c); }, mutate)( + &IBuff::RefreshBuffs, GetClientComponent, OP_RefreshTargetBuffs, sender, true, suspended, slots); +} + +void ClientPatch::SendSingleBuffChange(Mob* sender, const Buffs_Struct& buff, int slot, bool remove, bool ackreq) { + bool suspended = zone->BuffTimersSuspended(); + std::vector slots = { static_cast(slot) }; + + // first, send to self if self is client, which takes the definition and the refresh + if (sender->IsClient()) { + Client* c = sender->CastToClient(); + IBuff* component = GetClientComponent(c); + FastQueuePacket(c, &IBuff::BuffDefinition, component, sender, buff, slot, remove); + FastQueuePacket(c, &IBuff::RefreshBuffs, component, OP_RefreshBuffs, sender, remove, suspended, slots); + + // the client doesn't automatically do this for some reason pre-TOB + if (remove && component->NeedsWearMessage()) + c->SendColoredText(Chat::Spells, spells[buff.spellid].spell_fades); + } + + // the rest of the buff packets do not take the definition, only the refresh + if (sender->IsPet() && sender->GetOwner()->IsClient()) { + if (Mob* owner = sender->GetOwner(); owner != nullptr && owner->IsClient()) { + Client* c = owner->CastToClient(); + FastQueuePacket(c, &IBuff::RefreshBuffs, GetClientComponent(c), OP_RefreshPetBuffs, sender, remove, suspended, slots); + } + } + + auto mutate = [sender](std::unique_ptr& packet, Client* c) { + SetRefreshType(packet, sender, c); + }; + + QueueClientsByTarget(sender, ackreq, ShouldSendTargetBuffs, mutate)( + &IBuff::RefreshBuffs, GetClientComponent, OP_RefreshTargetBuffs, sender, remove, suspended, slots); +} diff --git a/zone/client_version.h b/zone/client_version.h index 80032c452..5dd2ca64c 100644 --- a/zone/client_version.h +++ b/zone/client_version.h @@ -1,26 +1,50 @@ -// -// Created by dannu on 4/21/2026. -// +/* EQEmu: EQEmulator + + Copyright (C) 2001-2026 EQEmu Development Team + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ #pragma once - #include "common/emu_versions.h" #include "common/patches/client_version.h" +#include "common/patches/IBuff.h" #include "common/patches/IMessage.h" #include "zone/client.h" #include "zone/mob.h" +#include + // store all _generic_ static functions for the different patches here namespace ClientPatch { using ClientList = std::unordered_map; -template using ComponentGetter = std::function; +template using ComponentGetter = Obj*(*)(const Client*); +using SendPredicate = std::function; +using MutatePacket = std::function&, Client*)>; + +template +Component* GetClientComponent(const Client* client) +{ + return GetComponent(client->GetClientVersion()).get(); +} template requires std::is_member_function_pointer_v -static void QueuePacket(Client* c, Fun fun, Obj* obj, Args&&... args) +void QueuePacket(Client* c, Fun fun, Obj* obj, Args&&... args) { if (obj != nullptr) { std::unique_ptr app = std::invoke(fun, obj, std::forward(args)...); @@ -30,15 +54,14 @@ static void QueuePacket(Client* c, Fun fun, Obj* obj, Args&&... args) } // packet generator queue functions -static auto QueueClients(Mob* sender, bool ignore_sender = false, bool ackreq = true) +inline auto QueueClients(Mob* sender, bool ignore_sender = false, bool ackreq = true) { - return [=](Fun fun, const ComponentGetter& component, Args&&... args) + return [=](Fun fun, ComponentGetter component, Args&&... args) requires std::is_member_function_pointer_v { std::array, EQ::versions::ClientVersionCount> build_packets; - std::unordered_map client_list = entity_list.GetClientList(); - for (auto [_, ent] : client_list) { + for (auto ent : entity_list.GetClientList() | std::views::values) { if (!ignore_sender || ent != sender) { auto& packet = build_packets.at(static_cast(ent->ClientVersion())); if (!packet) @@ -52,14 +75,14 @@ static auto QueueClients(Mob* sender, bool ignore_sender = false, bool ackreq = }; } -static auto QueueCloseClients( +inline auto QueueCloseClients( Mob* sender, bool ignore_sender = false, float distance = 200, Mob* skipped_mob = nullptr, bool is_ack_required = true, eqFilterType filter = FilterNone) { if (distance <= 0) distance = static_cast(zone->GetClientUpdateRange()); - return [=](Fun fun, const ComponentGetter& component, Args&&... args) + return [=](Fun fun, ComponentGetter component, Args&&... args) requires std::is_member_function_pointer_v { if (sender == nullptr) { @@ -68,14 +91,14 @@ static auto QueueCloseClients( float distance_squared = distance * distance; std::array, EQ::versions::ClientVersionCount> build_packets; - for (auto& [_, mob] : sender->GetCloseMobList(distance)) { + for (auto mob : sender->GetCloseMobList(distance) | std::views::values) { if (mob && mob->IsClient()) { Client* client = mob->CastToClient(); if ((!ignore_sender || client != sender) && client != skipped_mob - && DistanceSquared(client->GetPosition(), sender->GetPosition()) < distance_squared && client->Connected() - && client->ShouldGetPacket(sender, filter)) + && client->ShouldGetPacket(sender, filter) + && DistanceSquared(client->GetPosition(), sender->GetPosition()) < distance_squared) { auto& packet = build_packets.at(static_cast(client->ClientVersion())); if (!packet) @@ -91,30 +114,60 @@ static auto QueueCloseClients( }; } -} // namespace ClientPatch +template +void FastQueuePacket(Client* c, Fun fun, Obj* obj, Args&&... args) + requires std::is_member_function_pointer_v +{ + if (obj != nullptr) { + std::unique_ptr app = std::invoke(fun, obj, std::forward(args)...); + if (app) { + // FastQueuePacket specifically takes lifetime management of packet, so release here + EQApplicationPacket* packet = app.release(); + c->FastQueuePacket(&packet); + } + } +} -// Helpers for the Message interface to send message packets -namespace Message { +inline auto QueueClientsByTarget(Mob* sender, bool ackreq, const SendPredicate& should_send, const MutatePacket& mutate) +{ + return [=](Fun fun, ComponentGetter component, Args&&... args) + requires std::is_member_function_pointer_v + { + if (sender != nullptr) { + std::array, EQ::versions::ClientVersionCount> build_packets; -// this can return nullptr when the component doesn't exist for the version -static std::function GetComponent = [](const Client* c) -> IMessage* { - return GetMessageComponent(c->GetClientVersion()).get(); -}; + for (auto c : entity_list.GetClientList() | std::views::values) { + Mob* Target = c->GetTarget(); + if (Target == sender && should_send(c)) { + auto& packet = build_packets.at(static_cast(c->ClientVersion())); + if (!packet) + if (auto comp = component(c); comp != nullptr) + packet = std::invoke(fun, comp, std::forward(args)...); + + mutate(packet, c); + + if (packet) + c->QueuePacket(packet.get(), ackreq, Client::CLIENT_CONNECTED); + } + } + } + }; +} // Helper functions to wrap the packet construction in sends template requires (sizeof...(Args) <= 9) -void MessageString(Client* c, uint32_t type, uint32_t id, Args&&... args) +void SendMessageString(Client* c, uint32_t type, uint32_t id, Args&&... args) { if constexpr (sizeof...(Args) == 0) { - ClientPatch::QueuePacket(c, &IMessage::Simple, GetComponent(c), type, id); + QueuePacket(c, &IMessage::Simple, GetClientComponent(c), type, id); } else { - std::array a = {args...}; - ClientPatch::QueuePacket(c, &IMessage::Formatted, GetComponent(c), type, id, a); + IMessage::FormattedArgs a = {args...}; + QueuePacket(c, &IMessage::Formatted, GetClientComponent(c), type, id, a); } } -static auto CloseMessageString( +inline auto BroadcastMessageStringInRadius( Mob* sender, bool ignore_sender = false, float distance = 200.f, Mob* skipped_mob = nullptr, bool is_ack_required = true, eqFilterType filter = FilterNone) @@ -122,29 +175,23 @@ static auto CloseMessageString( return [=](uint32_t type, uint32_t id, Args&&... args) requires (sizeof...(Args) <= 9) { - auto queue_close_clients = ClientPatch::QueueCloseClients(sender, ignore_sender, distance, skipped_mob, + auto queue_close_clients = QueueCloseClients(sender, ignore_sender, distance, skipped_mob, is_ack_required, filter); if constexpr (sizeof...(Args) == 0) { - return queue_close_clients(&IMessage::Simple, GetComponent, type, id); + return queue_close_clients(&IMessage::Simple, GetClientComponent, type, id); } else { - std::array a = {args...}; - return queue_close_clients(&IMessage::Formatted, GetComponent, type, id, a); + IMessage::FormattedArgs a = {args...}; + return queue_close_clients(&IMessage::Formatted, GetClientComponent, type, id, a); } }; } -inline void InterruptSpell(Client* c, uint32_t message, uint32_t spawn_id, const char* spell_link) -{ - ClientPatch::QueuePacket(c, &IMessage::InterruptSpell, GetComponent(c), message, spawn_id, spell_link); -} +void InterruptSpell(Client* c, uint32_t message, uint32_t spawn_id, const char* spell_link); +void InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id, const char* name, + const char* spell_link); -inline void InterruptSpellOther(Mob* sender, uint32_t message, uint32_t spawn_id, const char* name, - const char* spell_link) -{ - ClientPatch::QueueCloseClients(sender, true, RuleI(Range, SongMessages), nullptr, true, - sender->IsClient() ? FilterPCSpells : FilterNPCSpells)( - &IMessage::InterruptSpellOther, GetComponent, sender, message, spawn_id, name, spell_link); -} +void SendFullBuffRefresh(Mob* sender, bool remove = false, bool ackreq = true); +void SendSingleBuffChange(Mob* sender, const Buffs_Struct& buff, int slot, bool remove = false, bool ackreq = true); -} // namespace Message +} // namespace ClientPatch diff --git a/zone/common.h b/zone/common.h index 1ab8bf2d0..66effd484 100644 --- a/zone/common.h +++ b/zone/common.h @@ -223,11 +223,12 @@ namespace Journal { //this is our internal representation of the BUFF struct, can put whatever we want in it struct Buffs_Struct { - uint16 spellid; + int32 spellid; uint8 casterlevel; - uint16 casterid; // Maybe change this to a pointer sometime, but gotta make sure it's 0'd when it no longer points to anything + uint32 casterid; // Maybe change this to a pointer sometime, but gotta make sure it's 0'd when it no longer points to anything char caster_name[64]; int32 ticsremaining; + int32 initialduration; uint32 counters; uint32 hit_number; //the number of physical hits this buff can take before it fades away, lots of druid armor spells take advantage of this mixed with powerful effects uint32 melee_rune; @@ -242,7 +243,7 @@ struct Buffs_Struct { int32 virus_spread_time; //time till next attempted viral spread bool persistant_buff; bool client; //True if the caster is a client - bool UpdateClient; + bool UpdateClient; // This is for legacy client support only. Newer clients take refresh packets for the entire buff list // cereal template @@ -334,13 +335,13 @@ struct StatBonuses { int32 Corrup; int32 CorrupCapMod; int32 HeroicCorrup; - uint16 DamageShieldSpellID; + int32 DamageShieldSpellID; int DamageShield; // this is damage done to mobs that attack this DmgShieldType DamageShieldType; int SpellDamageShield; int SpellShield; int ReverseDamageShield; // this is damage done to the mob when it attacks - uint16 ReverseDamageShieldSpellID; + int32 ReverseDamageShieldSpellID; DmgShieldType ReverseDamageShieldType; int movementspeed; int32 haste; @@ -641,7 +642,7 @@ namespace SBIndex { constexpr uint16 POSITION_FRONT = 1; // SPA 503-506 constexpr uint16 PET_RAMPAGE_CHANCE = 0; // SPA 464,465 constexpr uint16 PET_RAMPAGE_DMG_MOD = 1; // SPA 465,465 - constexpr uint16 SKILLATK_PROC_SPELL_ID = 0; // SPA 288 + constexpr int32 SKILLATK_PROC_SPELL_ID = 0; // SPA 288 constexpr uint16 SKILLATK_PROC_CHANCE = 1; // SPA 288 constexpr uint16 SKILLATK_PROC_SKILL = 2; // SPA 288 constexpr uint16 SLAYUNDEAD_DMG_MOD = 0; // SPA 219 @@ -660,7 +661,7 @@ namespace SBIndex { constexpr uint16 REFLECT_RESISTANCE_MOD = 1; // SPA 158 constexpr uint16 REFLECT_DMG_EFFECTIVENESS = 2; // SPA 158 constexpr uint16 COMBAT_PROC_ORIGIN_ID = 0; // SPA - constexpr uint16 COMBAT_PROC_SPELL_ID = 1; // SPA + constexpr int32 COMBAT_PROC_SPELL_ID = 1; // SPA constexpr uint16 COMBAT_PROC_RATE_MOD = 2; // SPA constexpr uint16 COMBAT_PROC_REUSE_TIMER = 3; // SPA constexpr uint16 SHIELD_TARGET_MITIGATION_PERCENT = 0; // SPA 463 diff --git a/zone/corpse.cpp b/zone/corpse.cpp index bafcd03e5..7a4cfd3ae 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -2304,7 +2304,7 @@ void Corpse::CheckIsOwnerOnline() } } -void Corpse::CastRezz(uint16 spell_id, Mob *caster) +void Corpse::CastRezz(int32 spell_id, Mob *caster) { LogSpells( "spell_id [{}] IsRezzed() [{}], rez_experience [{}], rez_timer enabled [{}]", diff --git a/zone/corpse.h b/zone/corpse.h index 584b7d650..62951fb63 100644 --- a/zone/corpse.h +++ b/zone/corpse.h @@ -83,7 +83,7 @@ public: virtual bool Death( Mob *killer_mob, int64 damage, - uint16 spell_id, + int32 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false @@ -92,7 +92,7 @@ public: virtual void Damage( Mob *from, int64 damage, - uint16 spell_id, + int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, @@ -205,7 +205,7 @@ public: /* Corpse: Resurrection */ bool IsRezzed() { return m_rez; } void IsRezzed(bool in_rez) { m_rez = in_rez; } - void CastRezz(uint16 spell_id, Mob *caster); + void CastRezz(int32 spell_id, Mob *caster); void CompleteResurrection(bool timer_expired = false); bool IsRezzable() { return m_is_rezzable; } void SetRezTimer(bool initial_timer = false); diff --git a/zone/effects.cpp b/zone/effects.cpp index 0d0b1ce34..29bec6d9f 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -27,7 +27,7 @@ #include "zone/worldserver.h" #include "zone/zonedb.h" -float Mob::GetActSpellRange(uint16 spell_id, float range) +float Mob::GetActSpellRange(int32 spell_id, float range) { float extrange = 100; @@ -36,7 +36,7 @@ float Mob::GetActSpellRange(uint16 spell_id, float range) return (range * extrange) / 100; } -int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) { +int64 Mob::GetActSpellDamage(int32 spell_id, int64 value, Mob* target) { if (spells[spell_id].target_type == ST_Self) { return value; } @@ -202,7 +202,7 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) { return value; } -int64 Mob::GetActReflectedSpellDamage(uint16 spell_id, int64 value, int effectiveness) { +int64 Mob::GetActReflectedSpellDamage(int32 spell_id, int64 value, int effectiveness) { /* Reflected spells use the spells base damage before any modifiers or formulas applied. That value can then be modifier by the reflect spells 'max' value, defined here as effectiveness @@ -237,7 +237,7 @@ int64 Mob::GetActReflectedSpellDamage(uint16 spell_id, int64 value, int effectiv return value; } -int64 Mob::GetActDoTDamage(uint16 spell_id, int64 value, Mob* target, bool from_buff_tic) { +int64 Mob::GetActDoTDamage(int32 spell_id, int64 value, Mob* target, bool from_buff_tic) { if (target == nullptr) return value; @@ -362,7 +362,7 @@ int64 Mob::GetActDoTDamage(uint16 spell_id, int64 value, Mob* target, bool from_ return value; } -int64 Mob::GetExtraSpellAmt(uint16 spell_id, int64 extra_spell_amt, int64 base_spell_dmg) +int64 Mob::GetExtraSpellAmt(int32 spell_id, int64 extra_spell_amt, int64 base_spell_dmg) { if (RuleB(Spells, FlatItemExtraSpellAmt)) { @@ -401,7 +401,7 @@ int64 Mob::GetExtraSpellAmt(uint16 spell_id, int64 extra_spell_amt, int64 base_s return extra_spell_amt; } -int64 Mob::GetActSpellHealing(uint16 spell_id, int64 value, Mob* target, bool from_buff_tic) { +int64 Mob::GetActSpellHealing(int32 spell_id, int64 value, Mob* target, bool from_buff_tic) { if (target == nullptr && IsBot()) { target = this; } @@ -557,7 +557,7 @@ int64 Mob::GetActSpellHealing(uint16 spell_id, int64 value, Mob* target, bool fr } -int32 Mob::GetActSpellCost(uint16 spell_id, int32 cost) +int32 Mob::GetActSpellCost(int32 spell_id, int32 cost) { //FrenziedDevastation doubles mana cost of all DD spells int16 FrenziedDevastation = itembonuses.FrenziedDevastation + spellbonuses.FrenziedDevastation + aabonuses.FrenziedDevastation; @@ -606,7 +606,7 @@ int32 Mob::GetActSpellCost(uint16 spell_id, int32 cost) return cost; } -int32 Mob::GetActSpellDuration(uint16 spell_id, int32 duration) +int32 Mob::GetActSpellDuration(int32 spell_id, int32 duration) { // focuses don't affect discipline duration (Except War Cries) if ( @@ -849,7 +849,7 @@ void Client::SendDisciplineUpdate() { QueuePacket(&app); } -bool Client::UseDiscipline(uint32 spell_id, uint32 target) { +bool Client::UseDiscipline(int32 spell_id, uint32 target) { // Dont let client waste a reuse timer if they can't use the disc if ((IsStunned() && !IsCastNotStandingSpell(spell_id))|| IsFeared() || @@ -1001,7 +1001,7 @@ void Client::ResetAllDisciplineTimers() { } } -bool Client::HasDisciplineLearned(uint16 spell_id) { +bool Client::HasDisciplineLearned(int32 spell_id) { bool has_learned = false; for (auto index = 0; index < MAX_PP_DISCIPLINES; ++index) { if (GetPP().disciplines.values[index] == spell_id) { @@ -1063,7 +1063,7 @@ void EntityList::AETaunt(Client* taunter, float range, int bonus_hate) void EntityList::AESpell( Mob* caster_mob, Mob* center_mob, - uint16 spell_id, + int32 spell_id, bool affect_caster, int16 resist_adjust, int* max_targets, @@ -1250,7 +1250,7 @@ void EntityList::AESpell( void EntityList::MassGroupBuff( Mob* caster, Mob* center, - uint16 spell_id, + int32 spell_id, bool affect_caster ) { diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 52863b698..d0f41d94e 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -531,7 +531,7 @@ int PerlembParser::EventSpell( QuestEventID event_id, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector* extra_pointers @@ -610,7 +610,7 @@ bool PerlembParser::GlobalPlayerHasQuestSub(QuestEventID event_id) return perl->SubExists("qst_global_player", QuestEventSubroutines[event_id]); } -bool PerlembParser::SpellHasQuestSub(uint32 spell_id, QuestEventID event_id) +bool PerlembParser::SpellHasQuestSub(int32 spell_id, QuestEventID event_id) { if (!perl || event_id >= _LargestEventID) { return false; @@ -790,7 +790,7 @@ void PerlembParser::LoadItemScript(std::string filename, EQ::ItemInstance* inst) item_quest_status_[inst->GetID()] = questLoaded; } -void PerlembParser::LoadSpellScript(std::string filename, uint32 spell_id) +void PerlembParser::LoadSpellScript(std::string filename, int32 spell_id) { if (!perl) { return; @@ -990,7 +990,7 @@ void PerlembParser::ExportVar(const char* prefix, const char* variable_name, con int PerlembParser::SendCommands( const char* prefix, const char* event_id, - uint32 object_id, + int32 object_id, // TODO: unused parameter? spell_id in header, object_id here Mob* other, Mob* mob, EQ::ItemInstance* inst, @@ -1923,8 +1923,8 @@ void PerlembParser::ExportEventVariables( case EVENT_SPELL_BLOCKED: { Seperator sep(data); - const uint32 blocking_spell_id = Strings::ToUnsignedInt(sep.arg[0]); - const uint32 cast_spell_id = Strings::ToUnsignedInt(sep.arg[1]); + const int32 blocking_spell_id = Strings::ToInt(sep.arg[0]); + const int32 cast_spell_id = Strings::ToInt(sep.arg[1]); ExportVar(package_name.c_str(), "blocking_spell_id", blocking_spell_id); ExportVar(package_name.c_str(), "cast_spell_id", cast_spell_id); diff --git a/zone/embparser.h b/zone/embparser.h index ae25ec1d4..7b8d8607b 100644 --- a/zone/embparser.h +++ b/zone/embparser.h @@ -111,7 +111,7 @@ public: QuestEventID event_id, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector* extra_pointers @@ -173,7 +173,7 @@ public: virtual bool HasGlobalQuestSub(QuestEventID event_id); virtual bool PlayerHasQuestSub(QuestEventID event_id); virtual bool GlobalPlayerHasQuestSub(QuestEventID event_id); - virtual bool SpellHasQuestSub(uint32 spell_id, QuestEventID event_id); + virtual bool SpellHasQuestSub(int32 spell_id, QuestEventID event_id); virtual bool ItemHasQuestSub(EQ::ItemInstance* inst, QuestEventID event_id); virtual bool BotHasQuestSub(QuestEventID event_id); virtual bool GlobalBotHasQuestSub(QuestEventID event_id); @@ -187,7 +187,7 @@ public: virtual void LoadPlayerScript(std::string filename); virtual void LoadGlobalPlayerScript(std::string filename); virtual void LoadItemScript(std::string filename, EQ::ItemInstance* inst); - virtual void LoadSpellScript(std::string filename, uint32 spell_id); + virtual void LoadSpellScript(std::string filename, int32 spell_id); virtual void LoadBotScript(std::string filename); virtual void LoadGlobalBotScript(std::string filename); virtual void LoadMercScript(std::string filename); @@ -228,7 +228,7 @@ private: int SendCommands( const char* prefix, const char* event, - uint32 spell_id, + int32 spell_id, Mob* other, Mob* mob, EQ::ItemInstance* inst, diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 997776338..bee81dd81 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -312,12 +312,12 @@ int Perl__getinventoryslotid(std::string identifier) return result; } -void Perl__castspell(uint16 spell_id, uint16 target_id) +void Perl__castspell(int32 spell_id, uint16 target_id) { quest_manager.castspell(spell_id, target_id); } -void Perl__selfcast(uint16 spell_id) +void Perl__selfcast(int32 spell_id) { quest_manager.selfcast(spell_id); } @@ -542,12 +542,12 @@ std::string Perl__getracename(uint16 race_id) return quest_manager.getracename(race_id); } -std::string Perl__getspellname(uint32 spell_id) +std::string Perl__getspellname(int32 spell_id) { return quest_manager.getspellname(spell_id); } -uint8 Perl__get_spell_level(uint16 spell_id, uint8 class_id) +uint8 Perl__get_spell_level(int32 spell_id, uint8 class_id) { const auto spell_level = GetSpellLevel(spell_id, class_id); return spell_level > RuleI(Character, MaxLevel) ? UINT8_MAX : spell_level; @@ -1736,437 +1736,437 @@ bool Perl__IsRunning() return quest_manager.IsRunning(); } -bool Perl__IsEffectInSpell(uint16 spell_id, int effect_id) +bool Perl__IsEffectInSpell(int32 spell_id, int effect_id) { return IsEffectInSpell(spell_id, effect_id); } -bool Perl__IsBeneficialSpell(uint16 spell_id) +bool Perl__IsBeneficialSpell(int32 spell_id) { return IsBeneficialSpell(spell_id); } -bool Perl__IsDetrimentalSpell(uint16 spell_id) +bool Perl__IsDetrimentalSpell(int32 spell_id) { return IsDetrimentalSpell(spell_id); } -bool Perl__IsTargetableAESpell(uint16 spell_id) +bool Perl__IsTargetableAESpell(int32 spell_id) { return IsTargetableAESpell(spell_id); } -bool Perl__IsSacrificeSpell(uint16 spell_id) +bool Perl__IsSacrificeSpell(int32 spell_id) { return IsSacrificeSpell(spell_id); } -bool Perl__IsLifetapSpell(uint16 spell_id) +bool Perl__IsLifetapSpell(int32 spell_id) { return IsLifetapSpell(spell_id); } -bool Perl__IsMesmerizeSpell(uint16 spell_id) +bool Perl__IsMesmerizeSpell(int32 spell_id) { return IsMesmerizeSpell(spell_id); } -bool Perl__IsStunSpell(uint16 spell_id) +bool Perl__IsStunSpell(int32 spell_id) { return IsStunSpell(spell_id); } -bool Perl__IsSummonSpell(uint16 spell_id) +bool Perl__IsSummonSpell(int32 spell_id) { return IsSummonSpell(spell_id); } -bool Perl__IsDamageSpell(uint16 spell_id) +bool Perl__IsDamageSpell(int32 spell_id) { return IsDamageSpell(spell_id); } -bool Perl__IsFearSpell(uint16 spell_id) +bool Perl__IsFearSpell(int32 spell_id) { return IsFearSpell(spell_id); } -bool Perl__IsCureSpell(uint16 spell_id) +bool Perl__IsCureSpell(int32 spell_id) { return IsCureSpell(spell_id); } -bool Perl__IsHasteSpell(uint16 spell_id) +bool Perl__IsHasteSpell(int32 spell_id) { return IsHasteSpell(spell_id); } -bool Perl__IsHarmonySpell(uint16 spell_id) +bool Perl__IsHarmonySpell(int32 spell_id) { return IsHarmonySpell(spell_id); } -bool Perl__IsPercentalHealSpell(uint16 spell_id) +bool Perl__IsPercentalHealSpell(int32 spell_id) { return IsPercentalHealSpell(spell_id); } -bool Perl__IsGroupOnlySpell(uint16 spell_id) +bool Perl__IsGroupOnlySpell(int32 spell_id) { return IsGroupOnlySpell(spell_id); } -bool Perl__IsInvisibleSpell(uint16 spell_id) +bool Perl__IsInvisibleSpell(int32 spell_id) { return IsInvisibleSpell(spell_id); } -bool Perl__IsInvulnerabilitySpell(uint16 spell_id) +bool Perl__IsInvulnerabilitySpell(int32 spell_id) { return IsInvulnerabilitySpell(spell_id); } -bool Perl__IsCompleteHealDurationSpell(uint16 spell_id) +bool Perl__IsCompleteHealDurationSpell(int32 spell_id) { return IsCompleteHealDurationSpell(spell_id); } -bool Perl__IsPoisonCounterSpell(uint16 spell_id) +bool Perl__IsPoisonCounterSpell(int32 spell_id) { return IsPoisonCounterSpell(spell_id); } -bool Perl__IsDiseaseCounterSpell(uint16 spell_id) +bool Perl__IsDiseaseCounterSpell(int32 spell_id) { return IsDiseaseCounterSpell(spell_id); } -bool Perl__IsSummonItemSpell(uint16 spell_id) +bool Perl__IsSummonItemSpell(int32 spell_id) { return IsSummonItemSpell(spell_id); } -bool Perl__IsSummonSkeletonSpell(uint16 spell_id) +bool Perl__IsSummonSkeletonSpell(int32 spell_id) { return IsSummonSkeletonSpell(spell_id); } -bool Perl__IsSummonPetSpell(uint16 spell_id) +bool Perl__IsSummonPetSpell(int32 spell_id) { return IsSummonPetSpell(spell_id); } -bool Perl__IsPetSpell(uint16 spell_id) +bool Perl__IsPetSpell(int32 spell_id) { return IsPetSpell(spell_id); } -bool Perl__IsSummonPCSpell(uint16 spell_id) +bool Perl__IsSummonPCSpell(int32 spell_id) { return IsSummonPCSpell(spell_id); } -bool Perl__IsCharmSpell(uint16 spell_id) +bool Perl__IsCharmSpell(int32 spell_id) { return IsCharmSpell(spell_id); } -bool Perl__IsBlindSpell(uint16 spell_id) +bool Perl__IsBlindSpell(int32 spell_id) { return IsBlindSpell(spell_id); } -bool Perl__IsHealthSpell(uint16 spell_id) +bool Perl__IsHealthSpell(int32 spell_id) { return IsHealthSpell(spell_id); } -bool Perl__IsCastTimeReductionSpell(uint16 spell_id) +bool Perl__IsCastTimeReductionSpell(int32 spell_id) { return IsCastTimeReductionSpell(spell_id); } -bool Perl__IsIncreaseDurationSpell(uint16 spell_id) +bool Perl__IsIncreaseDurationSpell(int32 spell_id) { return IsIncreaseDurationSpell(spell_id); } -bool Perl__IsManaCostReductionSpell(uint16 spell_id) +bool Perl__IsManaCostReductionSpell(int32 spell_id) { return IsManaCostReductionSpell(spell_id); } -bool Perl__IsIncreaseRangeSpell(uint16 spell_id) +bool Perl__IsIncreaseRangeSpell(int32 spell_id) { return IsIncreaseRangeSpell(spell_id); } -bool Perl__IsImprovedHealingSpell(uint16 spell_id) +bool Perl__IsImprovedHealingSpell(int32 spell_id) { return IsImprovedHealingSpell(spell_id); } -bool Perl__IsImprovedDamageSpell(uint16 spell_id) +bool Perl__IsImprovedDamageSpell(int32 spell_id) { return IsImprovedDamageSpell(spell_id); } -bool Perl__IsAEDurationSpell(uint16 spell_id) +bool Perl__IsAEDurationSpell(int32 spell_id) { return IsAEDurationSpell(spell_id); } -bool Perl__IsPureNukeSpell(uint16 spell_id) +bool Perl__IsPureNukeSpell(int32 spell_id) { return IsPureNukeSpell(spell_id); } -bool Perl__IsAENukeSpell(uint16 spell_id) +bool Perl__IsAENukeSpell(int32 spell_id) { return IsAENukeSpell(spell_id); } -bool Perl__IsPBAENukeSpell(uint16 spell_id) +bool Perl__IsPBAENukeSpell(int32 spell_id) { return IsPBAENukeSpell(spell_id); } -bool Perl__IsAERainNukeSpell(uint16 spell_id) +bool Perl__IsAERainNukeSpell(int32 spell_id) { return IsAERainNukeSpell(spell_id); } -bool Perl__IsPartialResistableSpell(uint16 spell_id) +bool Perl__IsPartialResistableSpell(int32 spell_id) { return IsPartialResistableSpell(spell_id); } -bool Perl__IsResistableSpell(uint16 spell_id) +bool Perl__IsResistableSpell(int32 spell_id) { return IsResistableSpell(spell_id); } -bool Perl__IsGroupSpell(uint16 spell_id) +bool Perl__IsGroupSpell(int32 spell_id) { return IsGroupSpell(spell_id); } -bool Perl__IsTGBCompatibleSpell(uint16 spell_id) +bool Perl__IsTGBCompatibleSpell(int32 spell_id) { return IsTGBCompatibleSpell(spell_id); } -bool Perl__IsBardSong(uint16 spell_id) +bool Perl__IsBardSong(int32 spell_id) { return IsBardSong(spell_id); } -bool Perl__IsPulsingBardSong(uint16 spell_id) +bool Perl__IsPulsingBardSong(int32 spell_id) { return IsPulsingBardSong(spell_id); } -bool Perl__IsDisciplineBuff(uint16 spell_id) +bool Perl__IsDisciplineBuff(int32 spell_id) { return IsDisciplineBuff(spell_id); } -bool Perl__IsDiscipline(uint16 spell_id) +bool Perl__IsDiscipline(int32 spell_id) { return IsDiscipline(spell_id); } -bool Perl__IsCombatSkill(uint16 spell_id) +bool Perl__IsCombatSkill(int32 spell_id) { return IsCombatSkill(spell_id); } -bool Perl__IsResurrectionEffects(uint16 spell_id) +bool Perl__IsResurrectionEffects(int32 spell_id) { return IsResurrectionEffects(spell_id); } -bool Perl__IsRuneSpell(uint16 spell_id) +bool Perl__IsRuneSpell(int32 spell_id) { return IsRuneSpell(spell_id); } -bool Perl__IsMagicRuneSpell(uint16 spell_id) +bool Perl__IsMagicRuneSpell(int32 spell_id) { return IsMagicRuneSpell(spell_id); } -bool Perl__IsManaTapSpell(uint16 spell_id) +bool Perl__IsManaTapSpell(int32 spell_id) { return IsManaTapSpell(spell_id); } -bool Perl__IsAllianceSpell(uint16 spell_id) +bool Perl__IsAllianceSpell(int32 spell_id) { return IsAllianceSpell(spell_id); } -bool Perl__IsDeathSaveSpell(uint16 spell_id) +bool Perl__IsDeathSaveSpell(int32 spell_id) { return IsDeathSaveSpell(spell_id); } -bool Perl__IsPartialDeathSaveSpell(uint16 spell_id) +bool Perl__IsPartialDeathSaveSpell(int32 spell_id) { return IsPartialDeathSaveSpell(spell_id); } -bool Perl__IsFullDeathSaveSpell(uint16 spell_id) +bool Perl__IsFullDeathSaveSpell(int32 spell_id) { return IsFullDeathSaveSpell(spell_id); } -bool Perl__IsShadowStepSpell(uint16 spell_id) +bool Perl__IsShadowStepSpell(int32 spell_id) { return IsShadowStepSpell(spell_id); } -bool Perl__IsSuccorSpell(uint16 spell_id) +bool Perl__IsSuccorSpell(int32 spell_id) { return IsSuccorSpell(spell_id); } -bool Perl__IsTeleportSpell(uint16 spell_id) +bool Perl__IsTeleportSpell(int32 spell_id) { return IsTeleportSpell(spell_id); } -bool Perl__IsTranslocateSpell(uint16 spell_id) +bool Perl__IsTranslocateSpell(int32 spell_id) { return IsTranslocateSpell(spell_id); } -bool Perl__IsGateSpell(uint16 spell_id) +bool Perl__IsGateSpell(int32 spell_id) { return IsGateSpell(spell_id); } -bool Perl__IsIllusionSpell(uint16 spell_id) +bool Perl__IsIllusionSpell(int32 spell_id) { return IsIllusionSpell(spell_id); } -bool Perl__IsLDoNObjectSpell(uint16 spell_id) +bool Perl__IsLDoNObjectSpell(int32 spell_id) { return IsLDoNObjectSpell(spell_id); } -bool Perl__IsHealOverTimeSpell(uint16 spell_id) +bool Perl__IsHealOverTimeSpell(int32 spell_id) { return IsHealOverTimeSpell(spell_id); } -bool Perl__IsCompleteHealSpell(uint16 spell_id) +bool Perl__IsCompleteHealSpell(int32 spell_id) { return IsCompleteHealSpell(spell_id); } -bool Perl__IsFastHealSpell(uint16 spell_id) +bool Perl__IsFastHealSpell(int32 spell_id) { return IsFastHealSpell(spell_id); } -bool Perl__IsVeryFastHealSpell(uint16 spell_id) +bool Perl__IsVeryFastHealSpell(int32 spell_id) { return IsVeryFastHealSpell(spell_id); } -bool Perl__IsRegularSingleTargetHealSpell(uint16 spell_id) +bool Perl__IsRegularSingleTargetHealSpell(int32 spell_id) { return IsRegularSingleTargetHealSpell(spell_id); } -bool Perl__IsRegularGroupHealSpell(uint16 spell_id) +bool Perl__IsRegularGroupHealSpell(int32 spell_id) { return IsRegularGroupHealSpell(spell_id); } -bool Perl__IsGroupCompleteHealSpell(uint16 spell_id) +bool Perl__IsGroupCompleteHealSpell(int32 spell_id) { return IsGroupCompleteHealSpell(spell_id); } -bool Perl__IsGroupHealOverTimeSpell(uint16 spell_id) +bool Perl__IsGroupHealOverTimeSpell(int32 spell_id) { return IsGroupHealOverTimeSpell(spell_id); } -bool Perl__IsDebuffSpell(uint16 spell_id) +bool Perl__IsDebuffSpell(int32 spell_id) { return IsDebuffSpell(spell_id); } -bool Perl__IsResistDebuffSpell(uint16 spell_id) +bool Perl__IsResistDebuffSpell(int32 spell_id) { return IsResistDebuffSpell(spell_id); } -bool Perl__IsSelfConversionSpell(uint16 spell_id) +bool Perl__IsSelfConversionSpell(int32 spell_id) { return IsSelfConversionSpell(spell_id); } -bool Perl__IsBuffSpell(uint16 spell_id) +bool Perl__IsBuffSpell(int32 spell_id) { return IsBuffSpell(spell_id); } -bool Perl__IsPersistDeathSpell(uint16 spell_id) +bool Perl__IsPersistDeathSpell(int32 spell_id) { return IsPersistDeathSpell(spell_id); } -bool Perl__IsSuspendableSpell(uint16 spell_id) +bool Perl__IsSuspendableSpell(int32 spell_id) { return IsSuspendableSpell(spell_id); } -bool Perl__IsCastOnFadeDurationSpell(uint16 spell_id) +bool Perl__IsCastOnFadeDurationSpell(int32 spell_id) { return IsCastOnFadeDurationSpell(spell_id); } -bool Perl__IsDistanceModifierSpell(uint16 spell_id) +bool Perl__IsDistanceModifierSpell(int32 spell_id) { return IsDistanceModifierSpell(spell_id); } -bool Perl__IsRestAllowedSpell(uint16 spell_id) +bool Perl__IsRestAllowedSpell(int32 spell_id) { return IsRestAllowedSpell(spell_id); } -bool Perl__IsNoDetrimentalSpellAggroSpell(uint16 spell_id) +bool Perl__IsNoDetrimentalSpellAggroSpell(int32 spell_id) { return IsNoDetrimentalSpellAggroSpell(spell_id); } -bool Perl__IsStackableDOT(uint16 spell_id) +bool Perl__IsStackableDOT(int32 spell_id) { return IsStackableDOT(spell_id); } -bool Perl__IsShortDurationBuff(uint16 spell_id) +bool Perl__IsShortDurationBuff(int32 spell_id) { return IsShortDurationBuff(spell_id); } -bool Perl__IsTargetRequiredForSpell(uint16 spell_id) +bool Perl__IsTargetRequiredForSpell(int32 spell_id) { return IsTargetRequiredForSpell(spell_id); } -bool Perl__IsVirusSpell(uint16 spell_id) +bool Perl__IsVirusSpell(int32 spell_id) { return IsVirusSpell(spell_id); } -bool Perl__IsValidSpell(uint16 spell_id) +bool Perl__IsValidSpell(int32 spell_id) { return IsValidSpell(spell_id); } @@ -2186,147 +2186,147 @@ bool Perl__IsBardOnlyStackEffect(int effect_id) return IsBardOnlyStackEffect(effect_id); } -bool Perl__IsCastWhileInvisibleSpell(uint16 spell_id) +bool Perl__IsCastWhileInvisibleSpell(int32 spell_id) { return IsCastWhileInvisibleSpell(spell_id); } -bool Perl__IsCastRestrictedSpell(uint16 spell_id) +bool Perl__IsCastRestrictedSpell(int32 spell_id) { return IsCastRestrictedSpell(spell_id); } -bool Perl__IsCastNotStandingSpell(uint16 spell_id) +bool Perl__IsCastNotStandingSpell(int32 spell_id) { return IsCastNotStandingSpell(spell_id); } -bool Perl__IsInstrumentModifierAppliedToSpellEffect(uint16 spell_id, int effect_id) +bool Perl__IsInstrumentModifierAppliedToSpellEffect(int32 spell_id, int effect_id) { return IsInstrumentModifierAppliedToSpellEffect(spell_id, effect_id); } -bool Perl__IsBlankSpellEffect(uint16 spell_id, int effect_index) +bool Perl__IsBlankSpellEffect(int32 spell_id, int effect_index) { return IsBlankSpellEffect(spell_id, effect_index); } -uint16 Perl__GetSpellTriggerSpellID(uint16 spell_id, int effect_id) +int32 Perl__GetSpellTriggerSpellID(int32 spell_id, int effect_id) { return GetSpellTriggerSpellID(spell_id, effect_id); } -uint8 Perl__GetSpellMinimumLevel(uint16 spell_id) +uint8 Perl__GetSpellMinimumLevel(int32 spell_id) { return GetSpellMinimumLevel(spell_id); } -int Perl__GetSpellResistType(uint16 spell_id) +int Perl__GetSpellResistType(int32 spell_id) { return GetSpellResistType(spell_id); } -int Perl__GetSpellTargetType(uint16 spell_id) +int Perl__GetSpellTargetType(int32 spell_id) { return GetSpellTargetType(spell_id); } -int Perl__GetSpellPartialMeleeRuneReduction(uint16 spell_id) +int Perl__GetSpellPartialMeleeRuneReduction(int32 spell_id) { return GetSpellPartialMeleeRuneReduction(spell_id); } -int Perl__GetSpellPartialMagicRuneReduction(uint16 spell_id) +int Perl__GetSpellPartialMagicRuneReduction(int32 spell_id) { return GetSpellPartialMagicRuneReduction(spell_id); } -int Perl__GetSpellPartialMeleeRuneAmount(uint16 spell_id) +int Perl__GetSpellPartialMeleeRuneAmount(int32 spell_id) { return GetSpellPartialMeleeRuneAmount(spell_id); } -int Perl__GetSpellPartialMagicRuneAmount(uint16 spell_id) +int Perl__GetSpellPartialMagicRuneAmount(int32 spell_id) { return GetSpellPartialMagicRuneAmount(spell_id); } -int Perl__GetSpellViralMinimumSpreadTime(uint16 spell_id) +int Perl__GetSpellViralMinimumSpreadTime(int32 spell_id) { return GetSpellViralMinimumSpreadTime(spell_id); } -int Perl__GetSpellViralMaximumSpreadTime(uint16 spell_id) +int Perl__GetSpellViralMaximumSpreadTime(int32 spell_id) { return GetSpellViralMaximumSpreadTime(spell_id); } -int Perl__GetSpellViralSpreadRange(uint16 spell_id) +int Perl__GetSpellViralSpreadRange(int32 spell_id) { return GetSpellViralSpreadRange(spell_id); } -int Perl__GetSpellProcLimitTimer(uint16 spell_id, int proc_type) +int Perl__GetSpellProcLimitTimer(int32 spell_id, int proc_type) { return GetSpellProcLimitTimer(spell_id, proc_type); } -int Perl__GetSpellEffectDescriptionNumber(uint16 spell_id) +int Perl__GetSpellEffectDescriptionNumber(int32 spell_id) { return GetSpellEffectDescriptionNumber(spell_id); } -int Perl__GetSpellFuriousBash(uint16 spell_id) +int Perl__GetSpellFuriousBash(int32 spell_id) { return GetSpellFuriousBash(spell_id); } -bool Perl__IsSpellUsableInThisZoneType(uint16 spell_id) +bool Perl__IsSpellUsableInThisZoneType(int32 spell_id) { return IsSpellUsableInThisZoneType(spell_id, zone->GetZoneType()); } -bool Perl__IsSpellUsableInThisZoneType(uint16 spell_id, uint8 zone_type) +bool Perl__IsSpellUsableInThisZoneType(int32 spell_id, uint8 zone_type) { return IsSpellUsableInThisZoneType(spell_id, zone_type); } -int Perl__GetSpellEffectIndex(uint16 spell_id, int effect_id) +int Perl__GetSpellEffectIndex(int32 spell_id, int effect_id) { return GetSpellEffectIndex(spell_id, effect_id); } -int Perl__CalculatePoisonCounters(uint16 spell_id) +int Perl__CalculatePoisonCounters(int32 spell_id) { return CalculatePoisonCounters(spell_id); } -int Perl__CalculateDiseaseCounters(uint16 spell_id) +int Perl__CalculateDiseaseCounters(int32 spell_id) { return CalculateDiseaseCounters(spell_id); } -int Perl__CalculateCurseCounters(uint16 spell_id) +int Perl__CalculateCurseCounters(int32 spell_id) { return CalculateCurseCounters(spell_id); } -int Perl__CalculateCorruptionCounters(uint16 spell_id) +int Perl__CalculateCorruptionCounters(int32 spell_id) { return CalculateCorruptionCounters(spell_id); } -int Perl__CalculateCounters(uint16 spell_id) +int Perl__CalculateCounters(int32 spell_id) { return CalculateCounters(spell_id); } -int8 Perl__GetSpellResurrectionSicknessCheck(uint16 spell_id_one, uint16 spell_id_two) +int8 Perl__GetSpellResurrectionSicknessCheck(int32 spell_id_one, int32 spell_id_two) { return GetSpellResurrectionSicknessCheck(spell_id_one, spell_id_two); } -int Perl__GetSpellNimbusEffect(uint16 spell_id) +int Perl__GetSpellNimbusEffect(int32 spell_id) { return GetSpellNimbusEffect(spell_id); } @@ -3049,12 +3049,12 @@ const int Perl__getitemstat(uint32 item_id, std::string identifier) return quest_manager.getitemstat(item_id, identifier); } -int Perl__getspellstat(uint32 spell_id, std::string stat_identifier) +int Perl__getspellstat(int32 spell_id, std::string stat_identifier) { return quest_manager.getspellstat(spell_id, stat_identifier); } -int Perl__getspellstat(uint32 spell_id, std::string stat_identifier, uint8 slot) +int Perl__getspellstat(int32 spell_id, std::string stat_identifier, uint8 slot) { return quest_manager.getspellstat(spell_id, stat_identifier, slot); } @@ -3246,32 +3246,32 @@ void Perl__crosszoneassigntaskbyclientname(const char* client_name, uint32 task_ quest_manager.CrossZoneTaskUpdate(CZUpdateType_ClientName, CZTaskUpdateSubtype_AssignTask, update_identifier, task_id, task_subidentifier, update_count, enforce_level_requirement, client_name); } -void Perl__crosszonecastspellbycharid(int character_id, uint32 spell_id) +void Perl__crosszonecastspellbycharid(int character_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Character, CZSpellUpdateSubtype_Cast, character_id, spell_id); } -void Perl__crosszonecastspellbygroupid(int group_id, uint32 spell_id) +void Perl__crosszonecastspellbygroupid(int group_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Group, CZSpellUpdateSubtype_Cast, group_id, spell_id); } -void Perl__crosszonecastspellbyraidid(int raid_id, uint32 spell_id) +void Perl__crosszonecastspellbyraidid(int raid_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Raid, CZSpellUpdateSubtype_Cast, raid_id, spell_id); } -void Perl__crosszonecastspellbyguildid(int guild_id, uint32 spell_id) +void Perl__crosszonecastspellbyguildid(int guild_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Guild, CZSpellUpdateSubtype_Cast, guild_id, spell_id); } -void Perl__crosszonecastspellbyexpeditionid(uint32 expedition_id, uint32 spell_id) +void Perl__crosszonecastspellbyexpeditionid(uint32 expedition_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Expedition, CZSpellUpdateSubtype_Cast, expedition_id, spell_id); } -void Perl__crosszonecastspellbyclientname(const char* client_name, uint32 spell_id) +void Perl__crosszonecastspellbyclientname(const char* client_name, int32 spell_id) { int update_identifier = 0; quest_manager.CrossZoneSpell(CZUpdateType_ClientName, CZSpellUpdateSubtype_Cast, update_identifier, spell_id, client_name); @@ -4037,32 +4037,32 @@ void Perl__crosszoneremoveldonwinbyclientname(const char* client_name, uint32 th quest_manager.CrossZoneLDoNUpdate(CZUpdateType_ClientName, CZLDoNUpdateSubtype_RemoveWin, update_identifier, theme_id, points, client_name); } -void Perl__crosszoneremovespellbycharid(int character_id, uint32 spell_id) +void Perl__crosszoneremovespellbycharid(int character_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Character, CZSpellUpdateSubtype_Remove, character_id, spell_id); } -void Perl__crosszoneremovespellbygroupid(int group_id, uint32 spell_id) +void Perl__crosszoneremovespellbygroupid(int group_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Group, CZSpellUpdateSubtype_Remove, group_id, spell_id); } -void Perl__crosszoneremovespellbyraidid(int raid_id, uint32 spell_id) +void Perl__crosszoneremovespellbyraidid(int raid_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Raid, CZSpellUpdateSubtype_Remove, raid_id, spell_id); } -void Perl__crosszoneremovespellbyguildid(int guild_id, uint32 spell_id) +void Perl__crosszoneremovespellbyguildid(int guild_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Guild, CZSpellUpdateSubtype_Remove, guild_id, spell_id); } -void Perl__crosszoneremovespellbyexpeditionid(uint32 expedition_id, uint32 spell_id) +void Perl__crosszoneremovespellbyexpeditionid(uint32 expedition_id, int32 spell_id) { quest_manager.CrossZoneSpell(CZUpdateType_Expedition, CZSpellUpdateSubtype_Remove, expedition_id, spell_id); } -void Perl__crosszoneremovespellbyclientname(const char* client_name, uint32 spell_id) +void Perl__crosszoneremovespellbyclientname(const char* client_name, int32 spell_id) { int update_identifier = 0; quest_manager.CrossZoneSpell(CZUpdateType_ClientName, CZSpellUpdateSubtype_Remove, update_identifier, spell_id, client_name); @@ -4394,17 +4394,17 @@ void Perl__worldwideassigntask(uint32 task_id, bool enforce_level_requirement, u quest_manager.WorldWideTaskUpdate(WWTaskUpdateType_AssignTask, task_id, task_subidentifier, update_count, enforce_level_requirement, min_status, max_status); } -void Perl__worldwidecastspell(uint32 spell_id) +void Perl__worldwidecastspell(int32 spell_id) { quest_manager.WorldWideSpell(WWSpellUpdateType_Cast, spell_id); } -void Perl__worldwidecastspell(uint32 spell_id, uint8 min_status) +void Perl__worldwidecastspell(int32 spell_id, uint8 min_status) { quest_manager.WorldWideSpell(WWSpellUpdateType_Cast, spell_id, min_status); } -void Perl__worldwidecastspell(uint32 spell_id, uint8 min_status, uint8 max_status) +void Perl__worldwidecastspell(int32 spell_id, uint8 min_status, uint8 max_status) { quest_manager.WorldWideSpell(WWSpellUpdateType_Cast, spell_id, min_status, max_status); } @@ -4586,17 +4586,17 @@ void Perl__worldwideremoveldonwin(uint32 theme_id, uint8 min_status, uint8 max_s quest_manager.WorldWideLDoNUpdate(CZLDoNUpdateSubtype_RemoveWin, theme_id, points, min_status, max_status); } -void Perl__worldwideremovespell(uint32 spell_id) +void Perl__worldwideremovespell(int32 spell_id) { quest_manager.WorldWideSpell(WWSpellUpdateType_Remove, spell_id); } -void Perl__worldwideremovespell(uint32 spell_id, uint8 min_status) +void Perl__worldwideremovespell(int32 spell_id, uint8 min_status) { quest_manager.WorldWideSpell(WWSpellUpdateType_Remove, spell_id, min_status); } -void Perl__worldwideremovespell(uint32 spell_id, uint8 min_status, uint8 max_status) +void Perl__worldwideremovespell(int32 spell_id, uint8 min_status, uint8 max_status) { quest_manager.WorldWideSpell(WWSpellUpdateType_Remove, spell_id, min_status, max_status); } @@ -4723,7 +4723,7 @@ uint32_t Perl__countspawnednpcs(perl::array npc_id_array) return entity_list.CountSpawnedNPCs(npc_ids); } -SPDat_Spell_Struct* Perl__getspell(uint32 spell_id) +SPDat_Spell_Struct* Perl__getspell(int32 spell_id) { // should be safe, it's read only in perl (could also use proxy lika lua) return const_cast(quest_manager.getspell(spell_id)); @@ -6320,8 +6320,8 @@ void perl_register_quest() package.add("IsShadowStepSpell", &Perl__IsShadowStepSpell); package.add("IsShortDurationBuff", &Perl__IsShortDurationBuff); package.add("IsSnowing", &Perl__IsSnowing); - package.add("IsSpellUsableInThisZoneType", (bool(*)(uint16))&Perl__IsSpellUsableInThisZoneType); - package.add("IsSpellUsableInThisZoneType", (bool(*)(uint16, uint8))&Perl__IsSpellUsableInThisZoneType); + package.add("IsSpellUsableInThisZoneType", (bool(*)(int32))&Perl__IsSpellUsableInThisZoneType); + package.add("IsSpellUsableInThisZoneType", (bool(*)(int32, uint8))&Perl__IsSpellUsableInThisZoneType); package.add("IsStackableDOT", &Perl__IsStackableDOT); package.add("IsStunSpell", &Perl__IsStunSpell); package.add("IsSuccorSpell", &Perl__IsSuccorSpell); @@ -6585,9 +6585,9 @@ void perl_register_quest() package.add("worldwideassigntask", (void(*)(uint32, bool))&Perl__worldwideassigntask); package.add("worldwideassigntask", (void(*)(uint32, bool, uint8))&Perl__worldwideassigntask); package.add("worldwideassigntask", (void(*)(uint32, bool, uint8, uint8))&Perl__worldwideassigntask); - package.add("worldwidecastspell", (void(*)(uint32))&Perl__worldwidecastspell); - package.add("worldwidecastspell", (void(*)(uint32, uint8))&Perl__worldwidecastspell); - package.add("worldwidecastspell", (void(*)(uint32, uint8, uint8 max_status))&Perl__worldwidecastspell); + package.add("worldwidecastspell", (void(*)(int32))&Perl__worldwidecastspell); + package.add("worldwidecastspell", (void(*)(int32, uint8))&Perl__worldwidecastspell); + package.add("worldwidecastspell", (void(*)(int32, uint8, uint8 max_status))&Perl__worldwidecastspell); package.add("worldwidedialoguewindow", (void(*)(const char*))&Perl__worldwidedialoguewindow); package.add("worldwidedialoguewindow", (void(*)(const char*, uint8))&Perl__worldwidedialoguewindow); package.add("worldwidedialoguewindow", (void(*)(const char*, uint8, uint8))&Perl__worldwidedialoguewindow); @@ -6618,9 +6618,9 @@ void perl_register_quest() package.add("worldwideremoveldonwin", (void(*)(uint32))&Perl__worldwideremoveldonwin); package.add("worldwideremoveldonwin", (void(*)(uint32, uint8))&Perl__worldwideremoveldonwin); package.add("worldwideremoveldonwin", (void(*)(uint32, uint8, uint8))&Perl__worldwideremoveldonwin); - package.add("worldwideremovespell", (void(*)(uint32))&Perl__worldwideremovespell); - package.add("worldwideremovespell", (void(*)(uint32, uint8))&Perl__worldwideremovespell); - package.add("worldwideremovespell", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovespell); + package.add("worldwideremovespell", (void(*)(int32))&Perl__worldwideremovespell); + package.add("worldwideremovespell", (void(*)(int32, uint8))&Perl__worldwideremovespell); + package.add("worldwideremovespell", (void(*)(int32, uint8, uint8))&Perl__worldwideremovespell); package.add("worldwideremovetask", (void(*)(uint32))&Perl__worldwideremovetask); package.add("worldwideremovetask", (void(*)(uint32, uint8))&Perl__worldwideremovetask); package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask); @@ -6753,8 +6753,8 @@ void perl_register_quest() package.add("getspell", &Perl__getspell); package.add("getspellname", &Perl__getspellname); package.add("get_spell_level", &Perl__get_spell_level); - package.add("getspellstat", (int(*)(uint32, std::string))&Perl__getspellstat); - package.add("getspellstat", (int(*)(uint32, std::string, uint8))&Perl__getspellstat); + package.add("getspellstat", (int(*)(int32, std::string))&Perl__getspellstat); + package.add("getspellstat", (int(*)(int32, std::string, uint8))&Perl__getspellstat); package.add("getskillname", &Perl__getskillname); package.add("get_timers", &Perl__get_timers); package.add("getlevel", &Perl__getlevel); diff --git a/zone/encounter.h b/zone/encounter.h index bd751fc04..07adf09ac 100644 --- a/zone/encounter.h +++ b/zone/encounter.h @@ -32,8 +32,8 @@ public: ~Encounter(); //abstract virtual function implementations required by base abstract class - virtual bool Death(Mob* killer_mob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false) { return true; } - virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; } + virtual bool Death(Mob* killer_mob, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false) { return true; } + virtual void Damage(Mob* from, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) { return; } bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) override { return false; diff --git a/zone/entity.h b/zone/entity.h index 318815266..72d87772f 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -445,13 +445,13 @@ public: void AESpell( Mob* caster, Mob* center, - uint16 spell_id, + int32 spell_id, bool affect_caster = true, int16 resist_adjust = 0, int* max_targets = nullptr, bool is_scripted = false ); - void MassGroupBuff(Mob* caster, Mob* center, uint16 spell_id, bool affect_caster = true); + void MassGroupBuff(Mob* caster, Mob* center, int32 spell_id, bool affect_caster = true); //trap stuff Mob* GetTrapTrigger(Trap* trap); diff --git a/zone/gm_commands/castspell.cpp b/zone/gm_commands/castspell.cpp index 00ad71dbc..0655d0b91 100755 --- a/zone/gm_commands/castspell.cpp +++ b/zone/gm_commands/castspell.cpp @@ -38,7 +38,7 @@ void command_castspell(Client *c, const Seperator *sep) t = c->GetTarget(); } - const uint16 spell_id = Strings::ToUnsignedInt(sep->arg[1]); + const int32 spell_id = Strings::ToInt(sep->arg[1]); if (spell_id >= SPDAT_RECORDS) { c->Message(Chat::White, "Invalid Spell ID."); diff --git a/zone/gm_commands/npccast.cpp b/zone/gm_commands/npccast.cpp index a0edb8ab2..45883c10b 100755 --- a/zone/gm_commands/npccast.cpp +++ b/zone/gm_commands/npccast.cpp @@ -27,7 +27,7 @@ void command_npccast(Client *c, const Seperator *sep) auto target = c->GetTarget()->CastToNPC(); if (!sep->IsNumber(1) && sep->arg[1] && sep->IsNumber(2)) { std::string entity_name = sep->arg[1] ? sep->arg[1] : 0; - auto spell_id = sep->arg[2] ? Strings::ToUnsignedInt(sep->arg[2]) : 0; + int32 spell_id = sep->arg[2] ? Strings::ToInt(sep->arg[2]) : 0; auto spell_target = entity_list.GetMob(entity_name.c_str()); if (spell_target && IsValidSpell(spell_id) && spell_id < SPDAT_RECORDS) { c->Message( @@ -35,7 +35,7 @@ void command_npccast(Client *c, const Seperator *sep) fmt::format( "{} casting {} ({}) on {}.", c->GetTargetDescription(target), - GetSpellName(static_cast(spell_id)), + GetSpellName(spell_id), spell_id, c->GetTargetDescription(spell_target) ).c_str() @@ -63,7 +63,7 @@ void command_npccast(Client *c, const Seperator *sep) } } else if (sep->IsNumber(1) && sep->IsNumber(2)) { uint16 entity_id = static_cast(Strings::ToUnsignedInt(sep->arg[1])); - auto spell_id = Strings::ToUnsignedInt(sep->arg[2]); + int32 spell_id = Strings::ToInt(sep->arg[2]); auto spell_target = entity_list.GetMob(entity_id); if (spell_target && IsValidSpell(spell_id) && spell_id < SPDAT_RECORDS) { c->Message( @@ -71,7 +71,7 @@ void command_npccast(Client *c, const Seperator *sep) fmt::format( "{} casting {} ({}) on {}.", c->GetTargetDescription(target), - GetSpellName(static_cast(spell_id)), + GetSpellName(spell_id), spell_id, c->GetTargetDescription(spell_target) ).c_str() diff --git a/zone/gm_commands/unscribespell.cpp b/zone/gm_commands/unscribespell.cpp index 8e4bf2313..63f6b51b2 100755 --- a/zone/gm_commands/unscribespell.cpp +++ b/zone/gm_commands/unscribespell.cpp @@ -31,7 +31,7 @@ void command_unscribespell(Client *c, const Seperator *sep) t = c->GetTarget()->CastToClient(); } - const uint16 spell_id = EQ::Clamp(Strings::ToInt(sep->arg[1]), 0, 65535); + const int32 spell_id = Strings::ToInt(sep->arg[1]); if (!IsValidSpell(spell_id)) { c->Message( diff --git a/zone/gm_commands/untraindisc.cpp b/zone/gm_commands/untraindisc.cpp index 69a33f1e7..90cd15dca 100755 --- a/zone/gm_commands/untraindisc.cpp +++ b/zone/gm_commands/untraindisc.cpp @@ -31,7 +31,7 @@ void command_untraindisc(Client *c, const Seperator *sep) target = c->GetTarget()->CastToClient(); } - uint16 spell_id = EQ::Clamp(Strings::ToInt(sep->arg[1]), 0, 65535); + int32 spell_id = Strings::ToInt(sep->arg[1]); if (!IsValidSpell(spell_id)) { c->Message( diff --git a/zone/groups.cpp b/zone/groups.cpp index e15ba4b85..e8534527f 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -810,7 +810,7 @@ bool Group::DelMember(Mob* oldmember, bool ignoresender) return true; } -void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { +void Group::CastGroupSpell(Mob* caster, int32 spell_id) { uint32 z; float range, distance; diff --git a/zone/groups.h b/zone/groups.h index 3af6d68aa..50c2c7ac1 100644 --- a/zone/groups.h +++ b/zone/groups.h @@ -77,7 +77,7 @@ public: bool IsGroupMember(const char* name); bool Process(); void SendGroupJoinOOZ(Mob* NewMember); - void CastGroupSpell(Mob* caster,uint16 spellid); + void CastGroupSpell(Mob* caster,int32 spellid); void SplitExp(ExpSource exp_source, const uint64 exp, Mob* other); void GroupMessage(Mob* sender,uint8 language,uint8 lang_skill,const char* message); void GroupMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); diff --git a/zone/hate_list.cpp b/zone/hate_list.cpp index 4b3a296be..f429f31f7 100644 --- a/zone/hate_list.cpp +++ b/zone/hate_list.cpp @@ -800,7 +800,7 @@ int HateList::AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOption return hit_count; } -void HateList::SpellCast(Mob *caster, uint32 spell_id, float range, Mob* ae_center) +void HateList::SpellCast(Mob *caster, int32 spell_id, float range, Mob* ae_center) { if (!caster) return; diff --git a/zone/hate_list.h b/zone/hate_list.h index ac8cf7a2a..58e077031 100644 --- a/zone/hate_list.h +++ b/zone/hate_list.h @@ -92,7 +92,7 @@ public: void PrintHateListToClient(Client *c); void SetHateAmountOnEnt(Mob *other, int64 in_hate, uint64 in_damage); void SetHateOwner(Mob *new_hate_owner) { hate_owner = new_hate_owner; } - void SpellCast(Mob *caster, uint32 spell_id, float range, Mob *ae_center = nullptr); + void SpellCast(Mob *caster, int32 spell_id, float range, Mob *ae_center = nullptr); void WipeHateList(bool npc_only = false); void RemoveStaleEntries(int time_ms, float dist); diff --git a/zone/horse.cpp b/zone/horse.cpp index 275148d8c..1d7976148 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -30,7 +30,7 @@ std::map Horse::horse_types; Horse::Horse( Client *c, - uint16 spell_id, + int32 spell_id, const glm::vec4& position ) : NPC( GetHorseType(spell_id), @@ -52,12 +52,12 @@ void Horse::FillSpawnStruct(NewSpawn_Struct* ns, Mob* m) { ns->spawn.runspeed = NPCTypedata->runspeed; } -bool Horse::IsHorseSpell(uint16 spell_id) +bool Horse::IsHorseSpell(int32 spell_id) { return GetHorseType(spell_id); } -const NPCType *Horse::GetHorseType(uint16 spell_id) +const NPCType *Horse::GetHorseType(int32 spell_id) { if (horse_types.count(spell_id)) { return horse_types[spell_id]; @@ -70,7 +70,7 @@ const NPCType *Horse::GetHorseType(uint16 spell_id) return n; } -const NPCType *Horse::BuildHorseType(uint16 spell_id) +const NPCType *Horse::BuildHorseType(int32 spell_id) { const auto& l = HorsesRepository::GetWhere( content_db, @@ -119,7 +119,7 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) return n; } -void Client::SummonHorse(uint16 spell_id) +void Client::SummonHorse(int32 spell_id) { if (GetHorseId()) { MessageString(Chat::Red, ALREADY_ON_A_MOUNT); diff --git a/zone/horse.h b/zone/horse.h index 48867e7e5..3ac171ea9 100644 --- a/zone/horse.h +++ b/zone/horse.h @@ -29,15 +29,15 @@ struct NewSpawn_Struct; class Horse : public NPC { public: - Horse(Client* c, uint16 spell_id, const glm::vec4& position); + Horse(Client* c, int32 spell_id, const glm::vec4& position); virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* m); - static bool IsHorseSpell(uint16 spell_id); + static bool IsHorseSpell(int32 spell_id); protected: Client* owner; static std::map horse_types; - static const NPCType* GetHorseType(uint16 spell_id); - static const NPCType* BuildHorseType(uint16 spell_id); + static const NPCType* GetHorseType(int32 spell_id); + static const NPCType* BuildHorseType(int32 spell_id); }; diff --git a/zone/lua_bot.cpp b/zone/lua_bot.cpp index 162c0e004..66d1d56e3 100644 --- a/zone/lua_bot.cpp +++ b/zone/lua_bot.cpp @@ -143,7 +143,7 @@ void Lua_Bot::ReloadBotSpellSettings() { self->LoadBotSpellSettings(); } -bool Lua_Bot::HasBotSpellEntry(uint16 spellid) { +bool Lua_Bot::HasBotSpellEntry(int32 spellid) { Lua_Safe_Call_Bool(); return self->HasBotSpellEntry(spellid); } @@ -407,7 +407,7 @@ void Lua_Bot::ClearDisciplineReuseTimer() { return self->ClearDisciplineReuseTimer(); } -void Lua_Bot::ClearDisciplineReuseTimer(uint16 spell_id) { +void Lua_Bot::ClearDisciplineReuseTimer(int32 spell_id) { Lua_Safe_Call_Void(); return self->ClearDisciplineReuseTimer(spell_id); } @@ -427,7 +427,7 @@ void Lua_Bot::ClearSpellRecastTimer() { return self->ClearSpellRecastTimer(); } -void Lua_Bot::ClearSpellRecastTimer(uint16 spell_id) { +void Lua_Bot::ClearSpellRecastTimer(int32 spell_id) { Lua_Safe_Call_Void(); return self->ClearSpellRecastTimer(spell_id); } @@ -437,7 +437,7 @@ uint32 Lua_Bot::GetDisciplineReuseTimer() { return self->GetDisciplineReuseRemainingTime(); } -uint32 Lua_Bot::GetDisciplineReuseTimer(uint16 spell_id) { +uint32 Lua_Bot::GetDisciplineReuseTimer(int32 spell_id) { Lua_Safe_Call_Int(); return self->GetDisciplineReuseRemainingTime(spell_id); } @@ -457,17 +457,17 @@ uint32 Lua_Bot::GetSpellRecastTimer() { return self->GetSpellRecastRemainingTime(); } -uint32 Lua_Bot::GetSpellRecastTimer(uint16 spell_id) { +uint32 Lua_Bot::GetSpellRecastTimer(int32 spell_id) { Lua_Safe_Call_Int(); return self->GetSpellRecastRemainingTime(spell_id); } -void Lua_Bot::SetDisciplineReuseTimer(uint16 spell_id) { +void Lua_Bot::SetDisciplineReuseTimer(int32 spell_id) { Lua_Safe_Call_Void(); return self->SetDisciplineReuseTimer(spell_id); } -void Lua_Bot::SetDisciplineReuseTimer(uint16 spell_id, uint32 reuse_timer) { +void Lua_Bot::SetDisciplineReuseTimer(int32 spell_id, uint32 reuse_timer) { Lua_Safe_Call_Void(); return self->SetDisciplineReuseTimer(spell_id, reuse_timer); } @@ -482,12 +482,12 @@ void Lua_Bot::SetItemReuseTimer(uint32 item_id, uint32 reuse_timer) { return self->SetItemReuseTimer(item_id, reuse_timer); } -void Lua_Bot::SetSpellRecastTimer(uint16 spell_id) { +void Lua_Bot::SetSpellRecastTimer(int32 spell_id) { Lua_Safe_Call_Void(); return self->SetSpellRecastTimer(spell_id); } -void Lua_Bot::SetSpellRecastTimer(uint16 spell_id, uint32 recast_delay) { +void Lua_Bot::SetSpellRecastTimer(int32 spell_id, uint32 recast_delay) { Lua_Safe_Call_Void(); return self->SetSpellRecastTimer(spell_id, recast_delay); } @@ -560,7 +560,7 @@ Lua_ItemInst Lua_Bot::GetItemAt(int16 slot_id) // @categories Inventory and Item return Lua_ItemInst(self->GetInv().GetItem(slot_id)); } -void Lua_Bot::SendSpellAnim(uint16 target_id, uint16 spell_id) +void Lua_Bot::SendSpellAnim(uint16 target_id, int32 spell_id) { Lua_Safe_Call_Void(); self->SendSpellAnim(target_id, spell_id); @@ -715,11 +715,11 @@ luabind::scope lua_register_bot() { .def("Camp", (void(Lua_Bot::*)(void))&Lua_Bot::Camp) .def("Camp", (void(Lua_Bot::*)(bool))&Lua_Bot::Camp) .def("ClearDisciplineReuseTimer", (void(Lua_Bot::*)())&Lua_Bot::ClearDisciplineReuseTimer) - .def("ClearDisciplineReuseTimer", (void(Lua_Bot::*)(uint16))&Lua_Bot::ClearDisciplineReuseTimer) + .def("ClearDisciplineReuseTimer", (void(Lua_Bot::*)(int32))&Lua_Bot::ClearDisciplineReuseTimer) .def("ClearItemReuseTimer", (void(Lua_Bot::*)())&Lua_Bot::ClearItemReuseTimer) .def("ClearItemReuseTimer", (void(Lua_Bot::*)(uint32))&Lua_Bot::ClearItemReuseTimer) .def("ClearSpellRecastTimer", (void(Lua_Bot::*)())&Lua_Bot::ClearSpellRecastTimer) - .def("ClearSpellRecastTimer", (void(Lua_Bot::*)(uint16))&Lua_Bot::ClearSpellRecastTimer) + .def("ClearSpellRecastTimer", (void(Lua_Bot::*)(int32))&Lua_Bot::ClearSpellRecastTimer) .def("CountAugmentEquippedByID", (uint32(Lua_Bot::*)(uint32))&Lua_Bot::CountAugmentEquippedByID) .def("CountBotItem", (uint32(Lua_Bot::*)(uint32))&Lua_Bot::CountBotItem) .def("CountItemEquippedByID", (uint32(Lua_Bot::*)(uint32))&Lua_Bot::CountItemEquippedByID) @@ -746,7 +746,7 @@ luabind::scope lua_register_bot() { .def("GetBotItem", (Lua_ItemInst(Lua_Bot::*)(uint16))&Lua_Bot::GetBotItem) .def("GetBotItemIDBySlot", (uint32(Lua_Bot::*)(uint16))&Lua_Bot::GetBotItemIDBySlot) .def("GetDisciplineReuseTimer", (uint32(Lua_Bot::*)())&Lua_Bot::GetDisciplineReuseTimer) - .def("GetDisciplineReuseTimer", (uint32(Lua_Bot::*)(uint16))&Lua_Bot::GetDisciplineReuseTimer) + .def("GetDisciplineReuseTimer", (uint32(Lua_Bot::*)(int32))&Lua_Bot::GetDisciplineReuseTimer) .def("GetBucket", (std::string(Lua_Bot::*)(std::string))&Lua_Bot::GetBucket) .def("GetBucketExpires", (std::string(Lua_Bot::*)(std::string))&Lua_Bot::GetBucketExpires) .def("GetBucketRemaining", (std::string(Lua_Bot::*)(std::string))&Lua_Bot::GetBucketRemaining) @@ -764,7 +764,7 @@ luabind::scope lua_register_bot() { .def("GetRawItemAC", (int(Lua_Bot::*)(void))&Lua_Bot::GetRawItemAC) .def("GetSpellDamage", (int(Lua_Bot::*)(void))&Lua_Bot::GetSpellDamage) .def("GetSpellRecastTimer", (uint32(Lua_Bot::*)())&Lua_Bot::GetSpellRecastTimer) - .def("GetSpellRecastTimer", (uint32(Lua_Bot::*)(uint16))&Lua_Bot::GetSpellRecastTimer) + .def("GetSpellRecastTimer", (uint32(Lua_Bot::*)(int32))&Lua_Bot::GetSpellRecastTimer) .def("HasAugmentEquippedByID", (bool(Lua_Bot::*)(uint32))&Lua_Bot::HasAugmentEquippedByID) .def("HasBotItem", (int16(Lua_Bot::*)(uint32))&Lua_Bot::HasBotItem) .def("HasBotSpellEntry", (bool(Lua_Bot::*)(uint16))&Lua_Bot::HasBotSpellEntry) @@ -782,8 +782,8 @@ luabind::scope lua_register_bot() { .def("SetBucket", (void(Lua_Bot::*)(std::string,std::string))&Lua_Bot::SetBucket) .def("SetBucket", (void(Lua_Bot::*)(std::string,std::string,std::string))&Lua_Bot::SetBucket) .def("SetExpansionBitmask", (void(Lua_Bot::*)(int))&Lua_Bot::SetExpansionBitmask) - .def("SetDisciplineReuseTimer", (void(Lua_Bot::*)(uint16))&Lua_Bot::SetDisciplineReuseTimer) - .def("SetDisciplineReuseTimer", (void(Lua_Bot::*)(uint16, uint32))&Lua_Bot::SetDisciplineReuseTimer) + .def("SetDisciplineReuseTimer", (void(Lua_Bot::*)(int32))&Lua_Bot::SetDisciplineReuseTimer) + .def("SetDisciplineReuseTimer", (void(Lua_Bot::*)(int32, uint32))&Lua_Bot::SetDisciplineReuseTimer) .def("SetItemReuseTimer", (void(Lua_Bot::*)(uint32))&Lua_Bot::SetItemReuseTimer) .def("SetItemReuseTimer", (void(Lua_Bot::*)(uint32, uint32))&Lua_Bot::SetItemReuseTimer) .def("SetSpellDuration", (void(Lua_Bot::*)(int))&Lua_Bot::SetSpellDuration) @@ -799,8 +799,8 @@ luabind::scope lua_register_bot() { .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,int))&Lua_Bot::SetSpellDurationRaid) .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,int,bool))&Lua_Bot::SetSpellDurationRaid) .def("SetSpellDurationRaid", (void(Lua_Bot::*)(int,int,int,bool,bool))&Lua_Bot::SetSpellDurationRaid) - .def("SetSpellRecastTimer", (void(Lua_Bot::*)(uint16))&Lua_Bot::SetSpellRecastTimer) - .def("SetSpellRecastTimer", (void(Lua_Bot::*)(uint16, uint32))&Lua_Bot::SetSpellRecastTimer) + .def("SetSpellRecastTimer", (void(Lua_Bot::*)(int32))&Lua_Bot::SetSpellRecastTimer) + .def("SetSpellRecastTimer", (void(Lua_Bot::*)(int32, uint32))&Lua_Bot::SetSpellRecastTimer) .def("SendPayload", (void(Lua_Bot::*)(int))&Lua_Bot::SendPayload) .def("SendPayload", (void(Lua_Bot::*)(int,std::string))&Lua_Bot::SendPayload) .def("Signal", (void(Lua_Bot::*)(int))&Lua_Bot::Signal) diff --git a/zone/lua_bot.h b/zone/lua_bot.h index 374835fc4..8179cd52d 100644 --- a/zone/lua_bot.h +++ b/zone/lua_bot.h @@ -70,7 +70,7 @@ public: void RemoveBotItem(uint32 item_id); void SetExpansionBitmask(int expansion_bitmask); void Signal(int signal_id); - bool HasBotSpellEntry(uint16 spellid); + bool HasBotSpellEntry(int32 spellid); void SendPayload(int payload_id); void SendPayload(int payload_id, std::string payload_value); uint32 GetBotID(); @@ -82,7 +82,7 @@ public: luabind::object GetAugmentIDsBySlotID(lua_State* L, int16 slot_id) const; Lua_ItemInst GetItemAt(int16 slot_id); int GetItemIDAt(int16 slot_id); - void SendSpellAnim(uint16 target_id, uint16 spell_id); + void SendSpellAnim(uint16 target_id, int32 spell_id); std::string GetClassAbbreviation(); std::string GetRaceAbbreviation(); void DeleteBucket(std::string bucket_name); @@ -125,23 +125,23 @@ public: void SetSpellDurationRaid(int spell_id, int duration, int level, bool allow_pets, bool is_raid_group_only); void ClearDisciplineReuseTimer(); - void ClearDisciplineReuseTimer(uint16 spell_id); + void ClearDisciplineReuseTimer(int32 spell_id); void ClearItemReuseTimer(); void ClearItemReuseTimer(uint32 item_id); void ClearSpellRecastTimer(); - void ClearSpellRecastTimer(uint16 spell_id); + void ClearSpellRecastTimer(int32 spell_id); uint32 GetDisciplineReuseTimer(); - uint32 GetDisciplineReuseTimer(uint16 spell_id); + uint32 GetDisciplineReuseTimer(int32 spell_id); uint32 GetItemReuseTimer(); uint32 GetItemReuseTimer(uint32 item_id); uint32 GetSpellRecastTimer(); - uint32 GetSpellRecastTimer(uint16 spell_id); - void SetDisciplineReuseTimer(uint16 spell_id); - void SetDisciplineReuseTimer(uint16 spell_id, uint32 reuse_timer); + uint32 GetSpellRecastTimer(int32 spell_id); + void SetDisciplineReuseTimer(int32 spell_id); + void SetDisciplineReuseTimer(int32 spell_id, uint32 reuse_timer); void SetItemReuseTimer(uint32 item_id); void SetItemReuseTimer(uint32 item_id, uint32 reuse_timer); - void SetSpellRecastTimer(uint16 spell_id); - void SetSpellRecastTimer(uint16 spell_id, uint32 reuse_timer); + void SetSpellRecastTimer(int32 spell_id); + void SetSpellRecastTimer(int32 spell_id, uint32 reuse_timer); uint32 CountAugmentEquippedByID(uint32 item_id); uint32 CountItemEquippedByID(uint32 item_id); diff --git a/zone/lua_buff.cpp b/zone/lua_buff.cpp index 91dadf7c1..f001aa48c 100644 --- a/zone/lua_buff.cpp +++ b/zone/lua_buff.cpp @@ -107,7 +107,7 @@ int16 Lua_Buff::GetRootBreakChance() return self->RootBreakChance; } -uint16 Lua_Buff::GetSpellID() +int32 Lua_Buff::GetSpellID() { Lua_Safe_Call_Int(); return self->spellid; diff --git a/zone/lua_buff.h b/zone/lua_buff.h index 3b79b1078..3139531d5 100644 --- a/zone/lua_buff.h +++ b/zone/lua_buff.h @@ -56,7 +56,7 @@ public: uint32 GetMeleeRune(); uint32 GetNumberOfHits(); int16 GetRootBreakChance(); - uint16 GetSpellID(); + int32 GetSpellID(); int GetTicsRemaining(); int GetVirusSpreadTime(); bool IsCasterClient(); diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 9092c9678..bab960d1f 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -647,7 +647,7 @@ uint16 Lua_Client::FindMemmedSpellBySlot(int slot) { return self->FindMemmedSpellBySlot(slot); } -int Lua_Client::FindMemmedSpellBySpellID(uint16 spell_id) { +int Lua_Client::FindMemmedSpellBySpellID(int32 spell_id) { Lua_Safe_Call_Int(); return self->FindMemmedSpellBySpellID(spell_id); } @@ -1083,7 +1083,7 @@ bool Lua_Client::UseDiscipline(int spell_id, int target_id) { return self->UseDiscipline(spell_id, target_id); } -bool Lua_Client::HasDisciplineLearned(uint16 spell_id) { +bool Lua_Client::HasDisciplineLearned(int32 spell_id) { Lua_Safe_Call_Bool(); return self->HasDisciplineLearned(spell_id); } @@ -1377,7 +1377,7 @@ int Lua_Client::GetNextAvailableSpellBookSlot() { return self->GetNextAvailableSpellBookSlot(); } -uint32 Lua_Client::GetSpellIDByBookSlot(int slot_id) { +int32 Lua_Client::GetSpellIDByBookSlot(int slot_id) { Lua_Safe_Call_Int(); return self->GetSpellIDByBookSlot(slot_id); } @@ -2320,12 +2320,12 @@ int16 Lua_Client::GetGMStatus() { return self->Admin(); } -void Lua_Client::UntrainDiscBySpellID(uint16 spell_id) { +void Lua_Client::UntrainDiscBySpellID(int32 spell_id) { Lua_Safe_Call_Void(); self->UntrainDiscBySpellID(spell_id); } -void Lua_Client::UntrainDiscBySpellID(uint16 spell_id, bool update_client) { +void Lua_Client::UntrainDiscBySpellID(int32 spell_id, bool update_client) { Lua_Safe_Call_Void(); self->UntrainDiscBySpellID(spell_id, update_client); } @@ -2422,17 +2422,17 @@ void Lua_Client::ResetAllCastbarCooldowns() { self->ResetAllCastbarCooldowns(); } -void Lua_Client::ResetCastbarCooldownBySpellID(uint32 spell_id) { +void Lua_Client::ResetCastbarCooldownBySpellID(int32 spell_id) { Lua_Safe_Call_Void(); self->ResetCastbarCooldownBySpellID(spell_id); } -void Lua_Client::UnscribeSpellBySpellID(uint16 spell_id) { +void Lua_Client::UnscribeSpellBySpellID(int32 spell_id) { Lua_Safe_Call_Void(); self->UnscribeSpellBySpellID(spell_id); } -void Lua_Client::UnscribeSpellBySpellID(uint16 spell_id, bool update_client) { +void Lua_Client::UnscribeSpellBySpellID(int32 spell_id, bool update_client) { Lua_Safe_Call_Void(); self->UnscribeSpellBySpellID(spell_id, update_client); } @@ -3760,7 +3760,7 @@ luabind::scope lua_register_client() { .def("FilteredMessage", &Lua_Client::FilteredMessage) .def("FindEmptyMemSlot", (int(Lua_Client::*)(void))&Lua_Client::FindEmptyMemSlot) .def("FindMemmedSpellBySlot", (uint16(Lua_Client::*)(int))&Lua_Client::FindMemmedSpellBySlot) - .def("FindMemmedSpellBySpellID", (int(Lua_Client::*)(uint16))&Lua_Client::FindMemmedSpellBySpellID) + .def("FindMemmedSpellBySpellID", (int(Lua_Client::*)(int32 ))&Lua_Client::FindMemmedSpellBySpellID) .def("FindSpellBookSlotBySpellID", (int(Lua_Client::*)(int))&Lua_Client::FindSpellBookSlotBySpellID) .def("Fling", (void(Lua_Client::*)(float,float,float))&Lua_Client::Fling) .def("Fling", (void(Lua_Client::*)(float,float,float,bool))&Lua_Client::Fling) @@ -3914,7 +3914,7 @@ luabind::scope lua_register_client() { .def("GetSkillPoints", (int(Lua_Client::*)(void))&Lua_Client::GetSkillPoints) .def("GetSkillTrainLevel", (uint8(Lua_Client::*)(int))&Lua_Client::GetSkillTrainLevel) .def("GetSpellDamage", (int(Lua_Client::*)(void))&Lua_Client::GetSpellDamage) - .def("GetSpellIDByBookSlot", (uint32(Lua_Client::*)(int))&Lua_Client::GetSpellIDByBookSlot) + .def("GetSpellIDByBookSlot", (int32 (Lua_Client::*)(int))&Lua_Client::GetSpellIDByBookSlot) .def("GetSpentAA", (int(Lua_Client::*)(void))&Lua_Client::GetSpentAA) .def("GetStartZone", (int(Lua_Client::*)(void))&Lua_Client::GetStartZone) .def("GetTargetRingX", (float(Lua_Client::*)(void))&Lua_Client::GetTargetRingX) @@ -4065,7 +4065,7 @@ luabind::scope lua_register_client() { .def("ResetAllCastbarCooldowns", (void(Lua_Client::*)(void))&Lua_Client::ResetAllCastbarCooldowns) .def("ResetAlternateAdvancementRank", &Lua_Client::ResetAlternateAdvancementRank) .def("ResetCastbarCooldownBySlot", (void(Lua_Client::*)(int))&Lua_Client::ResetCastbarCooldownBySlot) - .def("ResetCastbarCooldownBySpellID", (void(Lua_Client::*)(uint32))&Lua_Client::ResetCastbarCooldownBySpellID) + .def("ResetCastbarCooldownBySpellID", (void(Lua_Client::*)(int32 ))&Lua_Client::ResetCastbarCooldownBySpellID) .def("ResetDisciplineTimer", (void(Lua_Client::*)(uint32))&Lua_Client::ResetDisciplineTimer) .def("ResetItemCooldown", (void(Lua_Client::*)(uint32))&Lua_Client::ResetItemCooldown) .def("ResetLeadershipAA", (void(Lua_Client::*)(void))&Lua_Client::ResetLeadershipAA) @@ -4229,14 +4229,14 @@ luabind::scope lua_register_client() { .def("UnscribeSpell", (void(Lua_Client::*)(int,bool))&Lua_Client::UnscribeSpell) .def("UnscribeSpellAll", (void(Lua_Client::*)(bool))&Lua_Client::UnscribeSpellAll) .def("UnscribeSpellAll", (void(Lua_Client::*)(void))&Lua_Client::UnscribeSpellAll) - .def("UnscribeSpellBySpellID", (void(Lua_Client::*)(uint16))&Lua_Client::UnscribeSpellBySpellID) - .def("UnscribeSpellBySpellID", (void(Lua_Client::*)(uint16,bool))&Lua_Client::UnscribeSpellBySpellID) + .def("UnscribeSpellBySpellID", (void(Lua_Client::*)(int32 ))&Lua_Client::UnscribeSpellBySpellID) + .def("UnscribeSpellBySpellID", (void(Lua_Client::*)(int32 ,bool))&Lua_Client::UnscribeSpellBySpellID) .def("UntrainDisc", (void(Lua_Client::*)(int))&Lua_Client::UntrainDisc) .def("UntrainDisc", (void(Lua_Client::*)(int,bool))&Lua_Client::UntrainDisc) .def("UntrainDiscAll", (void(Lua_Client::*)(bool))&Lua_Client::UntrainDiscAll) .def("UntrainDiscAll", (void(Lua_Client::*)(void))&Lua_Client::UntrainDiscAll) - .def("UntrainDiscBySpellID", (void(Lua_Client::*)(uint16))&Lua_Client::UntrainDiscBySpellID) - .def("UntrainDiscBySpellID", (void(Lua_Client::*)(uint16,bool))&Lua_Client::UntrainDiscBySpellID) + .def("UntrainDiscBySpellID", (void(Lua_Client::*)(int32 ))&Lua_Client::UntrainDiscBySpellID) + .def("UntrainDiscBySpellID", (void(Lua_Client::*)(int32 ,bool))&Lua_Client::UntrainDiscBySpellID) .def("UpdateAdmin", (void(Lua_Client::*)(void))&Lua_Client::UpdateAdmin) .def("UpdateAdmin", (void(Lua_Client::*)(bool))&Lua_Client::UpdateAdmin) .def("UpdateGroupAAs", (void(Lua_Client::*)(int,uint32))&Lua_Client::UpdateGroupAAs) diff --git a/zone/lua_client.h b/zone/lua_client.h index 53955528d..72055682f 100644 --- a/zone/lua_client.h +++ b/zone/lua_client.h @@ -214,7 +214,7 @@ public: void UnmemSpellAll(bool update_client); int FindEmptyMemSlot(); uint16 FindMemmedSpellBySlot(int slot); - int FindMemmedSpellBySpellID(uint16 spell_id); + int FindMemmedSpellBySpellID(int32 spell_id); int MemmedCount(); luabind::object GetLearnableDisciplines(lua_State* L); luabind::object GetLearnableDisciplines(lua_State* L, uint8 min_level); @@ -232,16 +232,16 @@ public: void UnscribeSpell(int slot, bool update_client); void UnscribeSpellAll(); void UnscribeSpellAll(bool update_client); - void UnscribeSpellBySpellID(uint16 spell_id); - void UnscribeSpellBySpellID(uint16 spell_id, bool update_client); + void UnscribeSpellBySpellID(int32 spell_id); + void UnscribeSpellBySpellID(int32 spell_id, bool update_client); void TrainDisc(int itemid); uint16 LearnDisciplines(uint8 min_level, uint8 max_level); void TrainDiscBySpellID(int32 spell_id); int GetDiscSlotBySpellID(int32 spell_id); void UntrainDisc(int slot); void UntrainDisc(int slot, bool update_client); - void UntrainDiscBySpellID(uint16 spell_id); - void UntrainDiscBySpellID(uint16 spell_id, bool update_client); + void UntrainDiscBySpellID(int32 spell_id); + void UntrainDiscBySpellID(int32 spell_id, bool update_client); void UntrainDiscAll(); void UntrainDiscAll(bool update_client); bool IsStanding(); @@ -294,10 +294,10 @@ public: void ResetDisciplineTimer(uint32 timer_id); void ResetCastbarCooldownBySlot(int slot); void ResetAllCastbarCooldowns(); - void ResetCastbarCooldownBySpellID(uint32 spell_id); + void ResetCastbarCooldownBySpellID(int32 spell_id); void ResetAllDisciplineTimers(); bool UseDiscipline(int spell_id, int target_id); - bool HasDisciplineLearned(uint16 spell_id); + bool HasDisciplineLearned(int32 spell_id); int GetCharacterFactionLevel(int faction_id); void ClearZoneFlag(uint32 zone_id); bool HasZoneFlag(uint32 zone_id); @@ -369,7 +369,7 @@ public: int GetNextAvailableSpellBookSlot(int start); int GetNextAvailableDisciplineSlot(); int GetNextAvailableDisciplineSlot(int starting_slot); - uint32 GetSpellIDByBookSlot(int book_slot); + int32 GetSpellIDByBookSlot(int book_slot); int FindSpellBookSlotBySpellID(int spell_id); void UpdateTaskActivity(int task, int activity, int count); void AssignTask(int task_id); diff --git a/zone/lua_entity_list.cpp b/zone/lua_entity_list.cpp index c1d58d36f..85630acf5 100644 --- a/zone/lua_entity_list.cpp +++ b/zone/lua_entity_list.cpp @@ -729,25 +729,25 @@ void Lua_EntityList::AreaAttack(Lua_Mob attacker, float distance, int16 slot_id, self->AEAttack(attacker, distance, slot_id, count, is_from_spell, attack_rounds); } -void Lua_EntityList::AreaSpell(Lua_Mob caster, Lua_Mob center, uint16 spell_id) +void Lua_EntityList::AreaSpell(Lua_Mob caster, Lua_Mob center, int32 spell_id) { Lua_Safe_Call_Void(); self->AESpell(caster, center, spell_id); } -void Lua_EntityList::AreaSpell(Lua_Mob caster, Lua_Mob center, uint16 spell_id, bool affect_caster) +void Lua_EntityList::AreaSpell(Lua_Mob caster, Lua_Mob center, int32 spell_id, bool affect_caster) { Lua_Safe_Call_Void(); self->AESpell(caster, center, spell_id, affect_caster); } -void Lua_EntityList::AreaSpell(Lua_Mob caster, Lua_Mob center, uint16 spell_id, bool affect_caster, int16 resist_adjust) +void Lua_EntityList::AreaSpell(Lua_Mob caster, Lua_Mob center, int32 spell_id, bool affect_caster, int16 resist_adjust) { Lua_Safe_Call_Void(); self->AESpell(caster, center, spell_id, affect_caster, resist_adjust); } -void Lua_EntityList::AreaSpell(Lua_Mob caster, Lua_Mob center, uint16 spell_id, bool affect_caster, int16 resist_adjust, int max_targets) +void Lua_EntityList::AreaSpell(Lua_Mob caster, Lua_Mob center, int32 spell_id, bool affect_caster, int16 resist_adjust, int max_targets) { Lua_Safe_Call_Void(); self->AESpell(caster, center, spell_id, affect_caster, resist_adjust, &max_targets); @@ -771,13 +771,13 @@ void Lua_EntityList::AreaTaunt(Lua_Client caster, float range, int bonus_hate) self->AETaunt(caster, range, bonus_hate); } -void Lua_EntityList::MassGroupBuff(Lua_Mob caster, Lua_Mob center, uint16 spell_id) +void Lua_EntityList::MassGroupBuff(Lua_Mob caster, Lua_Mob center, int32 spell_id) { Lua_Safe_Call_Void(); self->MassGroupBuff(caster, center, spell_id); } -void Lua_EntityList::MassGroupBuff(Lua_Mob caster, Lua_Mob center, uint16 spell_id, bool affect_caster) +void Lua_EntityList::MassGroupBuff(Lua_Mob caster, Lua_Mob center, int32 spell_id, bool affect_caster) { Lua_Safe_Call_Void(); self->MassGroupBuff(caster, center, spell_id, affect_caster); @@ -853,10 +853,10 @@ luabind::scope lua_register_entity_list() { .def("AreaAttack", (void(Lua_EntityList::*)(Lua_Mob, float, int16, int))&Lua_EntityList::AreaAttack) .def("AreaAttack", (void(Lua_EntityList::*)(Lua_Mob, float, int16, int, bool))&Lua_EntityList::AreaAttack) .def("AreaAttack", (void(Lua_EntityList::*)(Lua_Mob, float, int16, int, bool, int))&Lua_EntityList::AreaAttack) - .def("AreaSpell", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, uint16))&Lua_EntityList::AreaSpell) - .def("AreaSpell", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, uint16, bool))&Lua_EntityList::AreaSpell) - .def("AreaSpell", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, uint16, bool, int16))&Lua_EntityList::AreaSpell) - .def("AreaSpell", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, uint16, bool, int16, int))&Lua_EntityList::AreaSpell) + .def("AreaSpell", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, int32))&Lua_EntityList::AreaSpell) + .def("AreaSpell", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, int32, bool))&Lua_EntityList::AreaSpell) + .def("AreaSpell", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, int32, bool, int16))&Lua_EntityList::AreaSpell) + .def("AreaSpell", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, int32, bool, int16, int))&Lua_EntityList::AreaSpell) .def("AreaTaunt", (void(Lua_EntityList::*)(Lua_Client))&Lua_EntityList::AreaTaunt) .def("AreaTaunt", (void(Lua_EntityList::*)(Lua_Client, float))&Lua_EntityList::AreaTaunt) .def("AreaTaunt", (void(Lua_EntityList::*)(Lua_Client, float, int))&Lua_EntityList::AreaTaunt) @@ -936,8 +936,8 @@ luabind::scope lua_register_entity_list() { .def("Marquee", (void(Lua_EntityList::*)(uint32, std::string))&Lua_EntityList::Marquee) .def("Marquee", (void(Lua_EntityList::*)(uint32, std::string, uint32))&Lua_EntityList::Marquee) .def("Marquee", (void(Lua_EntityList::*)(uint32, uint32, uint32, uint32, uint32, std::string))&Lua_EntityList::Marquee) - .def("MassGroupBuff", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, uint16))&Lua_EntityList::MassGroupBuff) - .def("MassGroupBuff", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, uint16, bool))&Lua_EntityList::MassGroupBuff) + .def("MassGroupBuff", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, int32))&Lua_EntityList::MassGroupBuff) + .def("MassGroupBuff", (void(Lua_EntityList::*)(Lua_Mob, Lua_Mob, int32, bool))&Lua_EntityList::MassGroupBuff) .def("Message", (void(Lua_EntityList::*)(uint32, uint32, const char*))&Lua_EntityList::Message) .def("MessageClose", (void(Lua_EntityList::*)(Lua_Mob, bool, float, uint32, const char*))&Lua_EntityList::MessageClose) .def("MessageGroup", (void(Lua_EntityList::*)(Lua_Mob, bool, uint32, const char*))&Lua_EntityList::MessageGroup) diff --git a/zone/lua_entity_list.h b/zone/lua_entity_list.h index a690d0f23..a8f15b70a 100644 --- a/zone/lua_entity_list.h +++ b/zone/lua_entity_list.h @@ -165,15 +165,15 @@ public: void AreaAttack(Lua_Mob attacker, float distance, int16 slot_id, int count); void AreaAttack(Lua_Mob attacker, float distance, int16 slot_id, int count, bool is_from_spell); void AreaAttack(Lua_Mob attacker, float distance, int16 slot_id, int count, bool is_from_spell, int attack_rounds); - void AreaSpell(Lua_Mob caster, Lua_Mob center, uint16 spell_id); - void AreaSpell(Lua_Mob caster, Lua_Mob center, uint16 spell_id, bool affect_caster); - void AreaSpell(Lua_Mob caster, Lua_Mob center, uint16 spell_id, bool affect_caster, int16 resist_adjust); - void AreaSpell(Lua_Mob caster, Lua_Mob center, uint16 spell_id, bool affect_caster, int16 resist_adjust, int max_targets); + void AreaSpell(Lua_Mob caster, Lua_Mob center, int32 spell_id); + void AreaSpell(Lua_Mob caster, Lua_Mob center, int32 spell_id, bool affect_caster); + void AreaSpell(Lua_Mob caster, Lua_Mob center, int32 spell_id, bool affect_caster, int16 resist_adjust); + void AreaSpell(Lua_Mob caster, Lua_Mob center, int32 spell_id, bool affect_caster, int16 resist_adjust, int max_targets); void AreaTaunt(Lua_Client caster); void AreaTaunt(Lua_Client caster, float range); void AreaTaunt(Lua_Client caster, float range, int bonus_hate); - void MassGroupBuff(Lua_Mob caster, Lua_Mob center, uint16 spell_id); - void MassGroupBuff(Lua_Mob caster, Lua_Mob center, uint16 spell_id, bool affect_caster); + void MassGroupBuff(Lua_Mob caster, Lua_Mob center, int32 spell_id); + void MassGroupBuff(Lua_Mob caster, Lua_Mob center, int32 spell_id, bool affect_caster); Lua_NPC_List GetNPCsByIDs(luabind::adl::object npc_ids); Lua_NPC_List GetNPCsByExcludedIDs(luabind::adl::object npc_ids); }; diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 793b730c5..cf40f4464 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -445,7 +445,7 @@ std::string lua_get_race_name(uint32 race_id) { return quest_manager.getracename(race_id); } -std::string lua_get_spell_name(uint32 spell_id) { +std::string lua_get_spell_name(int32 spell_id) { return quest_manager.getspellname(spell_id); } @@ -2055,11 +2055,11 @@ const int lua_get_item_stat(uint32 item_id, std::string identifier) { return quest_manager.getitemstat(item_id, identifier); } -int lua_get_spell_stat(uint32 spell_id, std::string stat_identifier) { +int lua_get_spell_stat(int32 spell_id, std::string stat_identifier) { return quest_manager.getspellstat(spell_id, stat_identifier); } -int lua_get_spell_stat(uint32 spell_id, std::string stat_identifier, uint8 slot) { +int lua_get_spell_stat(int32 spell_id, std::string stat_identifier, uint8 slot) { return quest_manager.getspellstat(spell_id, stat_identifier, slot); } @@ -2280,37 +2280,37 @@ void lua_cross_zone_assign_task_by_client_name(const char* client_name, uint32 t quest_manager.CrossZoneTaskUpdate(update_type, update_subtype, update_identifier, task_id, task_subidentifier, update_count, enforce_level_requirement, client_name); } -void lua_cross_zone_cast_spell_by_char_id(int character_id, uint32 spell_id) { +void lua_cross_zone_cast_spell_by_char_id(int character_id, int32 spell_id) { uint8 update_type = CZUpdateType_Character; uint8 update_subtype = CZSpellUpdateSubtype_Cast; quest_manager.CrossZoneSpell(update_type, update_subtype, character_id, spell_id); } -void lua_cross_zone_cast_spell_by_group_id(int group_id, uint32 spell_id) { +void lua_cross_zone_cast_spell_by_group_id(int group_id, int32 spell_id) { uint8 update_type = CZUpdateType_Group; uint8 update_subtype = CZSpellUpdateSubtype_Cast; quest_manager.CrossZoneSpell(update_type, update_subtype, group_id, spell_id); } -void lua_cross_zone_cast_spell_by_raid_id(int raid_id, uint32 spell_id) { +void lua_cross_zone_cast_spell_by_raid_id(int raid_id, int32 spell_id) { uint8 update_type = CZUpdateType_Raid; uint8 update_subtype = CZSpellUpdateSubtype_Cast; quest_manager.CrossZoneSpell(update_type, update_subtype, raid_id, spell_id); } -void lua_cross_zone_cast_spell_by_guild_id(int guild_id, uint32 spell_id) { +void lua_cross_zone_cast_spell_by_guild_id(int guild_id, int32 spell_id) { uint8 update_type = CZUpdateType_Guild; uint8 update_subtype = CZSpellUpdateSubtype_Cast; quest_manager.CrossZoneSpell(update_type, update_subtype, guild_id, spell_id); } -void lua_cross_zone_cast_spell_by_expedition_id(uint32 expedition_id, uint32 spell_id) { +void lua_cross_zone_cast_spell_by_expedition_id(uint32 expedition_id, int32 spell_id) { uint8 update_type = CZUpdateType_Expedition; uint8 update_subtype = CZSpellUpdateSubtype_Cast; quest_manager.CrossZoneSpell(update_type, update_subtype, expedition_id, spell_id); } -void lua_cross_zone_cast_spell_by_client_name(const char* client_name, uint32 spell_id) { +void lua_cross_zone_cast_spell_by_client_name(const char* client_name, int32 spell_id) { uint8 update_type = CZUpdateType_ClientName; uint8 update_subtype = CZSpellUpdateSubtype_Cast; int update_identifier = 0; @@ -3071,37 +3071,37 @@ void lua_cross_zone_remove_ldon_win_by_client_name(const char* client_name, uint quest_manager.CrossZoneLDoNUpdate(update_type, update_subtype, update_identifier, theme_id, points, client_name); } -void lua_cross_zone_remove_spell_by_char_id(int character_id, uint32 spell_id) { +void lua_cross_zone_remove_spell_by_char_id(int character_id, int32 spell_id) { uint8 update_type = CZUpdateType_Character; uint8 update_subtype = CZSpellUpdateSubtype_Remove; quest_manager.CrossZoneSpell(update_type, update_subtype, character_id, spell_id); } -void lua_cross_zone_remove_spell_by_group_id(int group_id, uint32 spell_id) { +void lua_cross_zone_remove_spell_by_group_id(int group_id, int32 spell_id) { uint8 update_type = CZUpdateType_Group; uint8 update_subtype = CZSpellUpdateSubtype_Remove; quest_manager.CrossZoneSpell(update_type, update_subtype, group_id, spell_id); } -void lua_cross_zone_remove_spell_by_raid_id(int raid_id, uint32 spell_id) { +void lua_cross_zone_remove_spell_by_raid_id(int raid_id, int32 spell_id) { uint8 update_type = CZUpdateType_Raid; uint8 update_subtype = CZSpellUpdateSubtype_Remove; quest_manager.CrossZoneSpell(update_type, update_subtype, raid_id, spell_id); } -void lua_cross_zone_remove_spell_by_guild_id(int guild_id, uint32 spell_id) { +void lua_cross_zone_remove_spell_by_guild_id(int guild_id, int32 spell_id) { uint8 update_type = CZUpdateType_Guild; uint8 update_subtype = CZSpellUpdateSubtype_Remove; quest_manager.CrossZoneSpell(update_type, update_subtype, guild_id, spell_id); } -void lua_cross_zone_remove_spell_by_expedition_id(uint32 expedition_id, uint32 spell_id) { +void lua_cross_zone_remove_spell_by_expedition_id(uint32 expedition_id, int32 spell_id) { uint8 update_type = CZUpdateType_Expedition; uint8 update_subtype = CZSpellUpdateSubtype_Remove; quest_manager.CrossZoneSpell(update_type, update_subtype, expedition_id, spell_id); } -void lua_cross_zone_remove_spell_by_client_name(const char* client_name, uint32 spell_id) { +void lua_cross_zone_remove_spell_by_client_name(const char* client_name, int32 spell_id) { uint8 update_type = CZUpdateType_ClientName; uint8 update_subtype = CZSpellUpdateSubtype_Remove; int update_identifier = 0; @@ -3446,17 +3446,17 @@ void lua_world_wide_assign_task(uint32 task_id, bool enforce_level_requirement, quest_manager.WorldWideTaskUpdate(update_type, task_id, task_subidentifier, update_count, enforce_level_requirement, min_status, max_status); } -void lua_world_wide_cast_spell(uint32 spell_id) { +void lua_world_wide_cast_spell(int32 spell_id) { uint8 update_type = WWSpellUpdateType_Cast; quest_manager.WorldWideSpell(update_type, spell_id); } -void lua_world_wide_cast_spell(uint32 spell_id, uint8 min_status) { +void lua_world_wide_cast_spell(int32 spell_id, uint8 min_status) { uint8 update_type = WWSpellUpdateType_Cast; quest_manager.WorldWideSpell(update_type, spell_id, min_status); } -void lua_world_wide_cast_spell(uint32 spell_id, uint8 min_status, uint8 max_status) { +void lua_world_wide_cast_spell(int32 spell_id, uint8 min_status, uint8 max_status) { uint8 update_type = WWSpellUpdateType_Cast; quest_manager.WorldWideSpell(update_type, spell_id, min_status, max_status); } @@ -3629,17 +3629,17 @@ void lua_world_wide_remove_ldon_win(uint32 theme_id, uint8 min_status, uint8 max quest_manager.WorldWideLDoNUpdate(update_type, theme_id, points, min_status, max_status); } -void lua_world_wide_remove_spell(uint32 spell_id) { +void lua_world_wide_remove_spell(int32 spell_id) { uint8 update_type = WWSpellUpdateType_Remove; quest_manager.WorldWideSpell(update_type, spell_id); } -void lua_world_wide_remove_spell(uint32 spell_id, uint8 min_status) { +void lua_world_wide_remove_spell(int32 spell_id, uint8 min_status) { uint8 update_type = WWSpellUpdateType_Remove; quest_manager.WorldWideSpell(update_type, spell_id, min_status); } -void lua_world_wide_remove_spell(uint32 spell_id, uint8 min_status, uint8 max_status) { +void lua_world_wide_remove_spell(int32 spell_id, uint8 min_status, uint8 max_status) { uint8 update_type = WWSpellUpdateType_Remove; quest_manager.WorldWideSpell(update_type, spell_id, min_status, max_status); } @@ -3806,7 +3806,7 @@ uint32 lua_count_spawned_npcs(luabind::adl::object table) { return entity_list.CountSpawnedNPCs(npc_ids); } -Lua_Spell lua_get_spell(uint32 spell_id) { +Lua_Spell lua_get_spell(int32 spell_id) { return Lua_Spell(spell_id); } @@ -4801,443 +4801,443 @@ void lua_send_channel_message(Lua_Client from, const char* to, uint8 channel_num quest_manager.SendChannelMessage(from, to, channel_number, guild_id, language_id, language_skill, message); } -uint8 lua_get_spell_level(uint16 spell_id, uint8 class_id) +uint8 lua_get_spell_level(int32 spell_id, uint8 class_id) { const auto spell_level = GetSpellLevel(spell_id, class_id); return spell_level > RuleI(Character, MaxLevel) ? UINT8_MAX : spell_level; } -bool lua_is_effect_in_spell(uint16 spell_id, int effect_id) +bool lua_is_effect_in_spell(int32 spell_id, int effect_id) { return IsEffectInSpell(spell_id, effect_id); } -bool lua_is_beneficial_spell(uint16 spell_id) +bool lua_is_beneficial_spell(int32 spell_id) { return IsBeneficialSpell(spell_id); } -bool lua_is_detrimental_spell(uint16 spell_id) +bool lua_is_detrimental_spell(int32 spell_id) { return IsDetrimentalSpell(spell_id); } -bool lua_is_targetable_ae_spell(uint16 spell_id) +bool lua_is_targetable_ae_spell(int32 spell_id) { return IsTargetableAESpell(spell_id); } -bool lua_is_sacrifice_spell(uint16 spell_id) +bool lua_is_sacrifice_spell(int32 spell_id) { return IsSacrificeSpell(spell_id); } -bool lua_is_lifetap_spell(uint16 spell_id) +bool lua_is_lifetap_spell(int32 spell_id) { return IsLifetapSpell(spell_id); } -bool lua_is_mesmerize_spell(uint16 spell_id) +bool lua_is_mesmerize_spell(int32 spell_id) { return IsMesmerizeSpell(spell_id); } -bool lua_is_stun_spell(uint16 spell_id) +bool lua_is_stun_spell(int32 spell_id) { return IsStunSpell(spell_id); } -bool lua_is_summon_spell(uint16 spell_id) +bool lua_is_summon_spell(int32 spell_id) { return IsSummonSpell(spell_id); } -bool lua_is_damage_spell(uint16 spell_id) +bool lua_is_damage_spell(int32 spell_id) { return IsDamageSpell(spell_id); } -bool lua_is_fear_spell(uint16 spell_id) +bool lua_is_fear_spell(int32 spell_id) { return IsFearSpell(spell_id); } -bool lua_is_cure_spell(uint16 spell_id) +bool lua_is_cure_spell(int32 spell_id) { return IsCureSpell(spell_id); } -bool lua_is_haste_spell(uint16 spell_id) +bool lua_is_haste_spell(int32 spell_id) { return IsHasteSpell(spell_id); } -bool lua_is_harmony_spell(uint16 spell_id) +bool lua_is_harmony_spell(int32 spell_id) { return IsHarmonySpell(spell_id); } -bool lua_is_percental_heal_spell(uint16 spell_id) +bool lua_is_percental_heal_spell(int32 spell_id) { return IsPercentalHealSpell(spell_id); } -bool lua_is_group_only_spell(uint16 spell_id) +bool lua_is_group_only_spell(int32 spell_id) { return IsGroupOnlySpell(spell_id); } -bool lua_is_invisible_spell(uint16 spell_id) +bool lua_is_invisible_spell(int32 spell_id) { return IsInvisibleSpell(spell_id); } -bool lua_is_invulnerability_spell(uint16 spell_id) +bool lua_is_invulnerability_spell(int32 spell_id) { return IsInvulnerabilitySpell(spell_id); } -bool lua_is_complete_heal_duration_spell(uint16 spell_id) +bool lua_is_complete_heal_duration_spell(int32 spell_id) { return IsCompleteHealDurationSpell(spell_id); } -bool lua_is_poison_counter_spell(uint16 spell_id) +bool lua_is_poison_counter_spell(int32 spell_id) { return IsPoisonCounterSpell(spell_id); } -bool lua_is_disease_counter_spell(uint16 spell_id) +bool lua_is_disease_counter_spell(int32 spell_id) { return IsDiseaseCounterSpell(spell_id); } -bool lua_is_summon_item_spell(uint16 spell_id) +bool lua_is_summon_item_spell(int32 spell_id) { return IsSummonItemSpell(spell_id); } -bool lua_is_summon_skeleton_spell(uint16 spell_id) +bool lua_is_summon_skeleton_spell(int32 spell_id) { return IsSummonSkeletonSpell(spell_id); } -bool lua_is_summon_pet_spell(uint16 spell_id) +bool lua_is_summon_pet_spell(int32 spell_id) { return IsSummonPetSpell(spell_id); } -bool lua_is_pet_spell(uint16 spell_id) +bool lua_is_pet_spell(int32 spell_id) { return IsPetSpell(spell_id); } -bool lua_is_summon_pc_spell(uint16 spell_id) +bool lua_is_summon_pc_spell(int32 spell_id) { return IsSummonPCSpell(spell_id); } -bool lua_is_charm_spell(uint16 spell_id) +bool lua_is_charm_spell(int32 spell_id) { return IsCharmSpell(spell_id); } -bool lua_is_blind_spell(uint16 spell_id) +bool lua_is_blind_spell(int32 spell_id) { return IsBlindSpell(spell_id); } -bool lua_is_health_spell(uint16 spell_id) +bool lua_is_health_spell(int32 spell_id) { return IsHealthSpell(spell_id); } -bool lua_is_cast_time_reduction_spell(uint16 spell_id) +bool lua_is_cast_time_reduction_spell(int32 spell_id) { return IsCastTimeReductionSpell(spell_id); } -bool lua_is_increase_duration_spell(uint16 spell_id) +bool lua_is_increase_duration_spell(int32 spell_id) { return IsIncreaseDurationSpell(spell_id); } -bool lua_is_mana_cost_reduction_spell(uint16 spell_id) +bool lua_is_mana_cost_reduction_spell(int32 spell_id) { return IsManaCostReductionSpell(spell_id); } -bool lua_is_increase_range_spell(uint16 spell_id) +bool lua_is_increase_range_spell(int32 spell_id) { return IsIncreaseRangeSpell(spell_id); } -bool lua_is_improved_healing_spell(uint16 spell_id) +bool lua_is_improved_healing_spell(int32 spell_id) { return IsImprovedHealingSpell(spell_id); } -bool lua_is_improved_damage_spell(uint16 spell_id) +bool lua_is_improved_damage_spell(int32 spell_id) { return IsImprovedDamageSpell(spell_id); } -bool lua_is_ae_duration_spell(uint16 spell_id) +bool lua_is_ae_duration_spell(int32 spell_id) { return IsAEDurationSpell(spell_id); } -bool lua_is_pure_nuke_spell(uint16 spell_id) +bool lua_is_pure_nuke_spell(int32 spell_id) { return IsPureNukeSpell(spell_id); } -bool lua_is_ae_nuke_spell(uint16 spell_id) +bool lua_is_ae_nuke_spell(int32 spell_id) { return IsAENukeSpell(spell_id); } -bool lua_is_pbae_nuke_spell(uint16 spell_id) +bool lua_is_pbae_nuke_spell(int32 spell_id) { return IsPBAENukeSpell(spell_id); } -bool lua_is_ae_rain_nuke_spell(uint16 spell_id) +bool lua_is_ae_rain_nuke_spell(int32 spell_id) { return IsAERainNukeSpell(spell_id); } -bool lua_is_partial_resistable_spell(uint16 spell_id) +bool lua_is_partial_resistable_spell(int32 spell_id) { return IsPartialResistableSpell(spell_id); } -bool lua_is_resistable_spell(uint16 spell_id) +bool lua_is_resistable_spell(int32 spell_id) { return IsResistableSpell(spell_id); } -bool lua_is_group_spell(uint16 spell_id) +bool lua_is_group_spell(int32 spell_id) { return IsGroupSpell(spell_id); } -bool lua_is_tgb_compatible_spell(uint16 spell_id) +bool lua_is_tgb_compatible_spell(int32 spell_id) { return IsTGBCompatibleSpell(spell_id); } -bool lua_is_bard_song(uint16 spell_id) +bool lua_is_bard_song(int32 spell_id) { return IsBardSong(spell_id); } -bool lua_is_pulsing_bard_song(uint16 spell_id) +bool lua_is_pulsing_bard_song(int32 spell_id) { return IsPulsingBardSong(spell_id); } -bool lua_is_discipline_buff(uint16 spell_id) +bool lua_is_discipline_buff(int32 spell_id) { return IsDisciplineBuff(spell_id); } -bool lua_is_discipline(uint16 spell_id) +bool lua_is_discipline(int32 spell_id) { return IsDiscipline(spell_id); } -bool lua_is_combat_skill(uint16 spell_id) +bool lua_is_combat_skill(int32 spell_id) { return IsCombatSkill(spell_id); } -bool lua_is_resurrection_effects(uint16 spell_id) +bool lua_is_resurrection_effects(int32 spell_id) { return IsResurrectionEffects(spell_id); } -bool lua_is_rune_spell(uint16 spell_id) +bool lua_is_rune_spell(int32 spell_id) { return IsRuneSpell(spell_id); } -bool lua_is_magic_rune_spell(uint16 spell_id) +bool lua_is_magic_rune_spell(int32 spell_id) { return IsMagicRuneSpell(spell_id); } -bool lua_is_mana_tap_spell(uint16 spell_id) +bool lua_is_mana_tap_spell(int32 spell_id) { return IsManaTapSpell(spell_id); } -bool lua_is_alliance_spell(uint16 spell_id) +bool lua_is_alliance_spell(int32 spell_id) { return IsAllianceSpell(spell_id); } -bool lua_is_death_save_spell(uint16 spell_id) +bool lua_is_death_save_spell(int32 spell_id) { return IsDeathSaveSpell(spell_id); } -bool lua_is_partial_death_save_spell(uint16 spell_id) +bool lua_is_partial_death_save_spell(int32 spell_id) { return IsPartialDeathSaveSpell(spell_id); } -bool lua_is_full_death_save_spell(uint16 spell_id) +bool lua_is_full_death_save_spell(int32 spell_id) { return IsFullDeathSaveSpell(spell_id); } -bool lua_is_shadow_step_spell(uint16 spell_id) +bool lua_is_shadow_step_spell(int32 spell_id) { return IsShadowStepSpell(spell_id); } -bool lua_is_succor_spell(uint16 spell_id) +bool lua_is_succor_spell(int32 spell_id) { return IsSuccorSpell(spell_id); } -bool lua_is_teleport_spell(uint16 spell_id) +bool lua_is_teleport_spell(int32 spell_id) { return IsTeleportSpell(spell_id); } -bool lua_is_translocate_spell(uint16 spell_id) +bool lua_is_translocate_spell(int32 spell_id) { return IsTranslocateSpell(spell_id); } -bool lua_is_gate_spell(uint16 spell_id) +bool lua_is_gate_spell(int32 spell_id) { return IsGateSpell(spell_id); } -bool lua_is_illusion_spell(uint16 spell_id) +bool lua_is_illusion_spell(int32 spell_id) { return IsIllusionSpell(spell_id); } -bool lua_is_ldon_object_spell(uint16 spell_id) +bool lua_is_ldon_object_spell(int32 spell_id) { return IsLDoNObjectSpell(spell_id); } -bool lua_is_heal_over_time_spell(uint16 spell_id) +bool lua_is_heal_over_time_spell(int32 spell_id) { return IsHealOverTimeSpell(spell_id); } -bool lua_is_complete_heal_spell(uint16 spell_id) +bool lua_is_complete_heal_spell(int32 spell_id) { return IsCompleteHealSpell(spell_id); } -bool lua_is_fast_heal_spell(uint16 spell_id) +bool lua_is_fast_heal_spell(int32 spell_id) { return IsFastHealSpell(spell_id); } -bool lua_is_very_fast_heal_spell(uint16 spell_id) +bool lua_is_very_fast_heal_spell(int32 spell_id) { return IsVeryFastHealSpell(spell_id); } -bool lua_is_regular_single_target_heal_spell(uint16 spell_id) +bool lua_is_regular_single_target_heal_spell(int32 spell_id) { return IsRegularSingleTargetHealSpell(spell_id); } -bool lua_is_regular_group_heal_spell(uint16 spell_id) +bool lua_is_regular_group_heal_spell(int32 spell_id) { return IsRegularGroupHealSpell(spell_id); } -bool lua_is_group_complete_heal_spell(uint16 spell_id) +bool lua_is_group_complete_heal_spell(int32 spell_id) { return IsGroupCompleteHealSpell(spell_id); } -bool lua_is_group_heal_over_time_spell(uint16 spell_id) +bool lua_is_group_heal_over_time_spell(int32 spell_id) { return IsGroupHealOverTimeSpell(spell_id); } -bool lua_is_debuff_spell(uint16 spell_id) +bool lua_is_debuff_spell(int32 spell_id) { return IsDebuffSpell(spell_id); } -bool lua_is_resist_debuff_spell(uint16 spell_id) +bool lua_is_resist_debuff_spell(int32 spell_id) { return IsResistDebuffSpell(spell_id); } -bool lua_is_self_conversion_spell(uint16 spell_id) +bool lua_is_self_conversion_spell(int32 spell_id) { return IsSelfConversionSpell(spell_id); } -bool lua_is_buff_spell(uint16 spell_id) +bool lua_is_buff_spell(int32 spell_id) { return IsBuffSpell(spell_id); } -bool lua_is_persist_death_spell(uint16 spell_id) +bool lua_is_persist_death_spell(int32 spell_id) { return IsPersistDeathSpell(spell_id); } -bool lua_is_suspendable_spell(uint16 spell_id) +bool lua_is_suspendable_spell(int32 spell_id) { return IsSuspendableSpell(spell_id); } -bool lua_is_cast_on_fade_duration_spell(uint16 spell_id) +bool lua_is_cast_on_fade_duration_spell(int32 spell_id) { return IsCastOnFadeDurationSpell(spell_id); } -bool lua_is_distance_modifier_spell(uint16 spell_id) +bool lua_is_distance_modifier_spell(int32 spell_id) { return IsDistanceModifierSpell(spell_id); } -bool lua_is_rest_allowed_spell(uint16 spell_id) +bool lua_is_rest_allowed_spell(int32 spell_id) { return IsRestAllowedSpell(spell_id); } -bool lua_is_no_detrimental_spell_aggro_spell(uint16 spell_id) +bool lua_is_no_detrimental_spell_aggro_spell(int32 spell_id) { return IsNoDetrimentalSpellAggroSpell(spell_id); } -bool lua_is_stackable_dot(uint16 spell_id) +bool lua_is_stackable_dot(int32 spell_id) { return IsStackableDOT(spell_id); } -bool lua_is_short_duration_buff(uint16 spell_id) +bool lua_is_short_duration_buff(int32 spell_id) { return IsShortDurationBuff(spell_id); } -bool lua_is_target_required_for_spell(uint16 spell_id) +bool lua_is_target_required_for_spell(int32 spell_id) { return IsTargetRequiredForSpell(spell_id); } -bool lua_is_virus_spell(uint16 spell_id) +bool lua_is_virus_spell(int32 spell_id) { return IsVirusSpell(spell_id); } -bool lua_is_valid_spell(uint16 spell_id) +bool lua_is_valid_spell(int32 spell_id) { return IsValidSpell(spell_id); } @@ -5257,147 +5257,147 @@ bool lua_is_bard_only_stack_effect(int effect_id) return IsBardOnlyStackEffect(effect_id); } -bool lua_is_cast_while_invisible_spell(uint16 spell_id) +bool lua_is_cast_while_invisible_spell(int32 spell_id) { return IsCastWhileInvisibleSpell(spell_id); } -bool lua_is_cast_restricted_spell(uint16 spell_id) +bool lua_is_cast_restricted_spell(int32 spell_id) { return IsCastRestrictedSpell(spell_id); } -bool lua_is_cast_not_standing_spell(uint16 spell_id) +bool lua_is_cast_not_standing_spell(int32 spell_id) { return IsCastNotStandingSpell(spell_id); } -bool lua_is_instrument_modifier_applied_to_spell_effect(uint16 spell_id, int effect_id) +bool lua_is_instrument_modifier_applied_to_spell_effect(int32 spell_id, int effect_id) { return IsInstrumentModifierAppliedToSpellEffect(spell_id, effect_id); } -bool lua_is_blank_spell_effect(uint16 spell_id, int effect_index) +bool lua_is_blank_spell_effect(int32 spell_id, int effect_index) { return IsBlankSpellEffect(spell_id, effect_index); } -uint16 lua_get_spell_trigger_spell_id(uint16 spell_id, int effect_id) +int32 lua_get_spell_trigger_spell_id(int32 spell_id, int effect_id) { return GetSpellTriggerSpellID(spell_id, effect_id); } -uint8 lua_get_spell_minimum_level(uint16 spell_id) +uint8 lua_get_spell_minimum_level(int32 spell_id) { return GetSpellMinimumLevel(spell_id); } -int lua_get_spell_resist_type(uint16 spell_id) +int lua_get_spell_resist_type(int32 spell_id) { return GetSpellResistType(spell_id); } -int lua_get_spell_target_type(uint16 spell_id) +int lua_get_spell_target_type(int32 spell_id) { return GetSpellTargetType(spell_id); } -int lua_get_spell_partial_melee_rune_reduction(uint16 spell_id) +int lua_get_spell_partial_melee_rune_reduction(int32 spell_id) { return GetSpellPartialMeleeRuneReduction(spell_id); } -int lua_get_spell_partial_magic_rune_reduction(uint16 spell_id) +int lua_get_spell_partial_magic_rune_reduction(int32 spell_id) { return GetSpellPartialMagicRuneReduction(spell_id); } -int lua_get_spell_partial_melee_rune_amount(uint16 spell_id) +int lua_get_spell_partial_melee_rune_amount(int32 spell_id) { return GetSpellPartialMeleeRuneAmount(spell_id); } -int lua_get_spell_partial_magic_rune_amount(uint16 spell_id) +int lua_get_spell_partial_magic_rune_amount(int32 spell_id) { return GetSpellPartialMagicRuneAmount(spell_id); } -int lua_get_spell_viral_minimum_spread_time(uint16 spell_id) +int lua_get_spell_viral_minimum_spread_time(int32 spell_id) { return GetSpellViralMinimumSpreadTime(spell_id); } -int lua_get_spell_viral_maximum_spread_time(uint16 spell_id) +int lua_get_spell_viral_maximum_spread_time(int32 spell_id) { return GetSpellViralMaximumSpreadTime(spell_id); } -int lua_get_spell_viral_spread_range(uint16 spell_id) +int lua_get_spell_viral_spread_range(int32 spell_id) { return GetSpellViralSpreadRange(spell_id); } -int lua_get_spell_proc_limit_timer(uint16 spell_id, int proc_type) +int lua_get_spell_proc_limit_timer(int32 spell_id, int proc_type) { return GetSpellProcLimitTimer(spell_id, proc_type); } -int lua_get_spell_effect_description_number(uint16 spell_id) +int lua_get_spell_effect_description_number(int32 spell_id) { return GetSpellEffectDescriptionNumber(spell_id); } -int lua_get_spell_furious_bash(uint16 spell_id) +int lua_get_spell_furious_bash(int32 spell_id) { return GetSpellFuriousBash(spell_id); } -bool lua_is_spell_usable_in_this_zone_type(uint16 spell_id) +bool lua_is_spell_usable_in_this_zone_type(int32 spell_id) { return IsSpellUsableInThisZoneType(spell_id, zone->GetZoneType()); } -bool lua_is_spell_usable_in_this_zone_type(uint16 spell_id, uint8 zone_type) +bool lua_is_spell_usable_in_this_zone_type(int32 spell_id, uint8 zone_type) { return IsSpellUsableInThisZoneType(spell_id, zone_type); } -int lua_get_spell_effect_index(uint16 spell_id, int effect_id) +int lua_get_spell_effect_index(int32 spell_id, int effect_id) { return GetSpellEffectIndex(spell_id, effect_id); } -int lua_calculate_poison_counters(uint16 spell_id) +int lua_calculate_poison_counters(int32 spell_id) { return CalculatePoisonCounters(spell_id); } -int lua_calculate_disease_counters(uint16 spell_id) +int lua_calculate_disease_counters(int32 spell_id) { return CalculateDiseaseCounters(spell_id); } -int lua_calculate_curse_counters(uint16 spell_id) +int lua_calculate_curse_counters(int32 spell_id) { return CalculateCurseCounters(spell_id); } -int lua_calculate_corruption_counters(uint16 spell_id) +int lua_calculate_corruption_counters(int32 spell_id) { return CalculateCorruptionCounters(spell_id); } -int lua_calculate_counters(uint16 spell_id) +int lua_calculate_counters(int32 spell_id) { return CalculateCounters(spell_id); } -int8 lua_get_spell_resurrection_sickness_check(uint16 spell_id_one, uint16 spell_id_two) +int8 lua_get_spell_resurrection_sickness_check(int32 spell_id_one, int32 spell_id_two) { return GetSpellResurrectionSicknessCheck(spell_id_one, spell_id_two); } -int lua_get_spell_nimbus_effect(uint16 spell_id) +int lua_get_spell_nimbus_effect(int32 spell_id) { return GetSpellNimbusEffect(spell_id); } @@ -5425,12 +5425,12 @@ std::string lua_convert_money_to_string(luabind::adl::object table) return Strings::Money(platinum, gold, silver, copper); } -void lua_cast_spell(uint16 spell_id, uint16 target_id) +void lua_cast_spell(int32 spell_id, uint16 target_id) { quest_manager.castspell(spell_id, target_id); } -void lua_self_cast(uint16 spell_id) +void lua_self_cast(int32 spell_id) { quest_manager.selfcast(spell_id); } @@ -6208,8 +6208,8 @@ luabind::scope lua_register_general() { luabind::def("rename", &lua_rename), luabind::def("get_data_remaining", &lua_get_data_remaining), luabind::def("get_item_stat", &lua_get_item_stat), - luabind::def("get_spell_stat", (int(*)(uint32,std::string))&lua_get_spell_stat), - luabind::def("get_spell_stat", (int(*)(uint32,std::string,uint8))&lua_get_spell_stat), + luabind::def("get_spell_stat", (int(*)(int32,std::string))&lua_get_spell_stat), + luabind::def("get_spell_stat", (int(*)(int32,std::string,uint8))&lua_get_spell_stat), luabind::def("is_npc_spawned", &lua_is_npc_spawned), luabind::def("count_spawned_npcs", &lua_count_spawned_npcs), luabind::def("get_spell", &lua_get_spell), @@ -6504,8 +6504,8 @@ luabind::scope lua_register_general() { luabind::def("get_spell_proc_limit_timer", &lua_get_spell_proc_limit_timer), luabind::def("get_spell_effect_description_number", &lua_get_spell_effect_description_number), luabind::def("get_spell_furious_bash", &lua_get_spell_furious_bash), - luabind::def("is_spell_usable_in_this_zone_type", (bool(*)(uint16))&lua_is_spell_usable_in_this_zone_type), - luabind::def("is_spell_usable_in_this_zone_type", (bool(*)(uint16,uint8))&lua_is_spell_usable_in_this_zone_type), + luabind::def("is_spell_usable_in_this_zone_type", (bool(*)(int32))&lua_is_spell_usable_in_this_zone_type), + luabind::def("is_spell_usable_in_this_zone_type", (bool(*)(int32,uint8))&lua_is_spell_usable_in_this_zone_type), luabind::def("get_spell_effect_index", &lua_get_spell_effect_index), luabind::def("calculate_poison_counters", &lua_calculate_poison_counters), luabind::def("calculate_disease_counters", &lua_calculate_disease_counters), @@ -6727,9 +6727,9 @@ luabind::scope lua_register_general() { luabind::def("world_wide_assign_task", (void(*)(uint32,bool))&lua_world_wide_assign_task), luabind::def("world_wide_assign_task", (void(*)(uint32,bool,uint8))&lua_world_wide_assign_task), luabind::def("world_wide_assign_task", (void(*)(uint32,bool,uint8,uint8))&lua_world_wide_assign_task), - luabind::def("world_wide_cast_spell", (void(*)(uint32))&lua_world_wide_cast_spell), - luabind::def("world_wide_cast_spell", (void(*)(uint32,uint8))&lua_world_wide_cast_spell), - luabind::def("world_wide_cast_spell", (void(*)(uint32,uint8,uint8))&lua_world_wide_cast_spell), + luabind::def("world_wide_cast_spell", (void(*)(int32))&lua_world_wide_cast_spell), + luabind::def("world_wide_cast_spell", (void(*)(int32,uint8))&lua_world_wide_cast_spell), + luabind::def("world_wide_cast_spell", (void(*)(int32,uint8,uint8))&lua_world_wide_cast_spell), luabind::def("world_wide_dialogue_window", (void(*)(const char*))&lua_world_wide_dialogue_window), luabind::def("world_wide_dialogue_window", (void(*)(const char*,uint8))&lua_world_wide_dialogue_window), luabind::def("world_wide_dialogue_window", (void(*)(const char*,uint8,uint8))&lua_world_wide_dialogue_window), @@ -6760,9 +6760,9 @@ luabind::scope lua_register_general() { luabind::def("world_wide_remove_ldon_win", (void(*)(uint32))&lua_world_wide_remove_ldon_win), luabind::def("world_wide_remove_ldon_win", (void(*)(uint32,uint8))&lua_world_wide_remove_ldon_win), luabind::def("world_wide_remove_ldon_win", (void(*)(uint32,uint8,uint8))&lua_world_wide_remove_ldon_win), - luabind::def("world_wide_remove_spell", (void(*)(uint32))&lua_world_wide_remove_spell), - luabind::def("world_wide_remove_spell", (void(*)(uint32,uint8))&lua_world_wide_remove_spell), - luabind::def("world_wide_remove_spell", (void(*)(uint32,uint8,uint8))&lua_world_wide_remove_spell), + luabind::def("world_wide_remove_spell", (void(*)(int32))&lua_world_wide_remove_spell), + luabind::def("world_wide_remove_spell", (void(*)(int32,uint8))&lua_world_wide_remove_spell), + luabind::def("world_wide_remove_spell", (void(*)(int32,uint8,uint8))&lua_world_wide_remove_spell), luabind::def("world_wide_remove_task", (void(*)(uint32))&lua_world_wide_remove_task), luabind::def("world_wide_remove_task", (void(*)(uint32,uint8))&lua_world_wide_remove_task), luabind::def("world_wide_remove_task", (void(*)(uint32,uint8,uint8))&lua_world_wide_remove_task), diff --git a/zone/lua_merc.cpp b/zone/lua_merc.cpp index d0a7d6545..2216fcec8 100644 --- a/zone/lua_merc.cpp +++ b/zone/lua_merc.cpp @@ -203,7 +203,7 @@ bool Lua_Merc::Suspend() return self->Suspend(); } -bool Lua_Merc::UseDiscipline(uint16 spell_id, uint16 target_id) +bool Lua_Merc::UseDiscipline(int32 spell_id, uint16 target_id) { Lua_Safe_Call_Bool(); return self->UseDiscipline(spell_id, target_id); diff --git a/zone/lua_merc.h b/zone/lua_merc.h index eec9ca975..952e2e444 100644 --- a/zone/lua_merc.h +++ b/zone/lua_merc.h @@ -73,7 +73,7 @@ public: void Sit(); void Stand(); bool Suspend(); - bool UseDiscipline(uint16 spell_id, uint16 target_id); + bool UseDiscipline(int32 spell_id, uint16 target_id); }; #endif // LUA_EQEMU diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index 312993d35..cf586e4f3 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -334,12 +334,12 @@ void Lua_Mob::SetInvisible(int state) { self->SetInvisible(state); } -bool Lua_Mob::FindBuff(uint16 spell_id) { +bool Lua_Mob::FindBuff(int32 spell_id) { Lua_Safe_Call_Bool(); return self->FindBuff(spell_id); } -bool Lua_Mob::FindBuff(uint16 spell_id, uint16 caster_id) { +bool Lua_Mob::FindBuff(int32 spell_id, uint16 caster_id) { Lua_Safe_Call_Bool(); return self->FindBuff(spell_id, caster_id); } @@ -2397,7 +2397,7 @@ int Lua_Mob::GetOrigBodyType() return (int)self->GetOrigBodyType(); } -void Lua_Mob::CheckNumHitsRemaining(int type, int32 buff_slot, uint16 spell_id) +void Lua_Mob::CheckNumHitsRemaining(int type, int32 buff_slot, int32 spell_id) { Lua_Safe_Call_Void(); self->CheckNumHitsRemaining((NumHit)type, buff_slot, spell_id); @@ -3010,62 +3010,62 @@ float Lua_Mob::GetDefaultRaceSize(int race_id, int gender_id) { return self->GetDefaultRaceSize(race_id, gender_id); } -float Lua_Mob::GetActSpellRange(uint16 spell_id, float range) { +float Lua_Mob::GetActSpellRange(int32 spell_id, float range) { Lua_Safe_Call_Real(); return self->GetActSpellRange(spell_id, range); } -int64 Lua_Mob::GetActSpellDamage(uint16 spell_id, int64 value) { +int64 Lua_Mob::GetActSpellDamage(int32 spell_id, int64 value) { Lua_Safe_Call_Int(); return self->GetActSpellDamage(spell_id, value); } -int64 Lua_Mob::GetActSpellDamage(uint16 spell_id, int64 value, Lua_Mob target) { +int64 Lua_Mob::GetActSpellDamage(int32 spell_id, int64 value, Lua_Mob target) { Lua_Safe_Call_Int(); return self->GetActSpellDamage(spell_id, value, target); } -int64 Lua_Mob::GetActDoTDamage(uint16 spell_id, int64 value, Lua_Mob target) { +int64 Lua_Mob::GetActDoTDamage(int32 spell_id, int64 value, Lua_Mob target) { Lua_Safe_Call_Int(); return self->GetActDoTDamage(spell_id, value, target); } -int64 Lua_Mob::GetActDoTDamage(uint16 spell_id, int64 value, Lua_Mob target, bool from_buff_tic) { +int64 Lua_Mob::GetActDoTDamage(int32 spell_id, int64 value, Lua_Mob target, bool from_buff_tic) { Lua_Safe_Call_Int(); return self->GetActDoTDamage(spell_id, value, target, from_buff_tic); } -int64 Lua_Mob::GetActSpellHealing(uint16 spell_id, int64 value) { +int64 Lua_Mob::GetActSpellHealing(int32 spell_id, int64 value) { Lua_Safe_Call_Int(); return self->GetActSpellHealing(spell_id, value); } -int64 Lua_Mob::GetActSpellHealing(uint16 spell_id, int64 value, Lua_Mob target) { +int64 Lua_Mob::GetActSpellHealing(int32 spell_id, int64 value, Lua_Mob target) { Lua_Safe_Call_Int(); return self->GetActSpellHealing(spell_id, value, target); } -int64 Lua_Mob::GetActSpellHealing(uint16 spell_id, int64 value, Lua_Mob target, bool from_buff_tic) { +int64 Lua_Mob::GetActSpellHealing(int32 spell_id, int64 value, Lua_Mob target, bool from_buff_tic) { Lua_Safe_Call_Int(); return self->GetActSpellHealing(spell_id, value, target, from_buff_tic); } -int Lua_Mob::GetActSpellCost(uint16 spell_id, int cost) { +int Lua_Mob::GetActSpellCost(int32 spell_id, int cost) { Lua_Safe_Call_Int(); return self->GetActSpellCost(spell_id, cost); } -int Lua_Mob::GetActSpellDuration(uint16 spell_id, int duration) { +int Lua_Mob::GetActSpellDuration(int32 spell_id, int duration) { Lua_Safe_Call_Int(); return self->GetActSpellDuration(spell_id, duration); } -int Lua_Mob::GetActSpellCasttime(uint16 spell_id, uint32 cast_time) { +int Lua_Mob::GetActSpellCasttime(int32 spell_id, uint32 cast_time) { Lua_Safe_Call_Int(); return self->GetActSpellCasttime(spell_id, cast_time); } -int64 Lua_Mob::GetActReflectedSpellDamage(uint16 spell_id, int64 value, int effectiveness) { +int64 Lua_Mob::GetActReflectedSpellDamage(int32 spell_id, int64 value, int effectiveness) { Lua_Safe_Call_Int(); return self->GetActReflectedSpellDamage(spell_id, value, effectiveness); } @@ -3434,37 +3434,37 @@ void Lua_Mob::AreaAttack(float distance, int16 slot_id, int count, bool is_from_ entity_list.AEAttack(self, distance, slot_id, count, is_from_spell, attack_rounds); } -void Lua_Mob::AreaSpell(Lua_Mob center, uint16 spell_id) +void Lua_Mob::AreaSpell(Lua_Mob center, int32 spell_id) { Lua_Safe_Call_Void(); entity_list.AESpell(self, center, spell_id); } -void Lua_Mob::AreaSpell(Lua_Mob center, uint16 spell_id, bool affect_caster) +void Lua_Mob::AreaSpell(Lua_Mob center, int32 spell_id, bool affect_caster) { Lua_Safe_Call_Void(); entity_list.AESpell(self, center, spell_id, affect_caster); } -void Lua_Mob::AreaSpell(Lua_Mob center, uint16 spell_id, bool affect_caster, int16 resist_adjust) +void Lua_Mob::AreaSpell(Lua_Mob center, int32 spell_id, bool affect_caster, int16 resist_adjust) { Lua_Safe_Call_Void(); entity_list.AESpell(self, center, spell_id, affect_caster, resist_adjust); } -void Lua_Mob::AreaSpell(Lua_Mob center, uint16 spell_id, bool affect_caster, int16 resist_adjust, int max_targets) +void Lua_Mob::AreaSpell(Lua_Mob center, int32 spell_id, bool affect_caster, int16 resist_adjust, int max_targets) { Lua_Safe_Call_Void(); entity_list.AESpell(self, center, spell_id, affect_caster, resist_adjust, &max_targets); } -void Lua_Mob::MassGroupBuff(Lua_Mob center, uint16 spell_id) +void Lua_Mob::MassGroupBuff(Lua_Mob center, int32 spell_id) { Lua_Safe_Call_Void(); entity_list.MassGroupBuff(self, center, spell_id); } -void Lua_Mob::MassGroupBuff(Lua_Mob center, uint16 spell_id, bool affect_caster) +void Lua_Mob::MassGroupBuff(Lua_Mob center, int32 spell_id, bool affect_caster) { Lua_Safe_Call_Void(); entity_list.MassGroupBuff(self, center, spell_id, affect_caster); @@ -3566,10 +3566,10 @@ luabind::scope lua_register_mob() { .def("AreaAttack", (void(Lua_Mob::*)(float, int16, int))&Lua_Mob::AreaAttack) .def("AreaAttack", (void(Lua_Mob::*)(float, int16, int, bool))&Lua_Mob::AreaAttack) .def("AreaAttack", (void(Lua_Mob::*)(float, int16, int, bool, int))&Lua_Mob::AreaAttack) - .def("AreaSpell", (void(Lua_Mob::*)(Lua_Mob, uint16))&Lua_Mob::AreaSpell) - .def("AreaSpell", (void(Lua_Mob::*)(Lua_Mob, uint16, bool))&Lua_Mob::AreaSpell) - .def("AreaSpell", (void(Lua_Mob::*)(Lua_Mob, uint16, bool, int16))&Lua_Mob::AreaSpell) - .def("AreaSpell", (void(Lua_Mob::*)(Lua_Mob, uint16, bool, int16, int))&Lua_Mob::AreaSpell) + .def("AreaSpell", (void(Lua_Mob::*)(Lua_Mob, int32))&Lua_Mob::AreaSpell) + .def("AreaSpell", (void(Lua_Mob::*)(Lua_Mob, int32, bool))&Lua_Mob::AreaSpell) + .def("AreaSpell", (void(Lua_Mob::*)(Lua_Mob, int32, bool, int16))&Lua_Mob::AreaSpell) + .def("AreaSpell", (void(Lua_Mob::*)(Lua_Mob, int32, bool, int16, int))&Lua_Mob::AreaSpell) .def("Attack", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::Attack) .def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int))&Lua_Mob::Attack) .def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool))&Lua_Mob::Attack) @@ -3721,8 +3721,8 @@ luabind::scope lua_register_mob() { .def("Emote", &Lua_Mob::Emote) .def("EntityVariableExists", &Lua_Mob::EntityVariableExists) .def("FaceTarget", (void(Lua_Mob::*)(Lua_Mob))&Lua_Mob::FaceTarget) - .def("FindBuff", (bool(Lua_Mob::*)(uint16))&Lua_Mob::FindBuff) - .def("FindBuff", (bool(Lua_Mob::*)(uint16,uint16))&Lua_Mob::FindBuff) + .def("FindBuff", (bool(Lua_Mob::*)(int32))&Lua_Mob::FindBuff) + .def("FindBuff", (bool(Lua_Mob::*)(int32,uint16))&Lua_Mob::FindBuff) .def("FindBuffBySlot", (uint16(Lua_Mob::*)(int))&Lua_Mob::FindBuffBySlot) .def("FindGroundZ", (double(Lua_Mob::*)(double,double))&Lua_Mob::FindGroundZ) .def("FindGroundZ", (double(Lua_Mob::*)(double,double,double))&Lua_Mob::FindGroundZ) @@ -3739,17 +3739,17 @@ luabind::scope lua_register_mob() { .def("GetAC", &Lua_Mob::GetAC) .def("GetAGI", &Lua_Mob::GetAGI) .def("GetATK", &Lua_Mob::GetATK) - .def("GetActDoTDamage", (int64(Lua_Mob::*)(uint16,int64,Lua_Mob))&Lua_Mob::GetActDoTDamage) - .def("GetActDoTDamage", (int64(Lua_Mob::*)(uint16,int64,Lua_Mob,bool))&Lua_Mob::GetActDoTDamage) + .def("GetActDoTDamage", (int64(Lua_Mob::*)(int32,int64,Lua_Mob))&Lua_Mob::GetActDoTDamage) + .def("GetActDoTDamage", (int64(Lua_Mob::*)(int32,int64,Lua_Mob,bool))&Lua_Mob::GetActDoTDamage) .def("GetActReflectedSpellDamage", &Lua_Mob::GetActReflectedSpellDamage) .def("GetActSpellCasttime", &Lua_Mob::GetActSpellCasttime) .def("GetActSpellCost", &Lua_Mob::GetActSpellCost) .def("GetActSpellDuration", &Lua_Mob::GetActSpellDuration) - .def("GetActSpellDamage", (int64(Lua_Mob::*)(uint16,int64))&Lua_Mob::GetActSpellDamage) - .def("GetActSpellDamage", (int64(Lua_Mob::*)(uint16,int64,Lua_Mob))&Lua_Mob::GetActSpellDamage) - .def("GetActSpellHealing", (int64(Lua_Mob::*)(uint16,int64))&Lua_Mob::GetActSpellHealing) - .def("GetActSpellHealing", (int64(Lua_Mob::*)(uint16,int64,Lua_Mob))&Lua_Mob::GetActSpellHealing) - .def("GetActSpellHealing", (int64(Lua_Mob::*)(uint16,int64,Lua_Mob,bool))&Lua_Mob::GetActSpellHealing) + .def("GetActSpellDamage", (int64(Lua_Mob::*)(int32,int64))&Lua_Mob::GetActSpellDamage) + .def("GetActSpellDamage", (int64(Lua_Mob::*)(int32,int64,Lua_Mob))&Lua_Mob::GetActSpellDamage) + .def("GetActSpellHealing", (int64(Lua_Mob::*)(int32,int64))&Lua_Mob::GetActSpellHealing) + .def("GetActSpellHealing", (int64(Lua_Mob::*)(int32,int64,Lua_Mob))&Lua_Mob::GetActSpellHealing) + .def("GetActSpellHealing", (int64(Lua_Mob::*)(int32,int64,Lua_Mob,bool))&Lua_Mob::GetActSpellHealing) .def("GetActSpellRange", &Lua_Mob::GetActSpellRange) .def("GetAggroRange", (float(Lua_Mob::*)(void))&Lua_Mob::GetAggroRange) .def("GetAllowBeneficial", (bool(Lua_Mob::*)(void))&Lua_Mob::GetAllowBeneficial) @@ -3996,8 +3996,8 @@ luabind::scope lua_register_mob() { .def("IsWarriorClass", &Lua_Mob::IsWarriorClass) .def("IsWisdomCasterClass", &Lua_Mob::IsWisdomCasterClass) .def("Kill", (void(Lua_Mob::*)(void))&Lua_Mob::Kill) - .def("MassGroupBuff", (void(Lua_Mob::*)(Lua_Mob, uint16))&Lua_Mob::MassGroupBuff) - .def("MassGroupBuff", (void(Lua_Mob::*)(Lua_Mob, uint16, bool))&Lua_Mob::MassGroupBuff) + .def("MassGroupBuff", (void(Lua_Mob::*)(Lua_Mob, int32))&Lua_Mob::MassGroupBuff) + .def("MassGroupBuff", (void(Lua_Mob::*)(Lua_Mob, int32, bool))&Lua_Mob::MassGroupBuff) .def("Mesmerize", (void(Lua_Mob::*)(void))&Lua_Mob::Mesmerize) .def("Message", &Lua_Mob::Message) .def("MessageString", &Lua_Mob::MessageString) diff --git a/zone/lua_mob.h b/zone/lua_mob.h index e2a45be11..e8f78c828 100644 --- a/zone/lua_mob.h +++ b/zone/lua_mob.h @@ -109,8 +109,8 @@ public: uint8 GetInvisibleUndeadLevel(); void SetSeeInvisibleLevel(uint8 invisible_level); void SetSeeInvisibleUndeadLevel(uint8 invisible_level); - bool FindBuff(uint16 spell_id); - bool FindBuff(uint16 spell_id, uint16 caster_id); + bool FindBuff(int32 spell_id); + bool FindBuff(int32 spell_id, uint16 caster_id); uint16 FindBuffBySlot(int slot); uint32 BuffCount(); uint32 BuffCount(bool is_beneficial); @@ -491,7 +491,7 @@ public: bool TryFinishingBlow(Lua_Mob defender, int64 &damage); int GetBodyType(); int GetOrigBodyType(); - void CheckNumHitsRemaining(int type, int32 buff_slot, uint16 spell_id); + void CheckNumHitsRemaining(int type, int32 buff_slot, int32 spell_id); void DeleteBucket(std::string bucket_name); std::string GetBucket(std::string bucket_name); std::string GetBucketExpires(std::string bucket_name); @@ -552,18 +552,18 @@ public: float GetDefaultRaceSize(); float GetDefaultRaceSize(int race_id); float GetDefaultRaceSize(int race_id, int gender_id); - int64 GetActDoTDamage(uint16 spell_id, int64 value, Lua_Mob target); - int64 GetActDoTDamage(uint16 spell_id, int64 value, Lua_Mob target, bool from_buff_tic); - int64 GetActReflectedSpellDamage(uint16 spell_id, int64 value, int effectiveness); - int GetActSpellCasttime(uint16 spell_id, uint32 cast_time); - int GetActSpellCost(uint16 spell_id, int cost); - int64 GetActSpellDamage(uint16 spell_id, int64 value); - int64 GetActSpellDamage(uint16 spell_id, int64 value, Lua_Mob target); - int GetActSpellDuration(uint16 spell_id, int duration); - int64 GetActSpellHealing(uint16 spell_id, int64 value); - int64 GetActSpellHealing(uint16 spell_id, int64 value, Lua_Mob target); - int64 GetActSpellHealing(uint16 spell_id, int64 value, Lua_Mob target, bool from_buff_tic); - float GetActSpellRange(uint16 spell_id, float range); + int64 GetActDoTDamage(int32 spell_id, int64 value, Lua_Mob target); + int64 GetActDoTDamage(int32 spell_id, int64 value, Lua_Mob target, bool from_buff_tic); + int64 GetActReflectedSpellDamage(int32 spell_id, int64 value, int effectiveness); + int GetActSpellCasttime(int32 spell_id, uint32 cast_time); + int GetActSpellCost(int32 spell_id, int cost); + int64 GetActSpellDamage(int32 spell_id, int64 value); + int64 GetActSpellDamage(int32 spell_id, int64 value, Lua_Mob target); + int GetActSpellDuration(int32 spell_id, int duration); + int64 GetActSpellHealing(int32 spell_id, int64 value); + int64 GetActSpellHealing(int32 spell_id, int64 value, Lua_Mob target); + int64 GetActSpellHealing(int32 spell_id, int64 value, Lua_Mob target, bool from_buff_tic); + float GetActSpellRange(int32 spell_id, float range); uint32 GetRemainingTimeMS(const char* timer_name); uint32 GetTimerDurationMS(const char* timer_name); bool HasTimer(const char* timer_name); @@ -619,12 +619,12 @@ public: void AreaAttack(float distance, int16 slot_id, int count); void AreaAttack(float distance, int16 slot_id, int count, bool is_from_spell); void AreaAttack(float distance, int16 slot_id, int count, bool is_from_spell, int attack_rounds); - void AreaSpell(Lua_Mob center, uint16 spell_id); - void AreaSpell(Lua_Mob center, uint16 spell_id, bool affect_caster); - void AreaSpell(Lua_Mob center, uint16 spell_id, bool affect_caster, int16 resist_adjust); - void AreaSpell(Lua_Mob center, uint16 spell_id, bool affect_caster, int16 resist_adjust, int max_targets); - void MassGroupBuff(Lua_Mob center, uint16 spell_id); - void MassGroupBuff(Lua_Mob center, uint16 spell_id, bool affect_caster); + void AreaSpell(Lua_Mob center, int32 spell_id); + void AreaSpell(Lua_Mob center, int32 spell_id, bool affect_caster); + void AreaSpell(Lua_Mob center, int32 spell_id, bool affect_caster, int16 resist_adjust); + void AreaSpell(Lua_Mob center, int32 spell_id, bool affect_caster, int16 resist_adjust, int max_targets); + void MassGroupBuff(Lua_Mob center, int32 spell_id); + void MassGroupBuff(Lua_Mob center, int32 spell_id, bool affect_caster); void BuffFadeBeneficial(); void BuffFadeDetrimental(); void BuffFadeDetrimentalByCaster(Lua_Mob caster); diff --git a/zone/lua_mod.cpp b/zone/lua_mod.cpp index 00cdd3426..94d1b778b 100644 --- a/zone/lua_mod.cpp +++ b/zone/lua_mod.cpp @@ -810,7 +810,7 @@ void LuaMod::GetExperienceForKill(Client *self, Mob *against, uint64 &returnValu } } -void LuaMod::IsImmuneToSpell(Mob *self, Mob* caster, uint16 spell_id, bool &return_value, bool &ignore_default) +void LuaMod::IsImmuneToSpell(Mob *self, Mob* caster, int32 spell_id, bool &return_value, bool &ignore_default) { int start = lua_gettop(L); @@ -862,7 +862,7 @@ void LuaMod::IsImmuneToSpell(Mob *self, Mob* caster, uint16 spell_id, bool &retu } } -void LuaMod::CalcSpellEffectValue_formula(Mob *self, uint32 formula, int64 base_value, int64 max_value, int caster_level, uint16 spell_id, int ticsremaining, int64 &returnValue, bool &ignoreDefault) +void LuaMod::CalcSpellEffectValue_formula(Mob *self, uint32 formula, int64 base_value, int64 max_value, int caster_level, int32 spell_id, int ticsremaining, int64 &returnValue, bool &ignoreDefault) { int start = lua_gettop(L); int64 retval = 0; @@ -989,7 +989,7 @@ void LuaMod::RegisterBug(Client *self, BaseBugReportsRepository::BugReports bug, } -void LuaMod::CommonDamage(Mob *self, Mob* attacker, int64 value, uint16 spell_id, int skill_used, bool avoidable, int8 buff_slot, bool buff_tic, int special, int64 &return_value, bool &ignore_default) +void LuaMod::CommonDamage(Mob *self, Mob* attacker, int64 value, int32 spell_id, int skill_used, bool avoidable, int8 buff_slot, bool buff_tic, int special, int64 &return_value, bool &ignore_default) { int start = lua_gettop(L); @@ -1048,7 +1048,7 @@ void LuaMod::CommonDamage(Mob *self, Mob* attacker, int64 value, uint16 spell_id } -void LuaMod::HealDamage(Mob *self, Mob* caster, uint64 value, uint16 spell_id, uint64 &return_value, bool &ignore_default) +void LuaMod::HealDamage(Mob *self, Mob* caster, uint64 value, int32 spell_id, uint64 &return_value, bool &ignore_default) { int start = lua_gettop(L); diff --git a/zone/lua_mod.h b/zone/lua_mod.h index baaeed396..baddd9d42 100644 --- a/zone/lua_mod.h +++ b/zone/lua_mod.h @@ -44,13 +44,13 @@ public: void TryCriticalHit(Mob *self, Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault); void GetRequiredAAExperience(Client *self, uint32 &returnValue, bool &ignoreDefault); void GetEXPForLevel(Client *self, uint16 level, uint32 &returnValue, bool &ignoreDefault); - void IsImmuneToSpell(Mob *self, Mob* caster, uint16 spell_id, bool &return_value, bool &ignore_default); + void IsImmuneToSpell(Mob *self, Mob* caster, int32 spell_id, bool &return_value, bool &ignore_default); void GetExperienceForKill(Client *self, Mob *against, uint64 &returnValue, bool &ignoreDefault); - void CalcSpellEffectValue_formula(Mob *self, uint32 formula, int64 base_value, int64 max_value, int caster_level, uint16 spell_id, int ticsremaining, int64 &returnValue, bool &ignoreDefault); + void CalcSpellEffectValue_formula(Mob *self, uint32 formula, int64 base_value, int64 max_value, int caster_level, int32 spell_id, int ticsremaining, int64 &returnValue, bool &ignoreDefault); void UpdatePersonalFaction(Mob *self, int32 npc_value, int32 faction_id, int32 current_value, int32 temp, int32 this_faction_min, int32 this_faction_max, int32 &return_value, bool &ignore_default); void RegisterBug(Client *self, BaseBugReportsRepository::BugReports bug, bool &ignore_default); - void CommonDamage(Mob *self, Mob* attacker, int64 value, uint16 spell_id, int skill_used, bool avoidable, int8 buff_slot, bool buff_tic, int special, int64 &return_value, bool &ignore_default); - void HealDamage(Mob *self, Mob* caster, uint64 value, uint16 spell_id, uint64 &return_value, bool &ignore_default); + void CommonDamage(Mob *self, Mob* attacker, int64 value, int32 spell_id, int skill_used, bool avoidable, int8 buff_slot, bool buff_tic, int special, int64 &return_value, bool &ignore_default); + void HealDamage(Mob *self, Mob* caster, uint64 value, int32 spell_id, uint64 &return_value, bool &ignore_default); void SetEXP(Mob *self, ExpSource exp_source, uint64 current_exp, uint64 set_exp, bool is_rezz_exp, uint64 &return_value, bool &ignore_default); void SetAAEXP(Mob *self, ExpSource exp_source, uint64 current_aa_exp, uint64 set_aa_exp, bool is_rezz_exp, uint64 &return_value, bool &ignore_default); private: diff --git a/zone/lua_npc.cpp b/zone/lua_npc.cpp index 30c4849d0..ff995a517 100644 --- a/zone/lua_npc.cpp +++ b/zone/lua_npc.cpp @@ -736,12 +736,12 @@ void Lua_NPC::SetLDoNTrapType(uint8 trap_type) { self->SetLDoNTrapType(trap_type); } -uint16 Lua_NPC::GetLDoNTrapSpellID() { +int32 Lua_NPC::GetLDoNTrapSpellID() { Lua_Safe_Call_Int(); return self->GetLDoNTrapSpellID(); } -void Lua_NPC::SetLDoNTrapSpellID(uint16 spell_id) { +void Lua_NPC::SetLDoNTrapSpellID(int32 spell_id) { Lua_Safe_Call_Void(); self->SetLDoNTrapSpellID(spell_id); } @@ -1035,7 +1035,7 @@ luabind::scope lua_register_npc() { .def("GetMinDMG", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetMinDMG) .def("GetLDoNLockedSkill", (uint16(Lua_NPC::*)(void))&Lua_NPC::GetLDoNLockedSkill) .def("GetLDoNTrapType", (uint8(Lua_NPC::*)(void))&Lua_NPC::GetLDoNTrapType) - .def("GetLDoNTrapSpellID", (uint16(Lua_NPC::*)(void))&Lua_NPC::GetLDoNTrapSpellID) + .def("GetLDoNTrapSpellID", (int32 (Lua_NPC::*)(void))&Lua_NPC::GetLDoNTrapSpellID) .def("GetNPCAggro", (bool(Lua_NPC::*)(void))&Lua_NPC::GetNPCAggro) .def("GetNPCFactionID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCFactionID) .def("GetNPCHate", (int64(Lua_NPC::*)(Lua_Mob))&Lua_NPC::GetNPCHate) @@ -1119,7 +1119,7 @@ luabind::scope lua_register_npc() { .def("SetLDoNLockedSkill", (void(Lua_NPC::*)(uint16))&Lua_NPC::SetLDoNLockedSkill) .def("SetLDoNTrapped", (void(Lua_NPC::*)(bool))&Lua_NPC::SetLDoNTrapped) .def("SetLDoNTrapDetected", (void(Lua_NPC::*)(bool))&Lua_NPC::SetLDoNTrapDetected) - .def("SetLDoNTrapSpellID", (void(Lua_NPC::*)(uint16))&Lua_NPC::SetLDoNTrapSpellID) + .def("SetLDoNTrapSpellID", (void(Lua_NPC::*)(int32 ))&Lua_NPC::SetLDoNTrapSpellID) .def("SetLDoNTrapType", (void(Lua_NPC::*)(uint8))&Lua_NPC::SetLDoNTrapType) .def("SetNPCAggro", (void(Lua_NPC::*)(bool))&Lua_NPC::SetNPCAggro) .def("SetNPCFactionID", (void(Lua_NPC::*)(int))&Lua_NPC::SetNPCFactionID) diff --git a/zone/lua_npc.h b/zone/lua_npc.h index 83ead681c..846ad9a1c 100644 --- a/zone/lua_npc.h +++ b/zone/lua_npc.h @@ -183,8 +183,8 @@ public: void SetLDoNTrapped(bool is_trapped); uint8 GetLDoNTrapType(); void SetLDoNTrapType(uint8 trap_type); - uint16 GetLDoNTrapSpellID(); - void SetLDoNTrapSpellID(uint16 spell_id); + int32 GetLDoNTrapSpellID(); + void SetLDoNTrapSpellID(int32 spell_id); bool IsLDoNLocked(); void SetLDoNLocked(bool is_locked); uint16 GetLDoNLockedSkill(); diff --git a/zone/lua_packet.cpp b/zone/lua_packet.cpp index 73acc88ac..0c89438a2 100644 --- a/zone/lua_packet.cpp +++ b/zone/lua_packet.cpp @@ -540,7 +540,8 @@ luabind::scope lua_register_packet_opcodes() { luabind::value("Camp", static_cast(OP_Camp)), luabind::value("YellForHelp", static_cast(OP_YellForHelp)), luabind::value("SafePoint", static_cast(OP_SafePoint)), - luabind::value("Buff", static_cast(OP_Buff)), + luabind::value("Buff", static_cast(OP_BuffDefinition)), + luabind::value("BuffDefinition", static_cast(OP_BuffDefinition)), luabind::value("ColoredText", static_cast(OP_ColoredText)), luabind::value("SpecialMesg", static_cast(OP_SpecialMesg)), luabind::value("Consent", static_cast(OP_Consent)), @@ -808,7 +809,8 @@ luabind::scope lua_register_packet_opcodes() { luabind::value("CancelTask", static_cast(OP_CancelTask)), luabind::value("TaskHistoryRequest", static_cast(OP_TaskHistoryRequest)), luabind::value("TaskHistoryReply", static_cast(OP_TaskHistoryReply)), - luabind::value("PetBuffWindow", static_cast(OP_PetBuffWindow)), + luabind::value("PetBuffWindow", static_cast(OP_RefreshPetBuffs)), + luabind::value("RefreshPetBuffs", static_cast(OP_RefreshPetBuffs)), luabind::value("RaidJoin", static_cast(OP_RaidJoin)), luabind::value("Translocate", static_cast(OP_Translocate)), luabind::value("Sacrifice", static_cast(OP_Sacrifice)), @@ -868,7 +870,8 @@ luabind::scope lua_register_packet_opcodes() { luabind::value("GroupRoles", static_cast(OP_GroupRoles)), luabind::value("SendFindableNPCs", static_cast(OP_SendFindableNPCs)), luabind::value("HideCorpse", static_cast(OP_HideCorpse)), - luabind::value("TargetBuffs", static_cast(OP_TargetBuffs)), + luabind::value("TargetBuffs", static_cast(OP_RefreshTargetBuffs)), + luabind::value("RefreshTargetBuffs", static_cast(OP_RefreshTargetBuffs)), luabind::value("TradeBusy", static_cast(OP_TradeBusy)), luabind::value("GuildUpdate", static_cast(OP_GuildUpdate)), luabind::value("CameraEffect", static_cast(OP_CameraEffect)), @@ -892,7 +895,8 @@ luabind::scope lua_register_packet_opcodes() { luabind::value("DzCompass", static_cast(OP_DzCompass)), luabind::value("DzChooseZone", static_cast(OP_DzChooseZone)), luabind::value("DzChooseZoneReply", static_cast(OP_DzChooseZoneReply)), - luabind::value("BuffCreate", static_cast(OP_BuffCreate)), + luabind::value("BuffCreate", static_cast(OP_RefreshBuffs)), + luabind::value("RefreshBuffs", static_cast(OP_RefreshBuffs)), luabind::value("GuildStatus", static_cast(OP_GuildStatus)), luabind::value("BuffRemoveRequest", static_cast(OP_BuffRemoveRequest)), luabind::value("CorpseDrag", static_cast(OP_CorpseDrag)), diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index d45ea9506..a1c26c9d1 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -757,7 +757,7 @@ int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *cl return 0; } -int LuaParser::EventSpell(QuestEventID evt, Mob* mob, Client *client, uint32 spell_id, std::string data, uint32 extra_data, +int LuaParser::EventSpell(QuestEventID evt, Mob* mob, Client *client, int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers) { evt = ConvertLuaEvent(evt); if(evt >= _LargestEventID) { @@ -773,7 +773,7 @@ int LuaParser::EventSpell(QuestEventID evt, Mob* mob, Client *client, uint32 spe return _EventSpell(package_name, evt, mob, client, spell_id, data, extra_data, extra_pointers); } -int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, Mob* mob, Client *client, uint32 spell_id, std::string data, uint32 extra_data, +int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, Mob* mob, Client *client, int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers, luabind::adl::object *l_func) { const char *sub_name = LuaEvents[evt]; @@ -959,7 +959,7 @@ bool LuaParser::GlobalPlayerHasQuestSub(QuestEventID evt) { return HasFunction(subname, "global_player"); } -bool LuaParser::SpellHasQuestSub(uint32 spell_id, QuestEventID evt) { +bool LuaParser::SpellHasQuestSub(int32 spell_id, QuestEventID evt) { evt = ConvertLuaEvent(evt); if(evt >= _LargestEventID) { return false; @@ -1026,7 +1026,7 @@ void LuaParser::LoadItemScript(std::string filename, EQ::ItemInstance *item) { LoadScript(filename, package_name); } -void LuaParser::LoadSpellScript(std::string filename, uint32 spell_id) { +void LuaParser::LoadSpellScript(std::string filename, int32 spell_id) { std::string package_name = "spell_" + std::to_string(spell_id); LoadScript(filename, package_name); @@ -1533,7 +1533,7 @@ int LuaParser::DispatchEventItem(QuestEventID evt, Client *client, EQ::ItemInsta return ret; } -int LuaParser::DispatchEventSpell(QuestEventID evt, Mob* mob, Client *client, uint32 spell_id, std::string data, uint32 extra_data, +int LuaParser::DispatchEventSpell(QuestEventID evt, Mob* mob, Client *client, int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers) { evt = ConvertLuaEvent(evt); if(evt >= _LargestEventID) { @@ -1675,7 +1675,7 @@ uint64 LuaParser::GetExperienceForKill(Client *self, Mob *against, bool &ignoreD } -int64 LuaParser::CommonDamage(Mob *self, Mob* attacker, int64 value, uint16 spell_id, int skill_used, bool avoidable, int8 buff_slot, bool buff_tic, int special, bool &ignore_default) +int64 LuaParser::CommonDamage(Mob *self, Mob* attacker, int64 value, int32 spell_id, int skill_used, bool avoidable, int8 buff_slot, bool buff_tic, int special, bool &ignore_default) { int64 retval = 0; for (auto &mod : mods_) { @@ -1684,7 +1684,7 @@ int64 LuaParser::CommonDamage(Mob *self, Mob* attacker, int64 value, uint16 spel return retval; } -uint64 LuaParser::HealDamage(Mob *self, Mob* caster, uint64 value, uint16 spell_id, bool &ignore_default) +uint64 LuaParser::HealDamage(Mob *self, Mob* caster, uint64 value, int32 spell_id, bool &ignore_default) { uint64 retval = 0; for (auto &mod : mods_) { @@ -1693,7 +1693,7 @@ uint64 LuaParser::HealDamage(Mob *self, Mob* caster, uint64 value, uint16 spell_ return retval; } -bool LuaParser::IsImmuneToSpell(Mob *self, Mob *caster, uint16 spell_id, bool &ignore_default) +bool LuaParser::IsImmuneToSpell(Mob *self, Mob *caster, int32 spell_id, bool &ignore_default) { bool retval = false; for (auto &mod : mods_) { @@ -1702,7 +1702,7 @@ bool LuaParser::IsImmuneToSpell(Mob *self, Mob *caster, uint16 spell_id, bool &i return retval; } -int64 LuaParser::CalcSpellEffectValue_formula(Mob *self, uint32 formula, int64 base_value, int64 max_value, int caster_level, uint16 spell_id, int ticsremaining, bool &ignoreDefault) +int64 LuaParser::CalcSpellEffectValue_formula(Mob *self, uint32 formula, int64 base_value, int64 max_value, int caster_level, int32 spell_id, int ticsremaining, bool &ignoreDefault) { int64 retval = 0; for (auto &mod : mods_) { diff --git a/zone/lua_parser.h b/zone/lua_parser.h index 475f945af..7cb58da93 100644 --- a/zone/lua_parser.h +++ b/zone/lua_parser.h @@ -97,7 +97,7 @@ public: QuestEventID evt, Mob* mob, Client *client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers @@ -160,7 +160,7 @@ public: virtual bool HasGlobalQuestSub(QuestEventID evt); virtual bool PlayerHasQuestSub(QuestEventID evt); virtual bool GlobalPlayerHasQuestSub(QuestEventID evt); - virtual bool SpellHasQuestSub(uint32 spell_id, QuestEventID evt); + virtual bool SpellHasQuestSub(int32 spell_id, QuestEventID evt); virtual bool ItemHasQuestSub(EQ::ItemInstance *itm, QuestEventID evt); virtual bool EncounterHasQuestSub(std::string encounter_name, QuestEventID evt); virtual bool HasEncounterSub(const std::string& package_name, QuestEventID evt); @@ -176,7 +176,7 @@ public: virtual void LoadPlayerScript(std::string filename); virtual void LoadGlobalPlayerScript(std::string filename); virtual void LoadItemScript(std::string filename, EQ::ItemInstance *item); - virtual void LoadSpellScript(std::string filename, uint32 spell_id); + virtual void LoadSpellScript(std::string filename, int32 spell_id); virtual void LoadEncounterScript(std::string filename, std::string encounter_name); virtual void LoadBotScript(std::string filename); virtual void LoadGlobalBotScript(std::string filename); @@ -220,7 +220,7 @@ public: QuestEventID evt, Mob* mob, Client *client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers @@ -266,14 +266,14 @@ public: uint32 GetRequiredAAExperience(Client *self, bool &ignoreDefault); uint32 GetEXPForLevel(Client *self, uint16 level, bool &ignoreDefault); uint64 GetExperienceForKill(Client *self, Mob *against, bool &ignoreDefault); - int64 CalcSpellEffectValue_formula(Mob *self, uint32 formula, int64 base_value, int64 max_value, int caster_level, uint16 spell_id, int ticsremaining, bool &ignoreDefault); + int64 CalcSpellEffectValue_formula(Mob *self, uint32 formula, int64 base_value, int64 max_value, int caster_level, int32 spell_id, int ticsremaining, bool &ignoreDefault); int32 UpdatePersonalFaction(Mob *self, int32 npc_value, int32 faction_id, int32 current_value, int32 temp, int32 this_faction_min, int32 this_faction_max, bool &ignore_default); void RegisterBug(Client *self, BaseBugReportsRepository::BugReports bug, bool &ignore_default); - int64 CommonDamage(Mob *self, Mob* attacker, int64 value, uint16 spell_id, int skill_used, bool avoidable, int8 buff_slot, bool buff_tic, int special, bool &ignore_default); - uint64 HealDamage(Mob *self, Mob* caster, uint64 value, uint16 spell_id, bool &ignore_default); + int64 CommonDamage(Mob *self, Mob* attacker, int64 value, int32 spell_id, int skill_used, bool avoidable, int8 buff_slot, bool buff_tic, int special, bool &ignore_default); + uint64 HealDamage(Mob *self, Mob* caster, uint64 value, int32 spell_id, bool &ignore_default); uint64 SetEXP(Mob *self, ExpSource exp_source, uint64 current_exp, uint64 set_exp, bool is_rezz_exp, bool &ignore_default); uint64 SetAAEXP(Mob *self, ExpSource exp_source, uint64 current_aa_exp, uint64 set_aa_exp, bool is_rezz_exp, bool &ignore_default); - bool IsImmuneToSpell(Mob *self, Mob* caster, uint16 spell_id, bool &ignore_default); + bool IsImmuneToSpell(Mob *self, Mob* caster, int32 spell_id, bool &ignore_default); private: LuaParser(); LuaParser(const LuaParser&); @@ -314,7 +314,7 @@ private: QuestEventID evt, Mob* mob, Client *client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers, diff --git a/zone/lua_parser_events.cpp b/zone/lua_parser_events.cpp index a768e18c1..be590a007 100644 --- a/zone/lua_parser_events.cpp +++ b/zone/lua_parser_events.cpp @@ -327,7 +327,7 @@ void handle_npc_death( lua_pushinteger(L, Strings::ToInt(sep.arg[1])); lua_setfield(L, -2, "damage"); - const uint32 spell_id = Strings::ToUnsignedInt(sep.arg[2]); + const int32 spell_id = Strings::ToInt(sep.arg[2]); if (IsValidSpell(spell_id)) { Lua_Spell l_spell(&spells[spell_id]); luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell); @@ -384,7 +384,7 @@ void handle_npc_cast( ) { Seperator sep(data.c_str()); - const uint32 spell_id = Strings::ToUnsignedInt(sep.arg[0]); + const int32 spell_id = Strings::ToInt(sep.arg[0]); Lua_Spell l_spell(IsValidSpell(spell_id) ? &spells[spell_id] : nullptr); luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell); l_spell_o.push(L); @@ -669,14 +669,14 @@ void handle_npc_spell_blocked( lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1])); lua_setfield(L, -2, "cast_spell_id"); - const uint32 blocking_spell_id = Strings::ToUnsignedInt(sep.arg[0]); + const int32 blocking_spell_id = Strings::ToInt(sep.arg[0]); Lua_Spell l_spell_one(IsValidSpell(blocking_spell_id) ? &spells[blocking_spell_id] : nullptr); luabind::adl::object l_spell_one_o = luabind::adl::object(L, l_spell_one); l_spell_one_o.push(L); lua_setfield(L, -2, "blocking_spell"); - const uint32 cast_spell_id = Strings::ToUnsignedInt(sep.arg[0]); + const int32 cast_spell_id = Strings::ToInt(sep.arg[0]); Lua_Spell l_spell_two(IsValidSpell(cast_spell_id) ? &spells[cast_spell_id] : nullptr); luabind::adl::object l_spell_two_o = luabind::adl::object(L, l_spell_two); @@ -758,7 +758,7 @@ void handle_player_death( lua_pushinteger(L, Strings::ToInt(sep.arg[1])); lua_setfield(L, -2, "damage"); - const uint32 spell_id = Strings::ToUnsignedInt(sep.arg[2]); + const int32 spell_id = Strings::ToInt(sep.arg[2]); if (IsValidSpell(spell_id)) { Lua_Spell l_spell(&spells[spell_id]); luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell); @@ -1784,14 +1784,14 @@ void handle_player_spell_blocked( lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1])); lua_setfield(L, -2, "cast_spell_id"); - const uint32 blocking_spell_id = Strings::ToUnsignedInt(sep.arg[0]); + const int32 blocking_spell_id = Strings::ToInt(sep.arg[0]); Lua_Spell l_spell_one(IsValidSpell(blocking_spell_id) ? &spells[blocking_spell_id] : nullptr); luabind::adl::object l_spell_one_o = luabind::adl::object(L, l_spell_one); l_spell_one_o.push(L); lua_setfield(L, -2, "blocking_spell"); - const uint32 cast_spell_id = Strings::ToUnsignedInt(sep.arg[0]); + const int32 cast_spell_id = Strings::ToInt(sep.arg[0]); Lua_Spell l_spell_two(IsValidSpell(cast_spell_id) ? &spells[cast_spell_id] : nullptr); luabind::adl::object l_spell_two_o = luabind::adl::object(L, l_spell_two); @@ -2083,7 +2083,7 @@ void handle_spell_event( lua_State* L, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers @@ -2132,7 +2132,7 @@ void handle_translocate_finish( lua_State* L, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers @@ -2184,7 +2184,7 @@ void handle_spell_null( lua_State* L, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers @@ -2460,7 +2460,7 @@ void handle_bot_cast( ) { Seperator sep(data.c_str()); - const uint32 spell_id = Strings::ToUnsignedInt(sep.arg[0]); + const int32 spell_id = Strings::ToInt(sep.arg[0]); Lua_Spell l_spell(IsValidSpell(spell_id) ? &spells[spell_id] : nullptr); luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell); l_spell_o.push(L); @@ -2524,7 +2524,7 @@ void handle_bot_death( lua_pushinteger(L, Strings::ToInt(sep.arg[1])); lua_setfield(L, -2, "damage"); - const uint32 spell_id = Strings::ToUnsignedInt(sep.arg[2]); + const int32 spell_id = Strings::ToInt(sep.arg[2]); if (IsValidSpell(spell_id)) { Lua_Spell l_spell(&spells[spell_id]); luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell); @@ -2907,14 +2907,14 @@ void handle_bot_spell_blocked( lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1])); lua_setfield(L, -2, "cast_spell_id"); - const uint32 blocking_spell_id = Strings::ToUnsignedInt(sep.arg[0]); + const int32 blocking_spell_id = Strings::ToInt(sep.arg[0]); Lua_Spell l_spell_one(IsValidSpell(blocking_spell_id) ? &spells[blocking_spell_id] : nullptr); luabind::adl::object l_spell_one_o = luabind::adl::object(L, l_spell_one); l_spell_one_o.push(L); lua_setfield(L, -2, "blocking_spell"); - const uint32 cast_spell_id = Strings::ToUnsignedInt(sep.arg[0]); + const int32 cast_spell_id = Strings::ToInt(sep.arg[0]); Lua_Spell l_spell_two(IsValidSpell(cast_spell_id) ? &spells[cast_spell_id] : nullptr); luabind::adl::object l_spell_two_o = luabind::adl::object(L, l_spell_two); @@ -2993,7 +2993,7 @@ void handle_zone_death( lua_pushinteger(L, Strings::ToInt(sep.arg[1])); lua_setfield(L, -2, "damage"); - const uint32 spell_id = Strings::ToUnsignedInt(sep.arg[2]); + const int32 spell_id = Strings::ToInt(sep.arg[2]); if (IsValidSpell(spell_id)) { Lua_Spell l_spell(&spells[spell_id]); luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell); diff --git a/zone/lua_parser_events.h b/zone/lua_parser_events.h index b436691fd..be1fd9967 100644 --- a/zone/lua_parser_events.h +++ b/zone/lua_parser_events.h @@ -43,7 +43,7 @@ namespace EQ typedef void(*NPCArgumentHandler)(QuestInterface*, lua_State*, NPC*, Mob*, std::string, uint32, std::vector*); typedef void(*PlayerArgumentHandler)(QuestInterface*, lua_State*, Client*, std::string, uint32, std::vector*); typedef void(*ItemArgumentHandler)(QuestInterface*, lua_State*, Client*, EQ::ItemInstance*, Mob*, std::string, uint32, std::vector*); -typedef void(*SpellArgumentHandler)(QuestInterface*, lua_State*, Mob*, Client*, uint32, std::string, uint32, std::vector*); +typedef void(*SpellArgumentHandler)(QuestInterface*, lua_State*, Mob*, Client*, int32, std::string, uint32, std::vector*); typedef void(*EncounterArgumentHandler)(QuestInterface*, lua_State*, Encounter* encounter, std::string, uint32, std::vector*); typedef void(*BotArgumentHandler)(QuestInterface*, lua_State*, Bot*, Mob*, std::string, uint32, std::vector*); typedef void(*MercArgumentHandler)(QuestInterface*, lua_State*, Merc*, Mob*, std::string, uint32, std::vector*); @@ -1060,7 +1060,7 @@ void handle_spell_event( lua_State* L, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers @@ -1071,7 +1071,7 @@ void handle_translocate_finish( lua_State* L, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers @@ -1082,7 +1082,7 @@ void handle_spell_null( lua_State* L, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector *extra_pointers diff --git a/zone/lua_stat_bonuses.cpp b/zone/lua_stat_bonuses.cpp index 51dc45dcd..46b02f89e 100644 --- a/zone/lua_stat_bonuses.cpp +++ b/zone/lua_stat_bonuses.cpp @@ -269,7 +269,7 @@ int32 Lua_StatBonuses::GetHeroicCorrup() const { return self->HeroicCorrup; } -uint16 Lua_StatBonuses::GetDamageShieldSpellID() const { +int32 Lua_StatBonuses::GetDamageShieldSpellID() const { Lua_Safe_Call_Int(); return self->DamageShieldSpellID; } @@ -299,7 +299,7 @@ int Lua_StatBonuses::GetReverseDamageShield() const { return self->ReverseDamageShield; } -uint16 Lua_StatBonuses::GetReverseDamageShieldSpellID() const { +int32 Lua_StatBonuses::GetReverseDamageShieldSpellID() const { Lua_Safe_Call_Int(); return self->ReverseDamageShieldSpellID; } diff --git a/zone/lua_stat_bonuses.h b/zone/lua_stat_bonuses.h index eac709792..e33018a5e 100644 --- a/zone/lua_stat_bonuses.h +++ b/zone/lua_stat_bonuses.h @@ -91,13 +91,13 @@ public: int32 GetCorrup() const; int32 GetCorrupCapMod() const; int32 GetHeroicCorrup() const; - uint16 GetDamageShieldSpellID() const; + int32 GetDamageShieldSpellID() const; int GetDamageShield() const; int GetDamageShieldType() const; int GetSpellDamageShield() const; int GetSpellShield() const; int GetReverseDamageShield() const; - uint16 GetReverseDamageShieldSpellID() const; + int32 GetReverseDamageShieldSpellID() const; int GetReverseDamageShieldType() const; int Getmovementspeed() const; int32 Gethaste() const; diff --git a/zone/lua_zone.cpp b/zone/lua_zone.cpp index 863858808..afbd4fabc 100644 --- a/zone/lua_zone.cpp +++ b/zone/lua_zone.cpp @@ -624,7 +624,7 @@ bool Lua_Zone::IsSpecialBindLocation(float x, float y, float z, float heading) return self->IsSpecialBindLocation(glm::vec4(x, y, z, heading)); } -bool Lua_Zone::IsSpellBlocked(uint32 spell_id, float x, float y, float z) +bool Lua_Zone::IsSpellBlocked(int32 spell_id, float x, float y, float z) { Lua_Safe_Call_Bool(); return self->IsSpellBlocked(spell_id, glm::vec3(x, y, z)); diff --git a/zone/lua_zone.h b/zone/lua_zone.h index a81a94034..5ed4199c4 100644 --- a/zone/lua_zone.h +++ b/zone/lua_zone.h @@ -144,7 +144,7 @@ public: bool IsRaining(); bool IsSnowing(); bool IsSpecialBindLocation(float x, float y, float z, float heading); - bool IsSpellBlocked(uint32 spell_id, float x, float y, float z); + bool IsSpellBlocked(int32 spell_id, float x, float y, float z); bool IsStaticZone(); bool IsUCSServerAvailable(); bool IsWaterZone(float z); diff --git a/zone/merc.cpp b/zone/merc.cpp index d9212db8d..037ad5da6 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1568,7 +1568,7 @@ bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, return false; } -bool Merc::AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore) { +bool Merc::AIDoSpellCast(int32 spellid, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore) { bool result = false; MercSpell mercSpell = GetMercSpellBySpellID(this, spellid); @@ -2136,7 +2136,7 @@ bool Merc::HasOrMayGetAggro() { return mayGetAggro; } -bool Merc::CheckAENuke(Merc* caster, Mob* tar, uint16 spell_id, uint8 &numTargets) { +bool Merc::CheckAENuke(Merc* caster, Mob* tar, int32 spell_id, uint8 &numTargets) { std::list npc_list; entity_list.GetNPCList(npc_list); @@ -2160,7 +2160,7 @@ bool Merc::CheckAENuke(Merc* caster, Mob* tar, uint16 spell_id, uint8 &numTarget return false; } -int64 Merc::GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic) { +int64 Merc::GetFocusEffect(focusType type, int32 spell_id, bool from_buff_tic) { int32 realTotal = 0; int32 realTotal2 = 0; @@ -2526,7 +2526,7 @@ MercSpell Merc::GetFirstMercSpellBySpellType(Merc* caster, uint32 spellType) { return result; } -MercSpell Merc::GetMercSpellBySpellID(Merc* caster, uint16 spellid) { +MercSpell Merc::GetMercSpellBySpellID(Merc* caster, int32 spellid) { MercSpell result; result.spellid = 0; @@ -3596,7 +3596,7 @@ bool Merc::UseDiscipline(int32 spell_id, int32 target) { return(true); } -void Merc::SetSpellRecastTimer(uint16 timer_id, uint16 spellid, uint32 recast_delay) { +void Merc::SetSpellRecastTimer(uint16 timer_id, int32 spellid, uint32 recast_delay) { if(timer_id > 0) { MercTimer timer; timer.timerid = timer_id; @@ -3617,7 +3617,7 @@ int32 Merc::GetSpellRecastTimer(Merc *caster, uint16 timer_id) { return result; } -bool Merc::CheckSpellRecastTimers(Merc *caster, uint16 spell_id) { +bool Merc::CheckSpellRecastTimers(Merc *caster, int32 spell_id) { if(caster) { MercSpell mercSpell = GetMercSpellBySpellID(caster, spell_id); if(mercSpell.spellid > 0 && mercSpell.time_cancast < Timer::GetCurrentTime()) { //checks spell recast @@ -3629,7 +3629,7 @@ bool Merc::CheckSpellRecastTimers(Merc *caster, uint16 spell_id) { return false; } -void Merc::SetDisciplineRecastTimer(uint16 timer_id, uint16 spellid, uint32 recast_delay) { +void Merc::SetDisciplineRecastTimer(uint16 timer_id, int32 spellid, uint32 recast_delay) { if(timer_id > 0) { MercTimer timer; timer.timerid = timer_id; @@ -3660,7 +3660,7 @@ int32 Merc::GetDisciplineRemainingTime(Merc *caster, uint16 timer_id) { return result; } -bool Merc::CheckDisciplineRecastTimers(Merc *caster, uint16 spell_id, uint16 timer_id) { +bool Merc::CheckDisciplineRecastTimers(Merc *caster, int32 spell_id, uint16 timer_id) { if(caster) { MercSpell mercSpell = GetMercSpellBySpellID(caster, spell_id); if(mercSpell.spellid > 0 && mercSpell.time_cancast < Timer::GetCurrentTime()) { //checks spell recast @@ -3673,7 +3673,7 @@ bool Merc::CheckDisciplineRecastTimers(Merc *caster, uint16 spell_id, uint16 tim return false; } -void Merc::SetSpellTimeCanCast(uint16 spellid, uint32 recast_delay) { +void Merc::SetSpellTimeCanCast(int32 spellid, uint32 recast_delay) { for (int i = 0; i < merc_spells.size(); i++) { if(merc_spells[i].spellid == spellid) { merc_spells[i].time_cancast = Timer::GetCurrentTime() + recast_delay; @@ -4046,7 +4046,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo return NPC::Attack(other, Hand, bRiposte, IsStrikethrough, IsFromSpell, opts); } -void Merc::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) +void Merc::Damage(Mob* other, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, eSpecialAttacks special) { if(IsDead() || IsCorpse()) return; @@ -4087,7 +4087,7 @@ Mob* Merc::GetOwnerOrSelf() { return Result; } -bool Merc::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillType attack_skill, uint8 killed_by, bool is_buff_tic) +bool Merc::Death(Mob* killer_mob, int64 damage, int32 spell, EQ::skills::SkillType attack_skill, uint8 killed_by, bool is_buff_tic) { if (!NPC::Death(killer_mob, damage, spell, attack_skill)) { return false; diff --git a/zone/merc.h b/zone/merc.h index 0eba77f17..7564420ce 100644 --- a/zone/merc.h +++ b/zone/merc.h @@ -47,7 +47,7 @@ constexpr int MAXMERCS = 11; const int MercAISpellRange = 100; // TODO: Write a method that calcs what the merc's spell range is based on spell, equipment, AA, whatever and replace this struct MercSpell { - uint16 spellid; // <= 0 = no spell + int32 spellid; // <= 0 = no spell uint32 type; // 0 = never, must be one (and only one) of the defined values int16 stance; // 0 = all, + = only this stance, - = all except this stance int16 slot; @@ -58,7 +58,7 @@ struct MercSpell { struct MercTimer { uint16 timerid; // EndurTimerIndex uint8 timertype; // 1 = spell, 2 = disc - uint16 spellid; // <= 0 = no spell + int32 spellid; // <= 0 = no spell uint32 time_cancast; // when we can cast this spell next }; @@ -68,8 +68,8 @@ public: virtual ~Merc(); //abstract virtual function implementations requird by base abstract class - virtual bool Death(Mob* killer_mob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, uint8 killed_by = 0, bool is_buff_tic = false); - virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None); + virtual bool Death(Mob* killer_mob, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, uint8 killed_by = 0, bool is_buff_tic = false); + virtual void Damage(Mob* from, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None); virtual bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr); virtual bool HasRaid() { return false; } @@ -84,7 +84,7 @@ public: //virtual bool AICastSpell(Mob* tar, int8 iChance, uint32 iSpellTypes); virtual bool AICastSpell(int8 iChance, uint32 iSpellTypes); - virtual bool AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0); + virtual bool AIDoSpellCast(int32 spellid, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0); virtual bool AI_EngagedCastCheck(); //virtual bool AI_PursueCastCheck(); virtual bool AI_IdleCastCheck(); @@ -100,20 +100,20 @@ public: // Merc Spell Casting Methods int8 GetChanceToCastBySpellType(uint32 spellType); - void SetSpellRecastTimer(uint16 timer_id, uint16 spellid, uint32 recast_delay); - void SetDisciplineRecastTimer(uint16 timer_id, uint16 spellid, uint32 recast_delay); - void SetSpellTimeCanCast(uint16 spellid, uint32 recast_delay); + void SetSpellRecastTimer(uint16 timer_id, int32 spellid, uint32 recast_delay); + void SetDisciplineRecastTimer(uint16 timer_id, int32 spellid, uint32 recast_delay); + void SetSpellTimeCanCast(int32 spellid, uint32 recast_delay); static int32 GetSpellRecastTimer(Merc *caster, uint16 timer_id); - static bool CheckSpellRecastTimers(Merc *caster, uint16 spellid); + static bool CheckSpellRecastTimers(Merc *caster, int32 spellid); static int32 GetDisciplineRecastTimer(Merc *caster, uint16 timer_id); - static bool CheckDisciplineRecastTimers(Merc *caster, uint16 spell_id, uint16 timer_id); + static bool CheckDisciplineRecastTimers(Merc *caster, int32 spell_id, uint16 timer_id); static int32 GetDisciplineRemainingTime(Merc *caster, uint16 timer_id); static std::list GetMercSpellsForSpellEffect(Merc* caster, int spellEffect); static std::list GetMercSpellsForSpellEffectAndTargetType(Merc* caster, int spellEffect, SpellTargetType targetType); static std::list GetMercSpellsBySpellType(Merc* caster, uint32 spellType); static MercSpell GetFirstMercSpellBySpellType(Merc* caster, uint32 spellType); static MercSpell GetFirstMercSpellForSingleTargetHeal(Merc* caster); - static MercSpell GetMercSpellBySpellID(Merc* caster, uint16 spellid); + static MercSpell GetMercSpellBySpellID(Merc* caster, int32 spellid); static MercSpell GetBestMercSpellForVeryFastHeal(Merc* caster); static MercSpell GetBestMercSpellForFastHeal(Merc* caster); static MercSpell GetBestMercSpellForHealOverTime(Merc* caster); @@ -133,7 +133,7 @@ public: static MercSpell GetBestMercSpellForAERainNuke(Merc* caster, Mob* target); static MercSpell GetBestMercSpellForNuke(Merc* caster); static MercSpell GetBestMercSpellForNukeByTargetResists(Merc* caster, Mob* target); - static bool CheckAENuke(Merc* caster, Mob* tar, uint16 spell_id, uint8 &numTargets); + static bool CheckAENuke(Merc* caster, Mob* tar, int32 spell_id, uint8 &numTargets); static bool GetNeedsCured(Mob *tar); bool HasOrMayGetAggro(); bool UseDiscipline(int32 spell_id, int32 target); @@ -287,7 +287,7 @@ public: bool FindTarget(); protected: - int64 GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic = false); + int64 GetFocusEffect(focusType type, int32 spell_id, bool from_buff_tic = false); std::vector merc_spells; std::map timers; diff --git a/zone/mob.cpp b/zone/mob.cpp index 0b70e75a1..90d9fb941 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -5262,7 +5262,7 @@ uint32 Mob::GetLevelHP(uint8 tlevel) return multiplier; } -int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime) +int32 Mob::GetActSpellCasttime(int32 spell_id, int32 casttime) { int32 cast_reducer = GetFocusEffect(focusSpellHaste, spell_id); int32 cast_reducer_amt = GetFocusEffect(focusFcCastTimeAmt, spell_id); @@ -5283,7 +5283,7 @@ int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime) } -void Mob::ExecWeaponProc(const EQ::ItemInstance* inst, uint16 spell_id, Mob* on, int level_override) +void Mob::ExecWeaponProc(const EQ::ItemInstance* inst, int32 spell_id, Mob* on, int level_override) { // Changed proc targets to look up based on the spells goodEffect flag. // This should work for the majority of weapons. @@ -5828,7 +5828,7 @@ void Mob::SetNimbusEffect(uint32 nimbus_effect) } } -bool Mob::TrySpellTrigger(Mob *target, uint32 spell_id, int effect) +bool Mob::TrySpellTrigger(Mob *target, int32 spell_id, int effect) { if (!target || !IsValidSpell(spell_id)) return false; @@ -5886,7 +5886,7 @@ bool Mob::TrySpellTrigger(Mob *target, uint32 spell_id, int effect) return true; } else if (IsClient() && spells[spell_id].effect_id[effect_slot] == SpellEffect::Chance_Best_in_Spell_Grp) { - uint32 best_spell_id = CastToClient()->GetHighestScribedSpellinSpellGroup(spells[spell_id].limit_value[effect_slot]); + int32 best_spell_id = CastToClient()->GetHighestScribedSpellinSpellGroup(spells[spell_id].limit_value[effect_slot]); if (IsValidSpell(best_spell_id)) { SpellFinished(best_spell_id, target, EQ::spells::CastingSlot::Item, 0, -1, spells[best_spell_id].resist_difficulty); } @@ -5920,7 +5920,7 @@ void Mob::TryTriggerOnCastRequirement() } //Twincast Focus effects should stack across different types (Spell, AA - when implemented ect) -void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id) +void Mob::TryTwincast(Mob *caster, Mob *target, int32 spell_id) { if (!IsValidSpell(spell_id)) { return; @@ -5964,7 +5964,7 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id) } //Used for effects that should occur after the completion of the spell -void Mob::ApplyHealthTransferDamage(Mob *caster, Mob *target, uint16 spell_id) +void Mob::ApplyHealthTransferDamage(Mob *caster, Mob *target, int32 spell_id) { if (!IsValidSpell(spell_id)) return; @@ -5992,7 +5992,7 @@ void Mob::ApplyHealthTransferDamage(Mob *caster, Mob *target, uint16 spell_id) } } -int32 Mob::GetVulnerability(Mob *caster, uint32 spell_id, uint32 ticsremaining, bool from_buff_tic) +int32 Mob::GetVulnerability(Mob *caster, int32 spell_id, uint32 ticsremaining, bool from_buff_tic) { /* Modifies incoming spell damage by percent, to increase or decrease damage, can be limited to specific resists. @@ -6184,7 +6184,7 @@ bool Mob::TryFadeEffect(int slot) if (spells[buffs[slot].spellid].effect_id[i] == SpellEffect::CastOnFadeEffectAlways || spells[buffs[slot].spellid].effect_id[i] == SpellEffect::CastOnRuneFadeEffect) { - uint16 spell_id = spells[buffs[slot].spellid].base_value[i]; + int32 spell_id = spells[buffs[slot].spellid].base_value[i]; BuffFadeBySlot(slot); if(spell_id) @@ -6210,7 +6210,7 @@ bool Mob::TryFadeEffect(int slot) return false; } -void Mob::TrySympatheticProc(Mob* target, uint32 spell_id) +void Mob::TrySympatheticProc(Mob* target, int32 spell_id) { if (!target || !IsValidSpell(spell_id) || !IsOfClientBotMerc()) { return; @@ -6562,7 +6562,7 @@ void Mob::DoKnockback(Mob *caster, uint32 push_back, uint32 push_up) } } -void Mob::TrySpellOnKill(uint8 level, uint16 spell_id) +void Mob::TrySpellOnKill(uint8 level, int32 spell_id) { if (IsValidSpell(spell_id)) { @@ -7110,7 +7110,7 @@ int16 Mob::GetModVulnerability(const uint8 resist) return 0; } -void Mob::CastOnCurer(uint32 spell_id) +void Mob::CastOnCurer(int32 spell_id) { for(int i = 0; i < EFFECT_COUNT; i++) { @@ -7124,7 +7124,7 @@ void Mob::CastOnCurer(uint32 spell_id) } } -void Mob::CastOnCure(uint32 spell_id) +void Mob::CastOnCure(int32 spell_id) { for(int i = 0; i < EFFECT_COUNT; i++) { @@ -7138,7 +7138,7 @@ void Mob::CastOnCure(uint32 spell_id) } } -void Mob::CastOnNumHitFade(uint32 spell_id) +void Mob::CastOnNumHitFade(int32 spell_id) { if(!IsValidSpell(spell_id)) return; @@ -7250,7 +7250,7 @@ uint16 Mob::GetWeaponSpeedbyHand(uint16 hand) { return weapon_speed; } -int8 Mob::GetDecayEffectValue(uint16 spell_id, uint16 spelleffect) { +int8 Mob::GetDecayEffectValue(int32 spell_id, uint16 spelleffect) { if (!IsValidSpell(spell_id)) return false; @@ -7674,7 +7674,7 @@ uint8 Mob::GetSeeInvisibleLevelFromNPCStat(uint16 in_see_invis) return std::min((see_invis_level - 1), MAX_INVISIBILTY_LEVEL); } -int32 Mob::GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot) +int32 Mob::GetSpellStat(int32 spell_id, const char *identifier, uint8 slot) { return GetSpellStatValue(spell_id, identifier, slot); } diff --git a/zone/mob.h b/zone/mob.h index bd7d84a02..606a96109 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -348,47 +348,47 @@ public: void SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect = false, Client *c = nullptr, uint32 caster_id = 0, uint32 target_id = 0); bool IsBeneficialAllowed(Mob *target); - virtual int GetCasterLevel(uint16 spell_id); - void ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* newbon, uint16 casterID = 0, + virtual int GetCasterLevel(int32 spell_id); + void ApplySpellsBonuses(int32 spell_id, uint8 casterlevel, StatBonuses* newbon, uint16 casterID = 0, uint8 WornType = 0, int32 ticsremaining = 0, int buffslot = -1, int instrument_mod = 10, bool IsAISpellEffect = false, uint16 effect_id = 0, int32 se_base = 0, int32 se_limit = 0, int32 se_max = 0); - void NegateSpellEffectBonuses(uint16 spell_id); - bool NegateSpellEffect(uint16 spell_id, int effect_id); - float GetActSpellRange(uint16 spell_id, float range); - int64 GetActSpellDamage(uint16 spell_id, int64 value, Mob* target = nullptr); - int64 GetActDoTDamage(uint16 spell_id, int64 value, Mob* target, bool from_buff_tic = true); - int64 GetActSpellHealing(uint16 spell_id, int64 value, Mob* target = nullptr, bool from_buff_tic = false); - int32 GetActSpellCost(uint16 spell_id, int32 cost); - virtual int32 GetActSpellDuration(uint16 spell_id, int32 duration); - int32 GetActSpellCasttime(uint16 spell_id, int32 casttime); - virtual int64 GetActReflectedSpellDamage(uint16 spell_id, int64 value, int effectiveness); - float ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override = false, + void NegateSpellEffectBonuses(int32 spell_id); + bool NegateSpellEffect(int32 spell_id, int effect_id); + float GetActSpellRange(int32 spell_id, float range); + int64 GetActSpellDamage(int32 spell_id, int64 value, Mob* target = nullptr); + int64 GetActDoTDamage(int32 spell_id, int64 value, Mob* target, bool from_buff_tic = true); + int64 GetActSpellHealing(int32 spell_id, int64 value, Mob* target = nullptr, bool from_buff_tic = false); + int32 GetActSpellCost(int32 spell_id, int32 cost); + virtual int32 GetActSpellDuration(int32 spell_id, int32 duration); + int32 GetActSpellCasttime(int32 spell_id, int32 casttime); + virtual int64 GetActReflectedSpellDamage(int32 spell_id, int64 value, int effectiveness); + float ResistSpell(uint8 resist_type, int32 spell_id, Mob *caster, bool use_resist_override = false, int resist_override = 0, bool CharismaCheck = false, bool CharmTick = false, bool IsRoot = false, int level_override = -1); int GetResist(uint8 resist_type); int ResistPhysical(int level_diff, uint8 caster_level); int ResistElementalWeaponDmg(const EQ::ItemInstance *item); int CheckBaneDamage(const EQ::ItemInstance *item); - uint16 GetSpecializeSkillValue(uint16 spell_id) const; + uint16 GetSpecializeSkillValue(int32 spell_id) const; void SendSpellBarDisable(); - void SendSpellBarEnable(uint16 spellid); + void SendSpellBarEnable(int32 spellid); void ZeroCastingVars(); virtual void SpellProcess(); - virtual bool CastSpell(uint16 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, + virtual bool CastSpell(int32 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0, uint32 item_slot = 0xFFFFFFFF, uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, int16 *resist_adjust = nullptr, uint32 aa_id = 0); - virtual bool DoCastSpell(uint16 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, + virtual bool DoCastSpell(int32 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0, uint32 item_slot = 0xFFFFFFFF, uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, int16 resist_adjust = 0, uint32 aa_id = 0); - void CastedSpellFinished(uint16 spell_id, uint32 target_id, EQ::spells::CastingSlot slot, int mana_used, + void CastedSpellFinished(int32 spell_id, uint32 target_id, EQ::spells::CastingSlot slot, int mana_used, uint32 inventory_slot = 0xFFFFFFFF, int16 resist_adjust = 0); - bool SpellFinished(uint16 spell_id, Mob *target, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int mana_used = 0, + bool SpellFinished(int32 spell_id, Mob *target, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int mana_used = 0, uint32 inventory_slot = 0xFFFFFFFF, int16 resist_adjust = 0, bool isproc = false, int level_override = -1, uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, bool from_casted_spell = false, uint32 aa_id = 0); - void SendBeginCast(uint16 spell_id, uint32 casttime); + void SendBeginCast(int32 spell_id, uint32 casttime); virtual bool SpellOnTarget( - uint16 spell_id, + int32 spell_id, Mob* spelltar, int reflect_effectiveness = 0, bool use_resist_adjust = false, @@ -398,31 +398,31 @@ public: int duration_override = 0, bool disable_buff_overwrite = false ); - virtual bool SpellEffect(Mob* caster, uint16 spell_id, float partial = 100, int level_override = -1, int reflect_effectiveness = 0, int32 duration_override = 0, bool disable_buff_overwrite = false); - virtual bool DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_center, + virtual bool SpellEffect(Mob* caster, int32 spell_id, float partial = 100, int level_override = -1, int reflect_effectiveness = 0, int32 duration_override = 0, bool disable_buff_overwrite = false); + virtual bool DetermineSpellTargets(int32 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction, EQ::spells::CastingSlot slot, bool isproc = false); bool DoCastingChecksOnCaster(int32 spell_id, EQ::spells::CastingSlot slot); bool DoCastingChecksZoneRestrictions(bool check_on_casting, int32 spell_id); bool DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob* spell_target); - virtual bool CheckFizzle(uint16 spell_id); - virtual bool CheckSpellLevelRestriction(Mob *caster, uint16 spell_id); - virtual bool IsImmuneToSpell(uint16 spell_id, Mob *caster); + virtual bool CheckFizzle(int32 spell_id); + virtual bool CheckSpellLevelRestriction(Mob *caster, int32 spell_id); + virtual bool IsImmuneToSpell(int32 spell_id, Mob *caster); - virtual float GetAOERange(uint16 spell_id); - void InterruptSpell(uint16 spellid = SPELL_UNKNOWN); - void InterruptSpell(uint16, uint16, uint16 spellid = SPELL_UNKNOWN); + virtual float GetAOERange(int32 spell_id); + void InterruptSpell(int32 spellid = SPELL_UNKNOWN); + void InterruptSpell(uint16, uint16, int32 spellid = SPELL_UNKNOWN); void StopCasting(); void StopCastSpell(int32 spell_id, bool send_spellbar_enable); inline bool IsCasting() const { return((casting_spell_id != 0)); } - uint16 CastingSpellID() const { return casting_spell_id; } + int32 CastingSpellID() const { return casting_spell_id; } bool TryDispel(uint8 caster_level, uint8 buff_level, int level_modifier); - bool TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed = 1.5f); - void ResourceTap(int64 damage, uint16 spell_id); + bool TrySpellProjectile(Mob* spell_target, int32 spell_id, float speed = 1.5f); + void ResourceTap(int64 damage, int32 spell_id); void TryTriggerThreshHold(int64 damage, int effect_id, Mob* attacker); void CalcDestFromHeading(float heading, float distance, float MaxZDiff, float StartX, float StartY, float &dX, float &dY, float &dZ); - void BeamDirectional(uint16 spell_id, int16 resist_adjust); - void ConeDirectional(uint16 spell_id, int16 resist_adjust); - void ApplyHealthTransferDamage(Mob *caster, Mob *target, uint16 spell_id); + void BeamDirectional(int32 spell_id, int16 resist_adjust); + void ConeDirectional(int32 spell_id, int16 resist_adjust); + void ApplyHealthTransferDamage(Mob *caster, Mob *target, int32 spell_id); void ApplySpellEffectIllusion(int32 spell_id, Mob* caster, int buffslot, int base, int limit, int max); void ApplyIllusionToCorpse(int32 spell_id, Corpse* new_corpse); void SendIllusionWearChange(Client* c); @@ -437,13 +437,13 @@ public: void ZeroBardPulseVars(); void DoBardCastingFromItemClick(bool is_casting_bard_song, uint32 cast_time, int32 spell_id, uint16 target_id, EQ::spells::CastingSlot slot, uint32 item_slot, uint32 recast_type , uint32 recast_delay); - bool UseBardSpellLogic(uint16 spell_id = 0xffff, int slot = -1); + bool UseBardSpellLogic(int32 spell_id = 0xffff, int slot = -1); //Buff void BuffProcess(); virtual void DoBuffTic(const Buffs_Struct &buff, int slot, Mob* caster = nullptr); - void BuffFadeBySpellID(uint16 spell_id); - void BuffFadeBySpellIDAndCaster(uint16 spell_id, uint16 caster_id); + void BuffFadeBySpellID(int32 spell_id); + void BuffFadeBySpellIDAndCaster(int32 spell_id, uint16 caster_id); void BuffFadeByEffect(int effect_id, int slot_to_skip = -1); void BuffFadeAll(); void BuffFadeBeneficial(); @@ -455,11 +455,10 @@ public: void BuffFadeSongs(); void BuffDetachCaster(Mob *caster); bool IsAffectedByBuffByGlobalGroup(GlobalGroup group); - void BuffModifyDurationBySpellID(uint16 spell_id, int32 newDuration); - int AddBuff(Mob *caster, const uint16 spell_id, int duration = 0, int32 level_override = -1, bool disable_buff_overwrite = false); - int CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite = false); - int CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caster_level_override = -1); - void SendPetBuffsToClient(); + void BuffModifyDurationBySpellID(int32 spell_id, int32 newDuration); + int AddBuff(Mob *caster, const int32 spell_id, int duration = 0, int32 level_override = -1, bool disable_buff_overwrite = false); + int CanBuffStack(int32 spellid, uint8 caster_level, bool iFailIfOverwrite = false); + int CalcBuffDuration(Mob *caster, Mob *target, int32 spell_id, int32 caster_level_override = -1); virtual int GetCurrentBuffSlots() const { return 0; } virtual int GetCurrentSongSlots() const { return 0; } virtual int GetCurrentDiscSlots() const { return 0; } @@ -472,21 +471,19 @@ public: virtual uint32 GetLastBuffSlot(bool disc, bool song); virtual void InitializeBuffSlots() { buffs = nullptr; } virtual void UninitializeBuffSlots() { } - EQApplicationPacket *MakeBuffsPacket(bool for_target = true, bool clear_buffs = false); - void SendBuffsToClient(Client *c); inline Buffs_Struct* GetBuffs() { return buffs; } void DoGravityEffect(); void DamageShield(Mob* other, bool spell_ds = false); int32 RuneAbsorb(int64 damage, uint16 type); std::vector GetBuffSpellIDs(); - bool FindBuff(uint16 spell_id, uint16 caster_id = 0); + bool FindBuff(int32 spell_id, uint16 caster_id = 0); uint16 FindBuffBySlot(int slot); uint32 BuffCount(bool is_beneficial = true, bool is_detrimental = true); bool FindType(uint16 type, bool bOffensive = false, uint16 threshold = 100); int16 GetBuffSlotFromType(uint16 type); - uint16 GetSpellIDFromSlot(uint8 slot); + int32 GetSpellIDFromSlot(uint8 slot); int CountDispellableBuffs(); - void CheckNumHitsRemaining(NumHit type, int32 buff_slot = -1, uint16 spell_id = SPELL_UNKNOWN); + void CheckNumHitsRemaining(NumHit type, int32 buff_slot = -1, int32 spell_id = SPELL_UNKNOWN); bool HasNumhits() const { return has_numhits; } inline void Numhits(bool val) { has_numhits = val; } bool HasMGB() const { return has_MGB; } @@ -549,12 +546,12 @@ public: bool CanClassEquipItem(uint32 item_id); bool CanRaceEquipItem(uint32 item_id); bool AffectedBySpellExcludingSlot(int slot, int effect); - virtual bool Death(Mob* killer_mob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false) = 0; - virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, + virtual bool Death(Mob* killer_mob, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false) = 0; + virtual void Damage(Mob* from, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) = 0; void SetHP(int64 hp); inline void SetOOCRegen(int64 new_ooc_regen) { ooc_regen = new_ooc_regen; } - virtual void HealDamage(uint64 ammount, Mob* caster = nullptr, uint16 spell_id = SPELL_UNKNOWN); + virtual void HealDamage(uint64 ammount, Mob* caster = nullptr, int32 spell_id = SPELL_UNKNOWN); virtual void SetMaxHP() { current_hp = max_hp; } virtual inline uint16 GetBaseRace() const { return base_race; } virtual inline uint8 GetBaseGender() const { return base_gender; } @@ -757,7 +754,7 @@ public: static uint32 GetLevelCon(uint8 mylevel, uint8 iOtherLevel); inline uint32 GetLevelCon(uint8 iOtherLevel) const { return GetLevelCon(GetLevel(), iOtherLevel); } void AddToHateList(Mob* other, int64 hate = 0, int64 damage = 0, bool iYellForHelp = true, - bool bFrenzy = false, bool iBuffTic = false, uint16 spell_id = SPELL_UNKNOWN, bool pet_comand = false); + bool bFrenzy = false, bool iBuffTic = false, int32 spell_id = SPELL_UNKNOWN, bool pet_comand = false); bool RemoveFromHateList(Mob* mob); void SetHateAmountOnEnt(Mob* other, int64 hate = 0, int64 damage = 0) { hate_list.SetHateAmountOnEnt(other,hate,damage);} void HalveAggro(Mob *other) { int64 in_hate = GetHateAmount(other); SetHateAmountOnEnt(other, (in_hate > 1 ? in_hate / 2 : 1)); } @@ -853,8 +850,8 @@ public: static uint8 GetDefaultGender(uint16 in_race, uint8 in_gender = 0xFF); EQ::skills::SkillType GetSkillByItemType(int ItemType); uint8 GetItemTypeBySkill(EQ::skills::SkillType skill); - virtual void MakePet(uint16 spell_id, const char* pettype, const char *petname = nullptr); - virtual void MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const char *petname = nullptr, float in_size = 0.0f); + virtual void MakePet(int32 spell_id, const char* pettype, const char *petname = nullptr); + virtual void MakePoweredPet(int32 spell_id, const char* pettype, int16 petpower, const char *petname = nullptr, float in_size = 0.0f); bool IsWarriorClass() const; bool IsIntelligenceCasterClass() const; bool IsPureMeleeClass() const; @@ -870,7 +867,7 @@ public: virtual int GetKillExpMod() const { return 100; } // aura functions - void MakeAura(uint16 spell_id); + void MakeAura(int32 spell_id); inline int GetAuraSlots() { return 1 + aabonuses.aura_slots + itembonuses.aura_slots + spellbonuses.aura_slots; } inline int GetTrapSlots() { return 1 + aabonuses.trap_slots + itembonuses.trap_slots + spellbonuses.trap_slots; } inline bool HasFreeAuraSlots() { return aura_mgr.count < GetAuraSlots(); } @@ -884,18 +881,18 @@ public: //Procs void TriggerDefensiveProcs(Mob *on, uint16 hand = EQ::invslot::slotPrimary, bool FromSkillProc = false, int64 damage = 0); - bool AddRangedProc(uint16 spell_id, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN, uint32 proc_reuse_time = 0); - bool RemoveRangedProc(uint16 spell_id, bool bAll = false); + bool AddRangedProc(int32 spell_id, uint16 iChance = 3, int32 base_spell_id = SPELL_UNKNOWN, uint32 proc_reuse_time = 0); + bool RemoveRangedProc(int32 spell_id, bool bAll = false); bool HasRangedProcs() const; - bool AddDefensiveProc(uint16 spell_id, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN, uint32 proc_reuse_time = 0); - bool RemoveDefensiveProc(uint16 spell_id, bool bAll = false); + bool AddDefensiveProc(int32 spell_id, uint16 iChance = 3, int32 base_spell_id = SPELL_UNKNOWN, uint32 proc_reuse_time = 0); + bool RemoveDefensiveProc(int32 spell_id, bool bAll = false); bool HasDefensiveProcs() const; bool HasSkillProcs() const; bool HasSkillProcSuccess() const; - bool AddProcToWeapon(uint16 spell_id, bool bPerma = false, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN, int level_override = -1, uint32 proc_reuse_time = 0); - bool RemoveProcFromWeapon(uint16 spell_id, bool bAll = false); + bool AddProcToWeapon(int32 spell_id, bool bPerma = false, uint16 iChance = 3, int32 base_spell_id = SPELL_UNKNOWN, int level_override = -1, uint32 proc_reuse_time = 0); + bool RemoveProcFromWeapon(int32 spell_id, bool bAll = false); bool HasProcs() const; - bool IsCombatProc(uint16 spell_id); + bool IsCombatProc(int32 spell_id); //More stuff to sort: virtual bool IsRaidTarget() const { return false; }; @@ -937,8 +934,8 @@ public: void QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::Options &opts); const int GetItemStat(uint32 item_id, std::string identifier); - int64 CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus=false, uint16 casterid = 0, Mob *caster = nullptr); - uint8 IsFocusEffect(uint16 spellid, int effect_index, bool AA=false,uint32 aa_effect=0); + int64 CalcFocusEffect(focusType type, uint16 focus_id, int32 spell_id, bool best_focus=false, uint16 casterid = 0, Mob *caster = nullptr); + uint8 IsFocusEffect(int32 spellid, int effect_index, bool AA=false,uint32 aa_effect=0); void SendIllusionPacket(const AppearanceStruct& a); void CloneAppearance(Mob* other, bool clone_name = false); void SetFaceAppearance(const FaceChange_Struct& face, bool skip_sender = false); @@ -947,38 +944,38 @@ public: virtual void UnStun(); inline void Silence(bool newval) { silenced = newval; } inline void Amnesia(bool newval) { amnesiad = newval; } - void TemporaryPets(uint16 spell_id, Mob *target, const char *name_override = nullptr, uint32 duration_override = 0, bool followme=true, bool sticktarg=false, uint16 *controlled_pet_id = nullptr); + void TemporaryPets(int32 spell_id, Mob *target, const char *name_override = nullptr, uint32 duration_override = 0, bool followme=true, bool sticktarg=false, uint16 *controlled_pet_id = nullptr); void TypesTemporaryPets(uint32 typesid, Mob *target, const char *name_override = nullptr, uint32 duration_override = 0, bool followme=true, bool sticktarg=false); - void WakeTheDead(uint16 spell_id, Corpse *corpse_to_use, Mob *target, uint32 duration); + void WakeTheDead(int32 spell_id, Corpse *corpse_to_use, Mob *target, uint32 duration); void Spin(); void Kill(); - bool PassCharismaCheck(Mob* caster, uint16 spell_id); + bool PassCharismaCheck(Mob* caster, int32 spell_id); bool TryDeathSave(); bool TryDivineSave(); - void TryTriggerOnCastFocusEffect(focusType type, uint16 spell_id); - bool TryTriggerOnCastProc(uint16 focusspellid, uint16 spell_id, uint16 proc_spellid); - bool TrySpellTrigger(Mob *target, uint32 spell_id, int effect); + void TryTriggerOnCastFocusEffect(focusType type, int32 spell_id); + bool TryTriggerOnCastProc(int32 focusspellid, int32 spell_id, int32 proc_spellid); + bool TrySpellTrigger(Mob *target, int32 spell_id, int effect); void TryTriggerOnCastRequirement(); - void TryTwincast(Mob *caster, Mob *target, uint32 spell_id); - void TrySympatheticProc(Mob *target, uint32 spell_id); - uint16 GetSympatheticFocusEffect(focusType type, uint16 spell_id); + void TryTwincast(Mob *caster, Mob *target, int32 spell_id); + void TrySympatheticProc(Mob *target, int32 spell_id); + int32 GetSympatheticFocusEffect(focusType type, int32 spell_id); bool TryFadeEffect(int slot); - void DispelMagic(Mob* casterm, uint16 spell_id, int effect_value); - bool TrySpellEffectResist(uint16 spell_id); - int32 GetVulnerability(Mob *caster, uint32 spell_id, uint32 ticsremaining, bool from_buff_tic = false); + void DispelMagic(Mob* casterm, int32 spell_id, int effect_value); + bool TrySpellEffectResist(int32 spell_id); + int32 GetVulnerability(Mob *caster, int32 spell_id, uint32 ticsremaining, bool from_buff_tic = false); int64 GetFcDamageAmtIncoming(Mob *caster, int32 spell_id, bool from_buff_tic = false); - int64 GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spell_id); //**** This can be removed when bot healing focus code is updated **** + int64 GetFocusIncoming(focusType type, int effect, Mob *caster, int32 spell_id); //**** This can be removed when bot healing focus code is updated **** int32 GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackOptions *opts = nullptr); int32 GetPositionalDmgTaken(Mob *attacker); int32 GetPositionalDmgTakenAmt(Mob *attacker); void DoKnockback(Mob *caster, uint32 push_back, uint32 push_up); int16 CalcResistChanceBonus(); int16 CalcFearResistChance(); - void TrySpellOnKill(uint8 level, uint16 spell_id); + void TrySpellOnKill(uint8 level, int32 spell_id); bool TrySpellOnDeath(); - void CastOnCurer(uint32 spell_id); - void CastOnCure(uint32 spell_id); - void CastOnNumHitFade(uint32 spell_id); + void CastOnCurer(int32 spell_id); + void CastOnCure(int32 spell_id); + void CastOnNumHitFade(int32 spell_id); void SlowMitigation(Mob* caster); int16 GetCritDmgMod(uint16 skill, Mob* owner = nullptr); int16 GetMeleeDamageMod_SE(uint16 skill); @@ -991,18 +988,18 @@ public: int16 GetPositionalDmgAmt(Mob* defender); inline bool CanBlockSpell() const { return(spellbonuses.FocusEffects[focusBlockNextSpell]); } bool DoHPToManaCovert(int32 mana_cost = 0); - int8 GetDecayEffectValue(uint16 spell_id, uint16 spelleffect); - int64 GetExtraSpellAmt(uint16 spell_id, int64 extra_spell_amt, int64 base_spell_dmg); + int8 GetDecayEffectValue(int32 spell_id, uint16 spelleffect); + int64 GetExtraSpellAmt(int32 spell_id, int64 extra_spell_amt, int64 base_spell_dmg); void MeleeLifeTap(int64 damage); bool PassCastRestriction(int value); void SendCastRestrictionMessage(int requirement_id, bool is_target_requirement = true, bool is_discipline = false); bool ImprovedTaunt(); bool TryRootFadeByDamage(int buffslot, Mob* attacker); float GetSlowMitigation() const { return slow_mitigation; } - void CalcSpellPowerDistanceMod(uint16 spell_id, float range, Mob* caster = nullptr); + void CalcSpellPowerDistanceMod(int32 spell_id, float range, Mob* caster = nullptr); inline int16 GetSpellPowerDistanceMod() const { return SpellPowerDistanceMod; }; inline void SetSpellPowerDistanceMod(int16 value) { SpellPowerDistanceMod = value; }; - int32 GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot = 0); + int32 GetSpellStat(int32 spell_id, const char *identifier, uint8 slot = 0); bool HarmonySpellLevelCheck(int32 spell_id, Mob* target = nullptr); bool PassCharmTargetRestriction(Mob *target); bool CanFocusUseRandomEffectivenessByType(focusType type); @@ -1158,7 +1155,7 @@ public: inline bool IsAmnesiad() const { return amnesiad; } int64 ReduceDamage(int64 damage); - int64 AffectMagicalDamage(int64 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker); + int64 AffectMagicalDamage(int64 damage, int32 spell_id, const bool iBuffTic, Mob* attacker); int64 ReduceAllDamage(int64 damage); void DoSpecialAttackDamage(Mob *who, EQ::skills::SkillType skill, int base_damage, int min_damage = 0, int32 hate_override = -1, int ReuseTime = 10); @@ -1300,14 +1297,13 @@ public: static uint32 GetLevelHP(uint8 tlevel); uint32 GetZoneID() const; //for perl uint16 GetInstanceVersion() const; //for perl - virtual int32 CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc = false); - virtual int32 CheckHealAggroAmount(uint16 spell_id, Mob *target, uint32 heal_possible = 0); + virtual int32 CheckAggroAmount(int32 spell_id, Mob *target, bool isproc = false); + virtual int32 CheckHealAggroAmount(int32 spell_id, Mob *target, uint32 heal_possible = 0); - //uint32 GetInstrumentMod(uint16 spell_id) const; - uint32 GetInstrumentMod(uint16 spell_id); - int64 CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level = 1, uint32 instrument_mod = 10, Mob *caster = nullptr, int ticsremaining = 0,uint16 casterid=0); - int64 CalcSpellEffectValue_formula(uint32 formula, int64 base_value, int64 max_value, int caster_level, uint16 spell_id, int ticsremaining = 0); - virtual int CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int caster_level2, Mob* caster1 = nullptr, Mob* caster2 = nullptr, int buffslot = -1); + uint32 GetInstrumentMod(int32 spell_id); + int64 CalcSpellEffectValue(int32 spell_id, int effect_id, int caster_level = 1, uint32 instrument_mod = 10, Mob *caster = nullptr, int ticsremaining = 0,uint16 casterid=0); + int64 CalcSpellEffectValue_formula(uint32 formula, int64 base_value, int64 max_value, int caster_level, int32 spell_id, int ticsremaining = 0); + virtual int CheckStackConflict(int32 spellid1, int caster_level1, int32 spellid2, int caster_level2, Mob* caster1 = nullptr, Mob* caster2 = nullptr, int buffslot = -1); uint32 GetCastedSpellInvSlot() const { return casting_spell_inventory_slot; } // HP Event @@ -1368,6 +1364,7 @@ public: Timer* GetAIMovementTimer() { return AI_movement_timer.get(); } Timer GetAttackTimer() { return attack_timer; } Timer GetAttackDWTimer() { return attack_dw_timer; } + uint32 GetRemainingTicTime() const { return tic_timer.GetRemainingTime(); } inline bool IsFindable() { return findable; } inline uint8 GetManaPercent() { return (uint8)((float)current_mana / (float)max_mana * 100.0f); } virtual uint8 GetEndurancePercent() { return 0; } @@ -1440,7 +1437,7 @@ public: int GetAlternateAdvancementCooldownReduction(AA::Rank *rank_in); void ExpendAlternateAdvancementCharge(uint32 aa_id); void CalcAABonuses(StatBonuses* newbon); - int64 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id); + int64 CalcAAFocus(focusType type, const AA::Rank &rank, int32 spell_id); void ApplyAABonuses(const AA::Rank &rank, StatBonuses* newbon); bool CheckAATimer(int timer); @@ -1517,8 +1514,8 @@ public: bool IsDestroying() const { return m_destroying; } protected: - void CommonDamage(Mob* other, int64 &damage, const uint16 spell_id, const EQ::skills::SkillType attack_skill, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks specal = eSpecialAttacks::None); - static uint16 GetProcID(uint16 spell_id, uint8 effect_index); + void CommonDamage(Mob* other, int64 &damage, const int32 spell_id, const EQ::skills::SkillType attack_skill, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks specal = eSpecialAttacks::None); + static int32 GetProcID(int32 spell_id, uint8 effect_index); int _GetWalkSpeed() const; int _GetRunSpeed() const; int _GetFearSpeed() const; @@ -1654,21 +1651,21 @@ protected: void TryWeaponProc(const EQ::ItemInstance* inst, const EQ::ItemData* weapon, Mob *on, uint16 hand = EQ::invslot::slotPrimary); void TrySpellProc(const EQ::ItemInstance* inst, const EQ::ItemData* weapon, Mob *on, uint16 hand = EQ::invslot::slotPrimary); void TryCombatProcs(const EQ::ItemInstance* weapon, Mob *on, uint16 hand = EQ::invslot::slotPrimary, const EQ::ItemData* weapon_data = nullptr); - void ExecWeaponProc(const EQ::ItemInstance* weapon, uint16 spell_id, Mob *on, int level_override = -1); + void ExecWeaponProc(const EQ::ItemInstance* weapon, int32 spell_id, Mob *on, int level_override = -1); virtual float GetProcChances(float ProcBonus, uint16 hand = EQ::invslot::slotPrimary); virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = EQ::invslot::slotPrimary, Mob *on = nullptr); virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm? uint16 GetWeaponSpeedbyHand(uint16 hand); virtual int GetBaseSkillDamage(EQ::skills::SkillType skill, Mob *target = nullptr); - virtual int64 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false); + virtual int64 GetFocusEffect(focusType type, int32 spell_id, Mob *caster = nullptr, bool from_buff_tic = false); virtual EQ::InventoryProfile& GetInv() { return m_inv; } void CalculateNewFearpoint(); float FindGroundZ(float new_x, float new_y, float z_offset=0.0); float FindDestGroundZ(glm::vec3 dest, float z_offset=0.0); - virtual float GetSympatheticProcChances(uint16 spell_id, int16 ProcRateMod, int32 ItemProcRate = 0); - int16 GetSympatheticSpellProcRate(uint16 spell_id); - uint16 GetSympatheticSpellProcID(uint16 spell_id); + virtual float GetSympatheticProcChances(int32 spell_id, int16 ProcRateMod, int32 ItemProcRate = 0); + int16 GetSympatheticSpellProcRate(int32 spell_id); + int32 GetSympatheticSpellProcID(int32 spell_id); enum {MAX_PROCS = 10}; tProc PermaProcs[MAX_PROCS]; @@ -1726,7 +1723,7 @@ protected: //spell casting vars Timer spellend_timer; - uint16 casting_spell_id; + int32 casting_spell_id; glm::vec3 m_SpellLocation; int attacked_count; bool delaytimer; @@ -1947,6 +1944,6 @@ private: void SetHeroicIntBonuses(StatBonuses* n); void SetHeroicWisBonuses(StatBonuses* n); - void DoSpellInterrupt(uint16 spell_id, int32 mana_cost, int my_curmana); + void DoSpellInterrupt(int32 spell_id, int32 mana_cost, int my_curmana); void HandleDoorOpen(); }; diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 8237d7a47..a5fc97457 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2379,7 +2379,7 @@ void NPC::CheckSignal() { } } -bool IsSpellInList(DBnpcspells_Struct* spell_list, uint16 iSpellID); +bool IsSpellInList(DBnpcspells_Struct* spell_list, int32 iSpellID); bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSpellEffectID, int32 base_value, int32 limit, int32 max_value); bool NPC::AI_AddNPCSpells(uint32 iDBSpellsID) { @@ -2678,14 +2678,14 @@ bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSp return false; } -bool IsSpellInList(DBnpcspells_Struct* spell_list, uint16 iSpellID) { +bool IsSpellInList(DBnpcspells_Struct* spell_list, int32 iSpellID) { auto it = std::find_if(spell_list->entries.begin(), spell_list->entries.end(), [iSpellID](const DBnpcspells_entries_Struct &a) { return a.spellid == iSpellID; }); return it != spell_list->entries.end(); } // adds a spell to the list, taking into account priority and resorting list as needed. -void NPC::AddSpellToNPCList(int16 iPriority, uint16 iSpellID, uint32 iType, +void NPC::AddSpellToNPCList(int16 iPriority, int32 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust, int8 min_hp, int8 max_hp) { @@ -2712,7 +2712,7 @@ void NPC::AddSpellToNPCList(int16 iPriority, uint16 iSpellID, uint32 iType, AIautocastspell_timer->Start(RandomTimer(0, 300), false); } -void NPC::RemoveSpellFromNPCList(uint16 spell_id) +void NPC::RemoveSpellFromNPCList(int32 spell_id) { auto iter = AIspells.begin(); while(iter != AIspells.end()) diff --git a/zone/npc.h b/zone/npc.h index 06ac7101e..1516dcd04 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -45,7 +45,7 @@ struct NPCProximity { struct AISpells_Struct { uint32 type; // 0 = never, must be one (and only one) of the defined values - uint16 spellid; // <= 0 = no spell + int32 spellid; // <= 0 = no spell int16 manacost; // -1 = use spdat, -2 = no cast time uint32 time_cancast; // when we can cast this spell next int32 recast_delay; @@ -123,8 +123,8 @@ public: static NPC * SpawnZonePointNodeNPC(std::string name, const glm::vec4 &position); //abstract virtual function implementations requird by base abstract class - virtual bool Death(Mob* killer_mob, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false); - virtual void Damage(Mob* from, int64 damage, uint16 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None); + virtual bool Death(Mob* killer_mob, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, KilledByTypes killed_by = KilledByTypes::Killed_NPC, bool is_buff_tic = false); + virtual void Damage(Mob* from, int64 damage, int32 spell_id, EQ::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None); bool Attack(Mob* other, int Hand = EQ::invslot::slotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) override; virtual bool HasRaid() { return false; } @@ -308,7 +308,7 @@ public: float GetAttackSpeed() const {return attack_speed;} int GetAttackDelay() const {return attack_delay;} bool IsAnimal() const { return(bodytype == BodyType::Animal); } - uint16 GetPetSpellID() const {return pet_spell_id;} + int32 GetPetSpellID() const {return pet_spell_id;} void SetPetSpellID(uint16 amt) {pet_spell_id = amt;} uint32 GetMaxDamage(uint8 tlevel); void SetTaunting(bool is_taunting); @@ -433,7 +433,7 @@ public: uint8 GetLDoNTrapType() const { return ldon_trap_type; } void SetLDoNTrapType(uint8 n) { ldon_trap_type = n; } - uint16 GetLDoNTrapSpellID() const { return ldon_spell_id; } + int32 GetLDoNTrapSpellID() const { return ldon_spell_id; } void SetLDoNTrapSpellID(uint16 n) { ldon_spell_id = n; } bool IsLDoNLocked() const { return ldon_locked; } @@ -465,9 +465,9 @@ public: void NPCSlotTexture(uint8 slot, uint32 texture); // Sets new material values for slots uint32 GetAdventureTemplate() const { return adventure_template_id; } - void AddSpellToNPCList(int16 iPriority, uint16 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust, int8 min_hp, int8 max_hp); + void AddSpellToNPCList(int16 iPriority, int32 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust, int8 min_hp, int8 max_hp); void AddSpellEffectToNPCList(uint16 iSpellEffectID, int32 base_value, int32 limit, int32 max_value, bool apply_bonus = false); - void RemoveSpellFromNPCList(uint16 spell_id); + void RemoveSpellFromNPCList(int32 spell_id); void RemoveSpellEffectFromNPCList(uint16 iSpellEffectID, bool apply_bonus = false); bool HasAISpellEffect(uint16 spell_effect_id); Timer *GetRefaceTimer() const { return reface_timer; } @@ -494,7 +494,7 @@ public: uint32 GetSpawnKillCount(); int GetScore(); void AISpellsList(Client *c); - uint16 GetInnateProcSpellID() const { return innate_proc_spell_id; } + int32 GetInnateProcSpellID() const { return innate_proc_spell_id; } uint32 GetHeroForgeModel() const { return herosforgemodel; } void SetHeroForgeModel(uint32 model) { herosforgemodel = model; } @@ -680,7 +680,7 @@ protected: Timer enraged_timer; Timer *reface_timer; - uint32 npc_spells_id; + int32 npc_spells_id; uint8 casting_spell_AIindex; std::vector AIspells; @@ -688,8 +688,8 @@ protected: virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates = false); virtual bool AIDoSpellCast(int32 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0); AISpellsVar_Struct AISpellVar; - int64 GetFocusEffect(focusType type, uint16 spell_id, Mob *caster = nullptr, bool from_buff_tic = false) override; - uint16 innate_proc_spell_id; + int64 GetFocusEffect(focusType type, int32 spell_id, Mob *caster = nullptr, bool from_buff_tic = false) override; + int32 innate_proc_spell_id; uint32 npc_spells_effects_id; std::vector AIspellsEffects; @@ -729,7 +729,7 @@ protected: int charm_atk; //pet crap: - uint16 pet_spell_id; + int32 pet_spell_id; bool taunting; Timer taunt_timer; //for pet taunting @@ -764,7 +764,7 @@ protected: bool ldon_trapped; uint8 ldon_trap_type; - uint16 ldon_spell_id; + int32 ldon_spell_id; bool ldon_locked; uint16 ldon_locked_skill; bool ldon_trap_detected; diff --git a/zone/perl_bot.cpp b/zone/perl_bot.cpp index 9b72d77d2..56cc8cfb0 100644 --- a/zone/perl_bot.cpp +++ b/zone/perl_bot.cpp @@ -213,7 +213,7 @@ bool Perl_Bot_IsSitting(Bot* self) // @categories Account and Character return self->IsSitting(); } -void Perl_Bot_SendSpellAnim(Bot* self, uint16 target_id, uint16 spell_id) +void Perl_Bot_SendSpellAnim(Bot* self, uint16 target_id, int32 spell_id) { self->SendSpellAnim(target_id, spell_id); } @@ -278,7 +278,7 @@ uint32 Perl_Bot_GetSpellRecastTimer(Bot* self) return self->GetSpellRecastRemainingTime(); } -uint32 Perl_Bot_GetSpellRecastTimer(Bot* self, uint16 spell_id) +uint32 Perl_Bot_GetSpellRecastTimer(Bot* self, int32 spell_id) { return self->GetSpellRecastRemainingTime(spell_id); } @@ -288,7 +288,7 @@ void Perl_Bot_ClearSpellRecastTimer(Bot* self) return self->ClearSpellRecastTimer(); } -void Perl_Bot_ClearSpellRecastTimer(Bot* self, uint16 spell_id) +void Perl_Bot_ClearSpellRecastTimer(Bot* self, int32 spell_id) { return self->ClearSpellRecastTimer(spell_id); } @@ -298,7 +298,7 @@ uint32 Perl_Bot_GetDisciplineReuseTimer(Bot* self) return self->GetDisciplineReuseRemainingTime(); } -uint32 Perl_Bot_GetDisciplineReuseTimer(Bot* self, uint16 spell_id) +uint32 Perl_Bot_GetDisciplineReuseTimer(Bot* self, int32 spell_id) { return self->GetDisciplineReuseRemainingTime(spell_id); } @@ -308,17 +308,17 @@ void Perl_Bot_ClearDisciplineReuseTimer(Bot* self) return self->ClearDisciplineReuseTimer(); } -void Perl_Bot_ClearDisciplineReuseTimer(Bot* self, uint16 spell_id) +void Perl_Bot_ClearDisciplineReuseTimer(Bot* self, int32 spell_id) { return self->ClearDisciplineReuseTimer(spell_id); } -void Perl_Bot_SetDisciplineReuseTimer(Bot* self, uint16 spell_id) +void Perl_Bot_SetDisciplineReuseTimer(Bot* self, int32 spell_id) { return self->SetDisciplineReuseTimer(spell_id); } -void Perl_Bot_SetDisciplineReuseTimer(Bot* self, uint16 spell_id, uint32 recast_delay) +void Perl_Bot_SetDisciplineReuseTimer(Bot* self, int32 spell_id, uint32 recast_delay) { return self->SetDisciplineReuseTimer(spell_id); } @@ -333,12 +333,12 @@ void Perl_Bot_SetItemReuseTimer(Bot* self, uint32 item_id, uint32 reuse_timer) return self->SetItemReuseTimer(item_id, reuse_timer); } -void Perl_Bot_SetSpellRecastTimer(Bot* self, uint16 spell_id) +void Perl_Bot_SetSpellRecastTimer(Bot* self, int32 spell_id) { return self->SetSpellRecastTimer(spell_id); } -void Perl_Bot_SetSpellRecastTimer(Bot* self, uint16 spell_id, uint32 recast_delay) +void Perl_Bot_SetSpellRecastTimer(Bot* self, int32 spell_id, uint32 recast_delay) { return self->SetSpellRecastTimer(spell_id, recast_delay); } @@ -423,7 +423,7 @@ int Perl_Bot_GetSpellDamage(Bot* self) return self->GetSpellDmg(); } -int Perl_Bot_GetInstrumentMod(Bot* self, uint16 spell_id) // @categories Spells and Disciplines +int Perl_Bot_GetInstrumentMod(Bot* self, int32 spell_id) // @categories Spells and Disciplines { return self->GetInstrumentMod(spell_id); } @@ -528,7 +528,7 @@ void Perl_Bot_ReloadBotSpellSettings(Bot* self) self->LoadBotSpellSettings(); } -bool Perl_Bot_HasBotSpellEntry(Bot* self, uint16 spellid) +bool Perl_Bot_HasBotSpellEntry(Bot* self, int32 spellid) { return self->HasBotSpellEntry(spellid); } @@ -671,11 +671,11 @@ void perl_register_bot() package.add("Camp", (void(*)(Bot*))&Perl_Bot_Camp); package.add("Camp", (void(*)(Bot*, bool))&Perl_Bot_Camp); package.add("ClearDisciplineReuseTimer", (void(*)(Bot*))&Perl_Bot_ClearDisciplineReuseTimer); - package.add("ClearDisciplineReuseTimer", (void(*)(Bot*, uint16))&Perl_Bot_ClearDisciplineReuseTimer); + package.add("ClearDisciplineReuseTimer", (void(*)(Bot*, int32))&Perl_Bot_ClearDisciplineReuseTimer); package.add("ClearItemReuseTimer", (void(*)(Bot*))&Perl_Bot_ClearItemReuseTimer); package.add("ClearItemReuseTimer", (void(*)(Bot*, uint32))&Perl_Bot_ClearItemReuseTimer); package.add("ClearSpellRecastTimer", (void(*)(Bot*))&Perl_Bot_ClearSpellRecastTimer); - package.add("ClearSpellRecastTimer", (void(*)(Bot*, uint16))&Perl_Bot_ClearSpellRecastTimer); + package.add("ClearSpellRecastTimer", (void(*)(Bot*, int32))&Perl_Bot_ClearSpellRecastTimer); package.add("CountAugmentEquippedByID", &Perl_Bot_CountAugmentEquippedByID); package.add("CountBotItem", &Perl_Bot_CountBotItem); package.add("CountItemEquippedByID", &Perl_Bot_CountItemEquippedByID); @@ -716,12 +716,12 @@ void perl_register_bot() package.add("HasBotSpellEntry", &Perl_Bot_HasBotSpellEntry); package.add("HasItemEquippedByID", &Perl_Bot_HasItemEquippedByID); package.add("GetDisciplineReuseTimer", (uint32(*)(Bot*))&Perl_Bot_GetDisciplineReuseTimer); - package.add("GetDisciplineReuseTimer", (uint32(*)(Bot*, uint16))&Perl_Bot_GetDisciplineReuseTimer); + package.add("GetDisciplineReuseTimer", (uint32(*)(Bot*, int32))&Perl_Bot_GetDisciplineReuseTimer); package.add("GetItemEquippedByID", &Perl_Bot_HasItemEquippedByID); package.add("GetItemReuseTimer", (uint32(*)(Bot*))&Perl_Bot_GetItemReuseTimer); package.add("GetItemReuseTimer", (uint32(*)(Bot*, uint32))&Perl_Bot_GetItemReuseTimer); package.add("GetSpellRecastTimer", (uint32(*)(Bot*))&Perl_Bot_GetSpellRecastTimer); - package.add("GetSpellRecastTimer", (uint32(*)(Bot*, uint16))&Perl_Bot_GetSpellRecastTimer); + package.add("GetSpellRecastTimer", (uint32(*)(Bot*, int32))&Perl_Bot_GetSpellRecastTimer); package.add("IsGrouped", &Perl_Bot_IsGrouped); package.add("IsSitting", &Perl_Bot_IsSitting); package.add("IsStanding", &Perl_Bot_IsStanding); @@ -735,8 +735,8 @@ void perl_register_bot() package.add("SendPayload", (void(*)(Bot*, int, std::string))&Perl_Bot_SendPayload); package.add("SendSpellAnim", &Perl_Bot_SendSpellAnim); package.add("SetExpansionBitmask", (void(*)(Bot*, int))&Perl_Bot_SetExpansionBitmask); - package.add("SetDisciplineReuseTimer", (void(*)(Bot*, uint16))&Perl_Bot_SetDisciplineReuseTimer); - package.add("SetDisciplineReuseTimer", (void(*)(Bot*, uint16, uint32))&Perl_Bot_SetDisciplineReuseTimer); + package.add("SetDisciplineReuseTimer", (void(*)(Bot*, int32))&Perl_Bot_SetDisciplineReuseTimer); + package.add("SetDisciplineReuseTimer", (void(*)(Bot*, int32, uint32))&Perl_Bot_SetDisciplineReuseTimer); package.add("SetItemReuseTimer", (void(*)(Bot*, uint32))&Perl_Bot_SetItemReuseTimer); package.add("SetItemReuseTimer", (void(*)(Bot*, uint32, uint32))&Perl_Bot_SetItemReuseTimer); package.add("SetSpellDuration", (void(*)(Bot*, int))&Perl_Bot_SetSpellDuration); @@ -752,8 +752,8 @@ void perl_register_bot() package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int, int))&Perl_Bot_SetSpellDurationRaid); package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int, int, bool))&Perl_Bot_SetSpellDurationRaid); package.add("SetSpellDurationRaid", (void(*)(Bot*, int, int, int, bool, bool))&Perl_Bot_SetSpellDurationRaid); - package.add("SetSpellRecastTimer", (void(*)(Bot*, uint16))&Perl_Bot_SetSpellRecastTimer); - package.add("SetSpellRecastTimer", (void(*)(Bot*, uint16, uint32))&Perl_Bot_SetSpellRecastTimer); + package.add("SetSpellRecastTimer", (void(*)(Bot*, int32))&Perl_Bot_SetSpellRecastTimer); + package.add("SetSpellRecastTimer", (void(*)(Bot*, int32, uint32))&Perl_Bot_SetSpellRecastTimer); package.add("Signal", &Perl_Bot_Signal); package.add("Sit", &Perl_Bot_Sit); package.add("Stand", &Perl_Bot_Stand); diff --git a/zone/perl_buff.cpp b/zone/perl_buff.cpp index b3498c119..c90843d41 100644 --- a/zone/perl_buff.cpp +++ b/zone/perl_buff.cpp @@ -92,7 +92,7 @@ int16 Perl_Buff_GetRootBreakChance(Buffs_Struct* self) return self->RootBreakChance; } -uint16 Perl_Buff_GetSpellID(Buffs_Struct* self) +int32 Perl_Buff_GetSpellID(Buffs_Struct* self) { return self->spellid; } diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 012d96d46..233b1fe5b 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -515,7 +515,7 @@ void Perl_Client_AddSkill(Client* self, int skill_id, uint16 value) // @categori self->AddSkill(static_cast(skill_id), value); } -void Perl_Client_CheckSpecializeIncrease(Client* self, uint16 spell_id) // @categories Spells and Disciplines +void Perl_Client_CheckSpecializeIncrease(Client* self, int32 spell_id) // @categories Spells and Disciplines { self->CheckSpecializeIncrease(spell_id); } @@ -585,12 +585,12 @@ void Perl_Client_ResetAA(Client* self) // @categories Alternative Advancement self->ResetAA(); } -void Perl_Client_MemSpell(Client* self, uint16 spell_id, int slot) // @categories Spells and Disciplines +void Perl_Client_MemSpell(Client* self, int32 spell_id, int slot) // @categories Spells and Disciplines { self->MemSpell(spell_id, slot); } -void Perl_Client_MemSpell(Client* self, uint16 spell_id, int slot, bool update_client) // @categories Spells and Disciplines +void Perl_Client_MemSpell(Client* self, int32 spell_id, int slot, bool update_client) // @categories Spells and Disciplines { self->MemSpell(spell_id, slot, update_client); } @@ -630,7 +630,7 @@ int Perl_Client_FindMemmedSpellBySlot(Client* self, int slot) // @categories Acc return self->FindMemmedSpellBySlot(slot); } -int Perl_Client_FindMemmedSpellBySpellID(Client* self, uint16 spell_id) // @categories Account and Character, Spells and Disciplines +int Perl_Client_FindMemmedSpellBySpellID(Client* self, int32 spell_id) // @categories Account and Character, Spells and Disciplines { return self->FindMemmedSpellBySpellID(spell_id); } @@ -640,12 +640,12 @@ int Perl_Client_MemmedCount(Client* self) // @categories Spells and Disciplines return self->MemmedCount(); } -void Perl_Client_ScribeSpell(Client* self, uint16 spell_id, int slot) // @categories Spells and Disciplines +void Perl_Client_ScribeSpell(Client* self, int32 spell_id, int slot) // @categories Spells and Disciplines { self->ScribeSpell(spell_id, slot); } -void Perl_Client_ScribeSpell(Client* self, uint16 spell_id, int slot, bool update_client) // @categories Spells and Disciplines +void Perl_Client_ScribeSpell(Client* self, int32 spell_id, int slot, bool update_client) // @categories Spells and Disciplines { self->ScribeSpell(spell_id, slot, update_client); } @@ -915,7 +915,7 @@ bool Perl_Client_Thirsty(Client* self) // @categories Script Utility return self->Thirsty(); } -int Perl_Client_GetInstrumentMod(Client* self, uint16 spell_id) // @categories Spells and Disciplines +int Perl_Client_GetInstrumentMod(Client* self, int32 spell_id) // @categories Spells and Disciplines { return self->GetInstrumentMod(spell_id); } @@ -970,7 +970,7 @@ void Perl_Client_ResetTrade(Client* self) // @categories Script Utility self->ResetTrade(); } -bool Perl_Client_UseDiscipline(Client* self, uint32 spell_id, uint32 target) // @categories Spells and Disciplines +bool Perl_Client_UseDiscipline(Client* self, int32 spell_id, uint32 target) // @categories Spells and Disciplines { return self->UseDiscipline(spell_id, target); } @@ -1262,7 +1262,7 @@ void Perl_Client_SetEndurance(Client* self, int endurance) // @categories Accoun self->SetEndurance(endurance); } -void Perl_Client_SendOPTranslocateConfirm(Client* self, Mob* caster, uint16 spell_id) // @categories Script Utility +void Perl_Client_SendOPTranslocateConfirm(Client* self, Mob* caster, int32 spell_id) // @categories Script Utility { self->SendOPTranslocateConfirm(caster, spell_id); } @@ -1342,12 +1342,12 @@ int Perl_Client_GetFreeSpellBookSlot(Client* self, uint32 start_slot) // @catego return self->GetNextAvailableSpellBookSlot(start_slot); } -int Perl_Client_GetSpellBookSlotBySpellID(Client* self, uint32 spell_id) // @categories Spells and Disciplines +int Perl_Client_GetSpellBookSlotBySpellID(Client* self, int32 spell_id) // @categories Spells and Disciplines { return self->FindSpellBookSlotBySpellID(spell_id); } -uint32_t Perl_Client_GetSpellIDByBookSlot(Client* self, int slot_id) +int32_t Perl_Client_GetSpellIDByBookSlot(Client* self, int slot_id) { return self->GetSpellIDByBookSlot(slot_id); } @@ -1617,7 +1617,7 @@ void Perl_Client_SendColoredText(Client* self, uint32 color, std::string msg) // self->SendColoredText(color, std::move(msg)); } -void Perl_Client_SendSpellAnim(Client* self, uint16 targetid, uint16 spell_id) +void Perl_Client_SendSpellAnim(Client* self, uint16 targetid, int32 spell_id) { self->SendSpellAnim(targetid, spell_id); } @@ -2013,7 +2013,7 @@ void Perl_Client_Fling(Client* self, float value, float target_x, float target_y self->Fling(value, target_x, target_y, target_z, ignore_los, clip_through_walls); } -bool Perl_Client_HasDisciplineLearned(Client* self, uint16 spell_id) +bool Perl_Client_HasDisciplineLearned(Client* self, int32 spell_id) { return self->HasDisciplineLearned(spell_id); } @@ -2267,12 +2267,12 @@ void Perl_Client_ReadBookByName(Client* self, std::string book_name, uint8 book_ self->ReadBookByName(book_name, book_type); } -void Perl_Client_UntrainDiscBySpellID(Client* self, uint16 spell_id) // @categories Spells and Disciplines +void Perl_Client_UntrainDiscBySpellID(Client* self, int32 spell_id) // @categories Spells and Disciplines { self->UntrainDiscBySpellID(spell_id); } -void Perl_Client_UntrainDiscBySpellID(Client* self, uint16 spell_id, bool update_client) // @categories Spells and Disciplines +void Perl_Client_UntrainDiscBySpellID(Client* self, int32 spell_id, bool update_client) // @categories Spells and Disciplines { self->UntrainDiscBySpellID(spell_id, update_client); } @@ -2343,17 +2343,17 @@ void Perl_Client_ResetAllCastbarCooldowns(Client* self) self->ResetAllCastbarCooldowns(); } -void Perl_Client_ResetCastbarCooldownBySpellID(Client* self, uint32 spell_id) +void Perl_Client_ResetCastbarCooldownBySpellID(Client* self, int32 spell_id) { self->ResetCastbarCooldownBySpellID(spell_id); } -void Perl_Client_UnscribeSpellBySpellID(Client* self, uint16 spell_id) +void Perl_Client_UnscribeSpellBySpellID(Client* self, int32 spell_id) { self->UnscribeSpellBySpellID(spell_id); } -void Perl_Client_UnscribeSpellBySpellID(Client* self, uint16 spell_id, bool update_client) +void Perl_Client_UnscribeSpellBySpellID(Client* self, int32 spell_id, bool update_client) { self->UnscribeSpellBySpellID(spell_id, update_client); } @@ -3727,8 +3727,8 @@ void perl_register_client() package.add("MaxSkill", (int(*)(Client*, uint16, uint16))&Perl_Client_MaxSkill); package.add("MaxSkill", (int(*)(Client*, uint16, uint16, uint16))&Perl_Client_MaxSkill); package.add("MaxSkills", &Perl_Client_MaxSkills); - package.add("MemSpell", (void(*)(Client*, uint16, int))&Perl_Client_MemSpell); - package.add("MemSpell", (void(*)(Client*, uint16, int, bool))&Perl_Client_MemSpell); + package.add("MemSpell", (void(*)(Client*, int32, int))&Perl_Client_MemSpell); + package.add("MemSpell", (void(*)(Client*, int32, int, bool))&Perl_Client_MemSpell); package.add("MemmedCount", &Perl_Client_MemmedCount); package.add("MovePC", &Perl_Client_MovePC); package.add("MovePCDynamicZone", (void(*)(Client*, perl::scalar))&Perl_Client_MovePCDynamicZone); @@ -3804,8 +3804,8 @@ void perl_register_client() package.add("ResetLeadershipAA", &Perl_Client_ResetLeadershipAA); package.add("ResetTrade", &Perl_Client_ResetTrade); package.add("Save", &Perl_Client_Save); - package.add("ScribeSpell", (void(*)(Client*, uint16, int))&Perl_Client_ScribeSpell); - package.add("ScribeSpell", (void(*)(Client*, uint16, int, bool))&Perl_Client_ScribeSpell); + package.add("ScribeSpell", (void(*)(Client*, int32, int))&Perl_Client_ScribeSpell); + package.add("ScribeSpell", (void(*)(Client*, int32, int, bool))&Perl_Client_ScribeSpell); package.add("ScribeSpells", &Perl_Client_ScribeSpells); package.add("SendColoredText", &Perl_Client_SendColoredText); package.add("SendGMCommand", (bool(*)(Client*, std::string))&Perl_Client_SendGMCommand); @@ -3966,14 +3966,14 @@ void perl_register_client() package.add("UnscribeSpell", (void(*)(Client*, int, bool))&Perl_Client_UnscribeSpell); package.add("UnscribeSpellAll", (void(*)(Client*))&Perl_Client_UnscribeSpellAll); package.add("UnscribeSpellAll", (void(*)(Client*, bool))&Perl_Client_UnscribeSpellAll); - package.add("UnscribeSpellBySpellID", (void(*)(Client*, uint16))&Perl_Client_UnscribeSpellBySpellID); - package.add("UnscribeSpellBySpellID", (void(*)(Client*, uint16, bool))&Perl_Client_UnscribeSpellBySpellID); + package.add("UnscribeSpellBySpellID", (void(*)(Client*, int32 ))&Perl_Client_UnscribeSpellBySpellID); + package.add("UnscribeSpellBySpellID", (void(*)(Client*, int32, bool))&Perl_Client_UnscribeSpellBySpellID); package.add("UntrainDisc", (void(*)(Client*, int))&Perl_Client_UntrainDisc); package.add("UntrainDisc", (void(*)(Client*, int, bool))&Perl_Client_UntrainDisc); package.add("UntrainDiscAll", (void(*)(Client*))&Perl_Client_UntrainDiscAll); package.add("UntrainDiscAll", (void(*)(Client*, bool))&Perl_Client_UntrainDiscAll); - package.add("UntrainDiscBySpellID", (void(*)(Client*, uint16))&Perl_Client_UntrainDiscBySpellID); - package.add("UntrainDiscBySpellID", (void(*)(Client*, uint16, bool))&Perl_Client_UntrainDiscBySpellID); + package.add("UntrainDiscBySpellID", (void(*)(Client*, int32 ))&Perl_Client_UntrainDiscBySpellID); + package.add("UntrainDiscBySpellID", (void(*)(Client*, int32, bool))&Perl_Client_UntrainDiscBySpellID); package.add("UpdateAdmin", (void(*)(Client*))&Perl_Client_UpdateAdmin); package.add("UpdateAdmin", (void(*)(Client*, bool))&Perl_Client_UpdateAdmin); package.add("UpdateGroupAAs", &Perl_Client_UpdateGroupAAs); diff --git a/zone/perl_entity.cpp b/zone/perl_entity.cpp index 908b6f082..a05688064 100644 --- a/zone/perl_entity.cpp +++ b/zone/perl_entity.cpp @@ -714,22 +714,22 @@ void Perl_EntityList_AreaAttack(EntityList* self, Mob* attacker, float distance, self->AEAttack(attacker, distance, slot_id, count, is_from_spell, attack_rounds); } -void Perl_EntityList_AreaSpell(EntityList* self, Mob* caster, Mob* center, uint16 spell_id) +void Perl_EntityList_AreaSpell(EntityList* self, Mob* caster, Mob* center, int32 spell_id) { self->AESpell(caster, center, spell_id); } -void Perl_EntityList_AreaSpell(EntityList* self, Mob* caster, Mob* center, uint16 spell_id, bool affect_caster) +void Perl_EntityList_AreaSpell(EntityList* self, Mob* caster, Mob* center, int32 spell_id, bool affect_caster) { self->AESpell(caster, center, spell_id, affect_caster); } -void Perl_EntityList_AreaSpell(EntityList* self, Mob* caster, Mob* center, uint16 spell_id, bool affect_caster, int16 resist_adjust) +void Perl_EntityList_AreaSpell(EntityList* self, Mob* caster, Mob* center, int32 spell_id, bool affect_caster, int16 resist_adjust) { self->AESpell(caster, center, spell_id, affect_caster, resist_adjust); } -void Perl_EntityList_AreaSpell(EntityList* self, Mob* caster, Mob* center, uint16 spell_id, bool affect_caster, int16 resist_adjust, int max_targets) +void Perl_EntityList_AreaSpell(EntityList* self, Mob* caster, Mob* center, int32 spell_id, bool affect_caster, int16 resist_adjust, int max_targets) { self->AESpell(caster, center, spell_id, affect_caster, resist_adjust, &max_targets); } @@ -749,12 +749,12 @@ void Perl_EntityList_AreaTaunt(EntityList* self, Client* caster, float range, in self->AETaunt(caster, range, bonus_hate); } -void Perl_EntityList_MassGroupBuff(EntityList* self, Mob* caster, Mob* center, uint16 spell_id) +void Perl_EntityList_MassGroupBuff(EntityList* self, Mob* caster, Mob* center, int32 spell_id) { self->MassGroupBuff(caster, center, spell_id); } -void Perl_EntityList_MassGroupBuff(EntityList* self, Mob* caster, Mob* center, uint16 spell_id, bool affect_caster) +void Perl_EntityList_MassGroupBuff(EntityList* self, Mob* caster, Mob* center, int32 spell_id, bool affect_caster) { self->MassGroupBuff(caster, center, spell_id, affect_caster); } @@ -807,10 +807,10 @@ void perl_register_entitylist() package.add("AreaAttack", (void(*)(EntityList*, Mob*, float, int16, int))&Perl_EntityList_AreaAttack); package.add("AreaAttack", (void(*)(EntityList*, Mob*, float, int16, int, bool))&Perl_EntityList_AreaAttack); package.add("AreaAttack", (void(*)(EntityList*, Mob*, float, int16, int, bool, int))&Perl_EntityList_AreaAttack); - package.add("AreaSpell", (void(*)(EntityList*, Mob*, Mob*, uint16))&Perl_EntityList_AreaSpell); - package.add("AreaSpell", (void(*)(EntityList*, Mob*, Mob*, uint16, bool))&Perl_EntityList_AreaSpell); - package.add("AreaSpell", (void(*)(EntityList*, Mob*, Mob*, uint16, bool, int16))&Perl_EntityList_AreaSpell); - package.add("AreaSpell", (void(*)(EntityList*, Mob*, Mob*, uint16, bool, int16, int))&Perl_EntityList_AreaSpell); + package.add("AreaSpell", (void(*)(EntityList*, Mob*, Mob*, int32))&Perl_EntityList_AreaSpell); + package.add("AreaSpell", (void(*)(EntityList*, Mob*, Mob*, int32, bool))&Perl_EntityList_AreaSpell); + package.add("AreaSpell", (void(*)(EntityList*, Mob*, Mob*, int32, bool, int16))&Perl_EntityList_AreaSpell); + package.add("AreaSpell", (void(*)(EntityList*, Mob*, Mob*, int32, bool, int16, int))&Perl_EntityList_AreaSpell); package.add("AreaTaunt", (void(*)(EntityList*, Client*))&Perl_EntityList_AreaTaunt); package.add("AreaTaunt", (void(*)(EntityList*, Client*, float))&Perl_EntityList_AreaTaunt); package.add("AreaTaunt", (void(*)(EntityList*, Client*, float, int))&Perl_EntityList_AreaTaunt); @@ -889,8 +889,8 @@ void perl_register_entitylist() package.add("Marquee", (void(*)(EntityList*, uint32, std::string))&Perl_EntityList_Marquee); package.add("Marquee", (void(*)(EntityList*, uint32, std::string, uint32))&Perl_EntityList_Marquee); package.add("Marquee", (void(*)(EntityList*, uint32, uint32, uint32, uint32, uint32, std::string))&Perl_EntityList_Marquee); - package.add("MassGroupBuff", (void(*)(EntityList*, Mob*, Mob*, uint16))&Perl_EntityList_MassGroupBuff); - package.add("MassGroupBuff", (void(*)(EntityList*, Mob*, Mob*, uint16, bool))&Perl_EntityList_MassGroupBuff); + package.add("MassGroupBuff", (void(*)(EntityList*, Mob*, Mob*, int32))&Perl_EntityList_MassGroupBuff); + package.add("MassGroupBuff", (void(*)(EntityList*, Mob*, Mob*, int32, bool))&Perl_EntityList_MassGroupBuff); package.add("Message", &Perl_EntityList_Message); package.add("MessageClose", &Perl_EntityList_MessageClose); package.add("MessageGroup", &Perl_EntityList_MessageGroup); diff --git a/zone/perl_groups.cpp b/zone/perl_groups.cpp index cca4c4aea..118b8e084 100644 --- a/zone/perl_groups.cpp +++ b/zone/perl_groups.cpp @@ -38,7 +38,7 @@ bool Perl_Group_IsGroupMember(Group* self, const char* name) // @categories Acco return self->IsGroupMember(name); } -void Perl_Group_CastGroupSpell(Group* self, Mob* caster, uint16 spell_id) // @categories Account and Character, Script Utility, Group +void Perl_Group_CastGroupSpell(Group* self, Mob* caster, int32 spell_id) // @categories Account and Character, Script Utility, Group { self->CastGroupSpell(caster, spell_id); } diff --git a/zone/perl_merc.cpp b/zone/perl_merc.cpp index 92c887d23..68ae21c3f 100644 --- a/zone/perl_merc.cpp +++ b/zone/perl_merc.cpp @@ -167,7 +167,7 @@ bool Perl_Merc_Suspend(Merc* self) return self->Suspend(); } -bool Perl_Merc_UseDiscipline(Merc* self, uint16 spell_id, uint16 target_id) +bool Perl_Merc_UseDiscipline(Merc* self, int32 spell_id, uint16 target_id) { return self->UseDiscipline(spell_id, target_id); } diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 0fbfc6e10..061bb683f 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -242,22 +242,22 @@ bool Perl_Mob_Attack(Mob* self, Mob* other, int hand, bool from_riposte) // @cat return self->Attack(other, hand, from_riposte); } -void Perl_Mob_Damage(Mob* self, Mob* from, int64_t damage, uint16_t spell_id, int attack_skill) // @categories Script Utility +void Perl_Mob_Damage(Mob* self, Mob* from, int64_t damage, int32_t spell_id, int attack_skill) // @categories Script Utility { self->Damage(from, damage, spell_id, static_cast(attack_skill)); } -void Perl_Mob_Damage(Mob* self, Mob* from, int64_t damage, uint16_t spell_id, int attack_skill, bool avoidable) // @categories Script Utility +void Perl_Mob_Damage(Mob* self, Mob* from, int64_t damage, int32_t spell_id, int attack_skill, bool avoidable) // @categories Script Utility { self->Damage(from, damage, spell_id, static_cast(attack_skill), avoidable); } -void Perl_Mob_Damage(Mob* self, Mob* from, int64_t damage, uint16_t spell_id, int attack_skill, bool avoidable, int8_t buffslot) // @categories Script Utility +void Perl_Mob_Damage(Mob* self, Mob* from, int64_t damage, int32_t spell_id, int attack_skill, bool avoidable, int8_t buffslot) // @categories Script Utility { self->Damage(from, damage, spell_id, static_cast(attack_skill), avoidable, buffslot); } -void Perl_Mob_Damage(Mob* self, Mob* from, int64_t damage, uint16_t spell_id, int attack_skill, bool avoidable, int8_t buffslot, bool buff_tic) // @categories Script Utility +void Perl_Mob_Damage(Mob* self, Mob* from, int64_t damage, int32_t spell_id, int attack_skill, bool avoidable, int8_t buffslot, bool buff_tic) // @categories Script Utility { self->Damage(from, damage, spell_id, static_cast(attack_skill), avoidable, buffslot, buff_tic); } @@ -373,12 +373,12 @@ void Perl_Mob_SetSeeInvisibleUndeadLevel(Mob* self, uint8 see_invis_undead_level self->SetSeeInvisibleUndead(see_invis_undead_level); } -bool Perl_Mob_FindBuff(Mob* self, uint16 spell_id) // @categories Spells and Disciplines, Script Utility +bool Perl_Mob_FindBuff(Mob* self, int32 spell_id) // @categories Spells and Disciplines, Script Utility { return self->FindBuff(spell_id); } -bool Perl_Mob_FindBuff(Mob* self, uint16 spell_id, uint16 caster_id) // @categories Spells and Disciplines, Script Utility +bool Perl_Mob_FindBuff(Mob* self, int32 spell_id, uint16 caster_id) // @categories Spells and Disciplines, Script Utility { return self->FindBuff(spell_id, caster_id); } @@ -408,37 +408,37 @@ int Perl_Mob_GetBuffSlotFromType(Mob* self, uint16 type) // @categories Spells a return self->GetBuffSlotFromType(type); } -void Perl_Mob_MakePet(Mob* self, uint16 spell_id, const char* pet_type) // @categories Pet +void Perl_Mob_MakePet(Mob* self, int32 spell_id, const char* pet_type) // @categories Pet { self->MakePet(spell_id, pet_type); } -void Perl_Mob_MakePet(Mob* self, uint16 spell_id, const char* pet_type, const char* name) // @categories Pet +void Perl_Mob_MakePet(Mob* self, int32 spell_id, const char* pet_type, const char* name) // @categories Pet { self->MakePet(spell_id, pet_type, name); } -void Perl_Mob_MakeTempPet(Mob* self, uint16 spell_id) // @categories Pet +void Perl_Mob_MakeTempPet(Mob* self, int32 spell_id) // @categories Pet { self->TemporaryPets(spell_id, nullptr); } -void Perl_Mob_MakeTempPet(Mob* self, uint16 spell_id, const char* name) // @categories Pet +void Perl_Mob_MakeTempPet(Mob* self, int32 spell_id, const char* name) // @categories Pet { self->TemporaryPets(spell_id, nullptr, name); } -void Perl_Mob_MakeTempPet(Mob* self, uint16 spell_id, const char* name, uint32 duration) // @categories Pet +void Perl_Mob_MakeTempPet(Mob* self, int32 spell_id, const char* name, uint32 duration) // @categories Pet { self->TemporaryPets(spell_id, nullptr, name, duration); } -void Perl_Mob_MakeTempPet(Mob* self, uint16 spell_id, const char* name, uint32 duration, Mob* target) // @categories Pet +void Perl_Mob_MakeTempPet(Mob* self, int32 spell_id, const char* name, uint32 duration, Mob* target) // @categories Pet { self->TemporaryPets(spell_id, target, name, duration); } -void Perl_Mob_MakeTempPet(Mob* self, uint16 spell_id, const char* name, uint32 duration, Mob* target, bool sticktarg) // @categories Pet +void Perl_Mob_MakeTempPet(Mob* self, int32 spell_id, const char* name, uint32 duration, Mob* target, bool sticktarg) // @categories Pet { self->TemporaryPets(spell_id, target, name, duration, true, sticktarg); } @@ -633,7 +633,7 @@ int Perl_Mob_GetRunspeed(Mob* self) // @categories Stats and Attributes return self->GetRunspeed(); } -int Perl_Mob_GetCasterLevel(Mob* self, uint16_t spell_id) // @categories Stats and Attributes +int Perl_Mob_GetCasterLevel(Mob* self, int32_t spell_id) // @categories Stats and Attributes { return self->GetCasterLevel(spell_id); } @@ -778,72 +778,72 @@ int Perl_Mob_GetMaxCHA(Mob* self) // @categories Stats and Attributes return self->GetMaxCHA(); } -float Perl_Mob_GetActSpellRange(Mob* self, uint16 spell_id, float range) // @categories Spells and Disciplines +float Perl_Mob_GetActSpellRange(Mob* self, int32 spell_id, float range) // @categories Spells and Disciplines { return self->GetActSpellRange(spell_id, range); } -int64_t Perl_Mob_GetActSpellDamage(Mob* self, uint16 spell_id, int64 value) // @categories Spells and Disciplines +int64_t Perl_Mob_GetActSpellDamage(Mob* self, int32 spell_id, int64 value) // @categories Spells and Disciplines { return self->GetActSpellDamage(spell_id, value); } -int64_t Perl_Mob_GetActSpellDamage(Mob* self, uint16 spell_id, int64 value, Mob* target) // @categories Spells and Disciplines +int64_t Perl_Mob_GetActSpellDamage(Mob* self, int32 spell_id, int64 value, Mob* target) // @categories Spells and Disciplines { return self->GetActSpellDamage(spell_id, value, target); } -int64_t Perl_Mob_GetActDoTDamage(Mob* self, uint16 spell_id, int64 value, Mob* target) // @categories Spells and Disciplines +int64_t Perl_Mob_GetActDoTDamage(Mob* self, int32 spell_id, int64 value, Mob* target) // @categories Spells and Disciplines { return self->GetActDoTDamage(spell_id, value, target); } -int64_t Perl_Mob_GetActDoTDamage(Mob* self, uint16 spell_id, int64 value, Mob* target, bool from_buff_tic) // @categories Spells and Disciplines +int64_t Perl_Mob_GetActDoTDamage(Mob* self, int32 spell_id, int64 value, Mob* target, bool from_buff_tic) // @categories Spells and Disciplines { return self->GetActDoTDamage(spell_id, value, target, from_buff_tic); } -int64_t Perl_Mob_GetActSpellHealing(Mob* self, uint16 spell_id, int64 value) // @categories Spells and Disciplines +int64_t Perl_Mob_GetActSpellHealing(Mob* self, int32 spell_id, int64 value) // @categories Spells and Disciplines { return self->GetActSpellHealing(spell_id, value); } -int64_t Perl_Mob_GetActSpellHealing(Mob* self, uint16 spell_id, int64 value, Mob* target) // @categories Spells and Disciplines +int64_t Perl_Mob_GetActSpellHealing(Mob* self, int32 spell_id, int64 value, Mob* target) // @categories Spells and Disciplines { return self->GetActSpellHealing(spell_id, value, target); } -int64_t Perl_Mob_GetActSpellHealing(Mob* self, uint16 spell_id, int64 value, Mob* target, bool from_buff_tic) // @categories Spells and Disciplines +int64_t Perl_Mob_GetActSpellHealing(Mob* self, int32 spell_id, int64 value, Mob* target, bool from_buff_tic) // @categories Spells and Disciplines { return self->GetActSpellHealing(spell_id, value, target, from_buff_tic); } -int Perl_Mob_GetActSpellCost(Mob* self, uint16 spell_id, int32 cost) // @categories Spells and Disciplines +int Perl_Mob_GetActSpellCost(Mob* self, int32 spell_id, int32 cost) // @categories Spells and Disciplines { return self->GetActSpellCost(spell_id, cost); } -int Perl_Mob_GetActSpellDuration(Mob* self, uint16 spell_id, int32 duration) // @categories Spells and Disciplines +int Perl_Mob_GetActSpellDuration(Mob* self, int32 spell_id, int32 duration) // @categories Spells and Disciplines { return self->GetActSpellDuration(spell_id, duration); } -int Perl_Mob_GetActSpellCasttime(Mob* self, uint16 spell_id, uint32 cast_time) // @categories Spells and Disciplines +int Perl_Mob_GetActSpellCasttime(Mob* self, int32 spell_id, uint32 cast_time) // @categories Spells and Disciplines { return self->GetActSpellCasttime(spell_id, cast_time); } -int64 Perl_Mob_GetActReflectedSpellDamage(Mob* self, uint16 spell_id, int64 value, int effectiveness) // @categories Spells and Disciplines +int64 Perl_Mob_GetActReflectedSpellDamage(Mob* self, int32 spell_id, int64 value, int effectiveness) // @categories Spells and Disciplines { return self->GetActReflectedSpellDamage(spell_id, value, effectiveness); } -float Perl_Mob_ResistSpell(Mob* self, uint8 resist_type, uint16 spell_id, Mob* caster) // @categories Spells and Disciplines, Script Utility +float Perl_Mob_ResistSpell(Mob* self, uint8 resist_type, int32 spell_id, Mob* caster) // @categories Spells and Disciplines, Script Utility { return self->ResistSpell(resist_type, spell_id, caster); } -int Perl_Mob_GetSpecializeSkillValue(Mob* self, uint16 spell_id) // @categories Skills and Recipes, Spells and Disciplines +int Perl_Mob_GetSpecializeSkillValue(Mob* self, int32 spell_id) // @categories Skills and Recipes, Spells and Disciplines { return self->GetSpecializeSkillValue(spell_id); } @@ -972,65 +972,65 @@ void Perl_Mob_InterruptSpell(Mob* self) // @categories Script Utility self->InterruptSpell(); } -void Perl_Mob_InterruptSpell(Mob* self, uint16 spell_id) // @categories Script Utility +void Perl_Mob_InterruptSpell(Mob* self, int32 spell_id) // @categories Script Utility { self->InterruptSpell(spell_id); } -void Perl_Mob_CastSpell(Mob* self, uint16 spell_id, uint16 target_id) // @categories Spells and Disciplines +void Perl_Mob_CastSpell(Mob* self, int32 spell_id, uint16 target_id) // @categories Spells and Disciplines { self->CastSpell(spell_id, target_id); } -void Perl_Mob_CastSpell(Mob* self, uint16 spell_id, uint16 target_id, int slot) // @categories Spells and Disciplines +void Perl_Mob_CastSpell(Mob* self, int32 spell_id, uint16 target_id, int slot) // @categories Spells and Disciplines { self->CastSpell(spell_id, target_id, static_cast(slot)); } -void Perl_Mob_CastSpell(Mob* self, uint16 spell_id, uint16 target_id, int slot, int cast_time) // @categories Spells and Disciplines +void Perl_Mob_CastSpell(Mob* self, int32 spell_id, uint16 target_id, int slot, int cast_time) // @categories Spells and Disciplines { self->CastSpell(spell_id, target_id, static_cast(slot), cast_time); } -void Perl_Mob_CastSpell(Mob* self, uint16 spell_id, uint16 target_id, int slot, int cast_time, int mana_cost) // @categories Spells and Disciplines +void Perl_Mob_CastSpell(Mob* self, int32 spell_id, uint16 target_id, int slot, int cast_time, int mana_cost) // @categories Spells and Disciplines { self->CastSpell(spell_id, target_id, static_cast(slot), cast_time, mana_cost); } // args differ from lua api (item_slot, timer, timer_duration not supported) -void Perl_Mob_CastSpell(Mob* self, uint16 spell_id, uint16 target_id, int slot, int cast_time, int mana_cost, int16 resist_adjust) // @categories Spells and Disciplines +void Perl_Mob_CastSpell(Mob* self, int32 spell_id, uint16 target_id, int slot, int cast_time, int mana_cost, int16 resist_adjust) // @categories Spells and Disciplines { int16 res = resist_adjust; self->CastSpell(spell_id, target_id, static_cast(slot), cast_time, mana_cost, nullptr, 0xFFFFFFFF, 0xFFFFFFFF, 0, &res); } // these don't match lua api for default resist difficulty -void Perl_Mob_SpellFinished(Mob* self, uint16 spell_id) // @categories Spells and Disciplines +void Perl_Mob_SpellFinished(Mob* self, int32 spell_id) // @categories Spells and Disciplines { self->SpellFinished(spell_id, self, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); } -void Perl_Mob_SpellFinished(Mob* self, uint16 spell_id, Mob* target) // @categories Spells and Disciplines +void Perl_Mob_SpellFinished(Mob* self, int32 spell_id, Mob* target) // @categories Spells and Disciplines { self->SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].resist_difficulty); } -void Perl_Mob_SpellFinished(Mob* self, uint16 spell_id, Mob* target, int32 mana_cost) // @categories Spells and Disciplines +void Perl_Mob_SpellFinished(Mob* self, int32 spell_id, Mob* target, int32 mana_cost) // @categories Spells and Disciplines { self->SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, mana_cost, -1, spells[spell_id].resist_difficulty); } -void Perl_Mob_SpellFinished(Mob* self, uint16 spell_id, Mob* target, int32 mana_cost, uint16 resist_diff) // @categories Spells and Disciplines +void Perl_Mob_SpellFinished(Mob* self, int32 spell_id, Mob* target, int32 mana_cost, uint16 resist_diff) // @categories Spells and Disciplines { self->SpellFinished(spell_id, target, EQ::spells::CastingSlot::Item, mana_cost, -1, resist_diff); } -bool Perl_Mob_IsImmuneToSpell(Mob* self, uint16 spell_id, Mob* caster) // @categories Spells and Disciplines, Script Utility +bool Perl_Mob_IsImmuneToSpell(Mob* self, int32 spell_id, Mob* caster) // @categories Spells and Disciplines, Script Utility { return self->IsImmuneToSpell(spell_id, caster); } -void Perl_Mob_BuffFadeBySpellID(Mob* self, uint16 spell_id) // @categories Script Utility, Spells and Disciplines +void Perl_Mob_BuffFadeBySpellID(Mob* self, int32 spell_id) // @categories Script Utility, Spells and Disciplines { self->BuffFadeBySpellID(spell_id); } @@ -1060,12 +1060,12 @@ void Perl_Mob_BuffFadeBySlot(Mob* self, int slot, bool recalc_bonuses) // @categ self->BuffFadeBySlot(slot, recalc_bonuses); } -bool Perl_Mob_CanBuffStack(Mob* self, uint16 spell_id, uint8 caster_level) // @categories Script Utility, Spells and Disciplines +bool Perl_Mob_CanBuffStack(Mob* self, int32 spell_id, uint8 caster_level) // @categories Script Utility, Spells and Disciplines { return self->CanBuffStack(spell_id, caster_level); } -bool Perl_Mob_CanBuffStack(Mob* self, uint16 spell_id, uint8 caster_level, bool fail_if_overwritten) // @categories Script Utility, Spells and Disciplines +bool Perl_Mob_CanBuffStack(Mob* self, int32 spell_id, uint8 caster_level, bool fail_if_overwritten) // @categories Script Utility, Spells and Disciplines { return self->CanBuffStack(spell_id, caster_level, fail_if_overwritten); } @@ -1535,17 +1535,17 @@ uint32_t Perl_Mob_GetZoneID(Mob* self) // @categories Zones return self->GetZoneID(); } -int Perl_Mob_CheckAggroAmount(Mob* self, uint16 spell_id) // @categories Hate and Aggro +int Perl_Mob_CheckAggroAmount(Mob* self, int32 spell_id) // @categories Hate and Aggro { return self->CheckAggroAmount(spell_id, nullptr); } -int Perl_Mob_CheckHealAggroAmount(Mob* self, uint16 spell_id) // @categories Hate and Aggro +int Perl_Mob_CheckHealAggroAmount(Mob* self, int32 spell_id) // @categories Hate and Aggro { return self->CheckHealAggroAmount(spell_id, nullptr); } -int Perl_Mob_CheckHealAggroAmount(Mob* self, uint16 spell_id, uint32 possible) // @categories Hate and Aggro +int Perl_Mob_CheckHealAggroAmount(Mob* self, int32 spell_id, uint32 possible) // @categories Hate and Aggro { return self->CheckHealAggroAmount(spell_id, nullptr, possible); } @@ -2431,12 +2431,12 @@ int Perl_Mob_GetFlurryChance(Mob* self) // @categories Stats and Attributes return self->GetFlurryChance(); } -int Perl_Mob_GetSpellStat(Mob* self, uint32 spell_id, const char* stat) // @categories Spells and Disciplines +int Perl_Mob_GetSpellStat(Mob* self, int32 spell_id, const char* stat) // @categories Spells and Disciplines { return self->GetSpellStat(spell_id, stat); } -int Perl_Mob_GetSpellStat(Mob* self, uint32 spell_id, const char* stat, uint8 slot) // @categories Spells and Disciplines +int Perl_Mob_GetSpellStat(Mob* self, int32 spell_id, const char* stat, uint8 slot) // @categories Spells and Disciplines { return self->GetSpellStat(spell_id, stat, slot); } @@ -3539,32 +3539,32 @@ void Perl_Mob_AreaAttack(Mob* self, float distance, int16 slot_id, int count, bo entity_list.AEAttack(self, distance, slot_id, count, is_from_spell, attack_rounds); } -void Perl_Mob_AreaSpell(Mob* self, Mob* center, uint16 spell_id) +void Perl_Mob_AreaSpell(Mob* self, Mob* center, int32 spell_id) { entity_list.AESpell(self, center, spell_id, true, 0, nullptr, true); } -void Perl_Mob_AreaSpell(Mob* self, Mob* center, uint16 spell_id, bool affect_caster) +void Perl_Mob_AreaSpell(Mob* self, Mob* center, int32 spell_id, bool affect_caster) { entity_list.AESpell(self, center, spell_id, affect_caster, 0, nullptr, true); } -void Perl_Mob_AreaSpell(Mob* self, Mob* center, uint16 spell_id, bool affect_caster, int16 resist_adjust) +void Perl_Mob_AreaSpell(Mob* self, Mob* center, int32 spell_id, bool affect_caster, int16 resist_adjust) { entity_list.AESpell(self, center, spell_id, affect_caster, resist_adjust, nullptr, true); } -void Perl_Mob_AreaSpell(Mob* self, Mob* center, uint16 spell_id, bool affect_caster, int16 resist_adjust, int max_targets) +void Perl_Mob_AreaSpell(Mob* self, Mob* center, int32 spell_id, bool affect_caster, int16 resist_adjust, int max_targets) { entity_list.AESpell(self, center, spell_id, affect_caster, resist_adjust, &max_targets, true); } -void Perl_Mob_MassGroupBuff(Mob* self, Mob* center, uint16 spell_id) +void Perl_Mob_MassGroupBuff(Mob* self, Mob* center, int32 spell_id) { entity_list.MassGroupBuff(self, center, spell_id); } -void Perl_Mob_MassGroupBuff(Mob* self, Mob* center, uint16 spell_id, bool affect_caster) +void Perl_Mob_MassGroupBuff(Mob* self, Mob* center, int32 spell_id, bool affect_caster) { entity_list.MassGroupBuff(self, center, spell_id, affect_caster); } @@ -3644,10 +3644,10 @@ void perl_register_mob() package.add("AreaAttack", (void(*)(Mob*, float, int16, int))&Perl_Mob_AreaAttack); package.add("AreaAttack", (void(*)(Mob*, float, int16, int, bool))&Perl_Mob_AreaAttack); package.add("AreaAttack", (void(*)(Mob*, float, int16, int, bool, int))&Perl_Mob_AreaAttack); - package.add("AreaSpell", (void(*)(Mob*, Mob*, uint16))&Perl_Mob_AreaSpell); - package.add("AreaSpell", (void(*)(Mob*, Mob*, uint16, bool))&Perl_Mob_AreaSpell); - package.add("AreaSpell", (void(*)(Mob*, Mob*, uint16, bool, int16))&Perl_Mob_AreaSpell); - package.add("AreaSpell", (void(*)(Mob*, Mob*, uint16, bool, int16, int))&Perl_Mob_AreaSpell); + package.add("AreaSpell", (void(*)(Mob*, Mob*, int32))&Perl_Mob_AreaSpell); + package.add("AreaSpell", (void(*)(Mob*, Mob*, int32, bool))&Perl_Mob_AreaSpell); + package.add("AreaSpell", (void(*)(Mob*, Mob*, int32, bool, int16))&Perl_Mob_AreaSpell); + package.add("AreaSpell", (void(*)(Mob*, Mob*, int32, bool, int16, int))&Perl_Mob_AreaSpell); package.add("Attack", (bool(*)(Mob*, Mob*))&Perl_Mob_Attack); package.add("Attack", (bool(*)(Mob*, Mob*, int))&Perl_Mob_Attack); package.add("Attack", (bool(*)(Mob*, Mob*, int, bool))&Perl_Mob_Attack); @@ -3675,8 +3675,8 @@ void perl_register_mob() package.add("CameraEffect", (void(*)(Mob*, uint32, float))&Perl_Mob_CameraEffect); package.add("CameraEffect", (void(*)(Mob*, uint32, float, Client*))&Perl_Mob_CameraEffect); package.add("CameraEffect", (void(*)(Mob*, uint32, float, perl::nullable, bool))&Perl_Mob_CameraEffect); - package.add("CanBuffStack", (bool(*)(Mob*, uint16, uint8))&Perl_Mob_CanBuffStack); - package.add("CanBuffStack", (bool(*)(Mob*, uint16, uint8, bool))&Perl_Mob_CanBuffStack); + package.add("CanBuffStack", (bool(*)(Mob*, int32, uint8))&Perl_Mob_CanBuffStack); + package.add("CanBuffStack", (bool(*)(Mob*, int32, uint8, bool))&Perl_Mob_CanBuffStack); package.add("CanClassEquipItem", &Perl_Mob_CanClassEquipItem); package.add("CanRaceEquipItem", &Perl_Mob_CanRaceEquipItem); package.add("CanThisClassDodge", &Perl_Mob_CanThisClassDodge); @@ -3684,11 +3684,11 @@ void perl_register_mob() package.add("CanThisClassDualWield", &Perl_Mob_CanThisClassDualWield); package.add("CanThisClassParry", &Perl_Mob_CanThisClassParry); package.add("CanThisClassRiposte", &Perl_Mob_CanThisClassRiposte); - package.add("CastSpell", (void(*)(Mob*, uint16, uint16))&Perl_Mob_CastSpell); - package.add("CastSpell", (void(*)(Mob*, uint16, uint16, int))&Perl_Mob_CastSpell); - package.add("CastSpell", (void(*)(Mob*, uint16, uint16, int, int))&Perl_Mob_CastSpell); - package.add("CastSpell", (void(*)(Mob*, uint16, uint16, int, int, int))&Perl_Mob_CastSpell); - package.add("CastSpell", (void(*)(Mob*, uint16, uint16, int, int, int, int16))&Perl_Mob_CastSpell); + package.add("CastSpell", (void(*)(Mob*, int32, uint16))&Perl_Mob_CastSpell); + package.add("CastSpell", (void(*)(Mob*, int32, uint16, int))&Perl_Mob_CastSpell); + package.add("CastSpell", (void(*)(Mob*, int32, uint16, int, int))&Perl_Mob_CastSpell); + package.add("CastSpell", (void(*)(Mob*, int32, uint16, int, int, int))&Perl_Mob_CastSpell); + package.add("CastSpell", (void(*)(Mob*, int32, uint16, int, int, int, int16))&Perl_Mob_CastSpell); package.add("CastToBot", &Perl_Mob_CastToBot); package.add("CastToClient", &Perl_Mob_CastToClient); package.add("CastToCorpse", &Perl_Mob_CastToCorpse); @@ -3700,8 +3700,8 @@ void perl_register_mob() package.add("Charmed", &Perl_Mob_Charmed); package.add("CheckAggro", &Perl_Mob_CheckAggro); package.add("CheckAggroAmount", &Perl_Mob_CheckAggroAmount); - package.add("CheckHealAggroAmount", (int(*)(Mob*, uint16))&Perl_Mob_CheckHealAggroAmount); - package.add("CheckHealAggroAmount", (int(*)(Mob*, uint16, uint32))&Perl_Mob_CheckHealAggroAmount); + package.add("CheckHealAggroAmount", (int(*)(Mob*, int32))&Perl_Mob_CheckHealAggroAmount); + package.add("CheckHealAggroAmount", (int(*)(Mob*, int32, uint32))&Perl_Mob_CheckHealAggroAmount); package.add("CheckLoS", &Perl_Mob_CheckLoS); package.add("CheckLoSToLoc", (bool(*)(Mob*, float, float, float))&Perl_Mob_CheckLoSToLoc); package.add("CheckLoSToLoc", (bool(*)(Mob*, float, float, float, float))&Perl_Mob_CheckLoSToLoc); @@ -3712,10 +3712,10 @@ void perl_register_mob() package.add("CloneAppearance", (void(*)(Mob*, Mob*, bool))&Perl_Mob_CloneAppearance); package.add("CombatRange", &Perl_Mob_CombatRange); package.add("CopyHateList", &Perl_Mob_CopyHateList); - package.add("Damage", (void(*)(Mob*, Mob*, int64, uint16_t, int))&Perl_Mob_Damage); - package.add("Damage", (void(*)(Mob*, Mob*, int64, uint16_t, int, bool))&Perl_Mob_Damage); - package.add("Damage", (void(*)(Mob*, Mob*, int64, uint16_t, int, bool, int8_t))&Perl_Mob_Damage); - package.add("Damage", (void(*)(Mob*, Mob*, int64, uint16_t, int, bool, int8_t, bool))&Perl_Mob_Damage); + package.add("Damage", (void(*)(Mob*, Mob*, int64, int32_t, int))&Perl_Mob_Damage); + package.add("Damage", (void(*)(Mob*, Mob*, int64, int32_t, int, bool))&Perl_Mob_Damage); + package.add("Damage", (void(*)(Mob*, Mob*, int64, int32_t, int, bool, int8_t))&Perl_Mob_Damage); + package.add("Damage", (void(*)(Mob*, Mob*, int64, int32_t, int, bool, int8_t, bool))&Perl_Mob_Damage); package.add("DamageArea", (void(*)(Mob*, int64))&Perl_Mob_DamageArea); package.add("DamageArea", (void(*)(Mob*, int64, uint32))&Perl_Mob_DamageArea); package.add("DamageAreaBots", (void(*)(Mob*, int64))&Perl_Mob_DamageAreaBots); @@ -3776,8 +3776,8 @@ void perl_register_mob() package.add("EntityVariableExists", &Perl_Mob_EntityVariableExists); package.add("FaceTarget", (void(*)(Mob*))&Perl_Mob_FaceTarget); package.add("FaceTarget", (void(*)(Mob*, Mob*))&Perl_Mob_FaceTarget); - package.add("FindBuff", (bool(*)(Mob*, uint16))&Perl_Mob_FindBuff); - package.add("FindBuff", (bool(*)(Mob*, uint16, uint16))&Perl_Mob_FindBuff); + package.add("FindBuff", (bool(*)(Mob*, int32))&Perl_Mob_FindBuff); + package.add("FindBuff", (bool(*)(Mob*, int32, uint16))&Perl_Mob_FindBuff); package.add("FindBuffBySlot", &Perl_Mob_FindBuffBySlot); package.add("FindGroundZ", (float(*)(Mob*, float, float))&Perl_Mob_FindGroundZ); package.add("FindGroundZ", (float(*)(Mob*, float, float, float))&Perl_Mob_FindGroundZ); @@ -3794,17 +3794,17 @@ void perl_register_mob() package.add("GetAC", &Perl_Mob_GetAC); package.add("GetAGI", &Perl_Mob_GetAGI); package.add("GetATK", &Perl_Mob_GetATK); - package.add("GetActDoTDamage", (int64_t(*)(Mob*, uint16, int64, Mob*))&Perl_Mob_GetActDoTDamage); - package.add("GetActDoTDamage", (int64_t(*)(Mob*, uint16, int64, Mob*, bool))&Perl_Mob_GetActDoTDamage); + package.add("GetActDoTDamage", (int64_t(*)(Mob*, int32, int64, Mob*))&Perl_Mob_GetActDoTDamage); + package.add("GetActDoTDamage", (int64_t(*)(Mob*, int32, int64, Mob*, bool))&Perl_Mob_GetActDoTDamage); package.add("GetActReflectedSpellDamage", &Perl_Mob_GetActReflectedSpellDamage); package.add("GetActSpellCasttime", &Perl_Mob_GetActSpellCasttime); package.add("GetActSpellCost", &Perl_Mob_GetActSpellCost); - package.add("GetActSpellDamage", (int64_t(*)(Mob*, uint16, int64))&Perl_Mob_GetActSpellDamage); - package.add("GetActSpellDamage", (int64_t(*)(Mob*, uint16, int64, Mob*))&Perl_Mob_GetActSpellDamage); + package.add("GetActSpellDamage", (int64_t(*)(Mob*, int32, int64))&Perl_Mob_GetActSpellDamage); + package.add("GetActSpellDamage", (int64_t(*)(Mob*, int32, int64, Mob*))&Perl_Mob_GetActSpellDamage); package.add("GetActSpellDuration", &Perl_Mob_GetActSpellDuration); - package.add("GetActSpellHealing", (int64_t(*)(Mob*, uint16, int64))&Perl_Mob_GetActSpellHealing); - package.add("GetActSpellHealing", (int64_t(*)(Mob*, uint16, int64, Mob*))&Perl_Mob_GetActSpellHealing); - package.add("GetActSpellHealing", (int64_t(*)(Mob*, uint16, int64, Mob*, bool))&Perl_Mob_GetActSpellHealing); + package.add("GetActSpellHealing", (int64_t(*)(Mob*, int32, int64))&Perl_Mob_GetActSpellHealing); + package.add("GetActSpellHealing", (int64_t(*)(Mob*, int32, int64, Mob*))&Perl_Mob_GetActSpellHealing); + package.add("GetActSpellHealing", (int64_t(*)(Mob*, int32, int64, Mob*, bool))&Perl_Mob_GetActSpellHealing); package.add("GetActSpellRange", &Perl_Mob_GetActSpellRange); package.add("GetAggroRange", &Perl_Mob_GetAggroRange); package.add("GetAllowBeneficial", &Perl_Mob_GetAllowBeneficial); @@ -3974,8 +3974,8 @@ void perl_register_mob() package.add("GetSpellBonuses", &Perl_Mob_GetSpellBonuses); package.add("GetSpellHPBonuses", &Perl_Mob_GetSpellHPBonuses); package.add("GetSpellIDFromSlot", &Perl_Mob_GetSpellIDFromSlot); - package.add("GetSpellStat", (int(*)(Mob*, uint32, const char*))&Perl_Mob_GetSpellStat); - package.add("GetSpellStat", (int(*)(Mob*, uint32, const char*, uint8))&Perl_Mob_GetSpellStat); + package.add("GetSpellStat", (int(*)(Mob*, int32, const char*))&Perl_Mob_GetSpellStat); + package.add("GetSpellStat", (int(*)(Mob*, int32, const char*, uint8))&Perl_Mob_GetSpellStat); package.add("GetTarget", &Perl_Mob_GetTarget); package.add("GetTexture", &Perl_Mob_GetTexture); package.add("GetTimerDurationMS", &Perl_Mob_GetTimerDurationMS); @@ -4009,7 +4009,7 @@ void perl_register_mob() package.add("HealDamage", (void(*)(Mob*, int64_t))&Perl_Mob_HealDamage); package.add("HealDamage", (void(*)(Mob*, int64_t, Mob*))&Perl_Mob_HealDamage); package.add("InterruptSpell", (void(*)(Mob*))&Perl_Mob_InterruptSpell); - package.add("InterruptSpell", (void(*)(Mob*, uint16))&Perl_Mob_InterruptSpell); + package.add("InterruptSpell", (void(*)(Mob*, int32))&Perl_Mob_InterruptSpell); package.add("IsAIControlled", &Perl_Mob_IsAIControlled); package.add("IsAlwaysAggro", &Perl_Mob_IsAlwaysAggro); package.add("IsAmnesiad", &Perl_Mob_IsAmnesiad); @@ -4074,15 +4074,15 @@ void perl_register_mob() package.add("IsWarriorClass", &Perl_Mob_IsWarriorClass); package.add("IsWisdomCasterClass", &Perl_Mob_IsWisdomCasterClass); package.add("Kill", &Perl_Mob_Kill); - package.add("MakePet", (void(*)(Mob*, uint16, const char*))&Perl_Mob_MakePet); - package.add("MakePet", (void(*)(Mob*, uint16, const char*, const char*))&Perl_Mob_MakePet); - package.add("MakeTempPet", (void(*)(Mob*, uint16))&Perl_Mob_MakeTempPet); - package.add("MakeTempPet", (void(*)(Mob*, uint16, const char*))&Perl_Mob_MakeTempPet); - package.add("MakeTempPet", (void(*)(Mob*, uint16, const char*, uint32))&Perl_Mob_MakeTempPet); - package.add("MakeTempPet", (void(*)(Mob*, uint16, const char*, uint32, Mob*))&Perl_Mob_MakeTempPet); - package.add("MakeTempPet", (void(*)(Mob*, uint16, const char*, uint32, Mob*, bool))&Perl_Mob_MakeTempPet); - package.add("MassGroupBuff", (void(*)(Mob*, Mob*, uint16))&Perl_Mob_MassGroupBuff); - package.add("MassGroupBuff", (void(*)(Mob*, Mob*, uint16, bool))&Perl_Mob_MassGroupBuff); + package.add("MakePet", (void(*)(Mob*, int32, const char*))&Perl_Mob_MakePet); + package.add("MakePet", (void(*)(Mob*, int32, const char*, const char*))&Perl_Mob_MakePet); + package.add("MakeTempPet", (void(*)(Mob*, int32))&Perl_Mob_MakeTempPet); + package.add("MakeTempPet", (void(*)(Mob*, int32, const char*))&Perl_Mob_MakeTempPet); + package.add("MakeTempPet", (void(*)(Mob*, int32, const char*, uint32))&Perl_Mob_MakeTempPet); + package.add("MakeTempPet", (void(*)(Mob*, int32, const char*, uint32, Mob*))&Perl_Mob_MakeTempPet); + package.add("MakeTempPet", (void(*)(Mob*, int32, const char*, uint32, Mob*, bool))&Perl_Mob_MakeTempPet); + package.add("MassGroupBuff", (void(*)(Mob*, Mob*, int32))&Perl_Mob_MassGroupBuff); + package.add("MassGroupBuff", (void(*)(Mob*, Mob*, int32, bool))&Perl_Mob_MassGroupBuff); package.add("Mesmerize", &Perl_Mob_Mesmerize); package.add("Message", &Perl_Mob_Message); package.add("Message_StringID", (void(*)(Mob*, uint32, uint32))&Perl_Mob_Message_StringID); @@ -4248,10 +4248,10 @@ void perl_register_mob() package.add("SpellEffect", (void(*)(Mob*, uint32, uint32, uint32, bool, uint32, bool, Client*))&Perl_Mob_SpellEffect); package.add("SpellEffect", (void(*)(Mob*, uint32, uint32, uint32, bool, uint32, bool, perl::nullable, uint32))&Perl_Mob_SpellEffect); package.add("SpellEffect", (void(*)(Mob*, uint32, uint32, uint32, bool, uint32, bool, perl::nullable, uint32, uint32))&Perl_Mob_SpellEffect); - package.add("SpellFinished", (void(*)(Mob*, uint16))&Perl_Mob_SpellFinished); - package.add("SpellFinished", (void(*)(Mob*, uint16, Mob*))&Perl_Mob_SpellFinished); - package.add("SpellFinished", (void(*)(Mob*, uint16, Mob*, int32))&Perl_Mob_SpellFinished); - package.add("SpellFinished", (void(*)(Mob*, uint16, Mob*, int32, uint16))&Perl_Mob_SpellFinished); + package.add("SpellFinished", (void(*)(Mob*, int32))&Perl_Mob_SpellFinished); + package.add("SpellFinished", (void(*)(Mob*, int32, Mob*))&Perl_Mob_SpellFinished); + package.add("SpellFinished", (void(*)(Mob*, int32, Mob*, int32))&Perl_Mob_SpellFinished); + package.add("SpellFinished", (void(*)(Mob*, int32, Mob*, int32, uint16))&Perl_Mob_SpellFinished); package.add("Spin", &Perl_Mob_Spin); package.add("StartEnrage", &Perl_Mob_StartEnrage); package.add("StopNavigation", &Perl_Mob_StopNavigation); diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index 6057cee1c..1e0df1bcd 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -476,17 +476,17 @@ float Perl_NPC_GetNPCStat(NPC* self, std::string stat) // @categories Stats and return self->GetNPCStat(stat); } -void Perl_NPC_AddSpellToNPCList(NPC* self, int16 priority, uint16_t spell_id, uint32 type, int mana_cost, int recast_delay, int16 resist_adjust) // @categories Spells and Disciplines, Script Utility +void Perl_NPC_AddSpellToNPCList(NPC* self, int16 priority, int32_t spell_id, uint32 type, int mana_cost, int recast_delay, int16 resist_adjust) // @categories Spells and Disciplines, Script Utility { self->AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, 0, 0); } -void Perl_NPC_AddSpellToNPCList(NPC* self, int16 priority, uint16_t spell_id, uint32 type, int mana_cost, int recast_delay, int16 resist_adjust, int8 min_hp, int8 max_hp) // @categories Spells and Disciplines, Script Utility +void Perl_NPC_AddSpellToNPCList(NPC* self, int16 priority, int32_t spell_id, uint32 type, int mana_cost, int recast_delay, int16 resist_adjust, int8 min_hp, int8 max_hp) // @categories Spells and Disciplines, Script Utility { self->AddSpellToNPCList(priority, spell_id, type, mana_cost, recast_delay, resist_adjust, min_hp, max_hp); } -void Perl_NPC_RemoveSpellFromNPCList(NPC* self, uint16_t spell_id) // @categories Spells and Disciplines +void Perl_NPC_RemoveSpellFromNPCList(NPC* self, int32_t spell_id) // @categories Spells and Disciplines { self->RemoveSpellFromNPCList(spell_id); } @@ -556,32 +556,32 @@ void Perl_NPC_MerchantCloseShop(NPC* self) // @categories Script Utility self->MerchantCloseShop(); } -void Perl_NPC_AddMeleeProc(NPC* self, uint16_t spell_id, uint16_t chance) // @categories Script Utility +void Perl_NPC_AddMeleeProc(NPC* self, int32_t spell_id, uint16_t chance) // @categories Script Utility { self->AddProcToWeapon(spell_id, true, chance); } -void Perl_NPC_AddRangedProc(NPC* self, uint16_t spell_id, uint16_t chance) // @categories Script Utility +void Perl_NPC_AddRangedProc(NPC* self, int32_t spell_id, uint16_t chance) // @categories Script Utility { self->AddRangedProc(spell_id, chance); } -void Perl_NPC_AddDefensiveProc(NPC* self, uint16_t spell_id, uint16_t chance) // @categories Script Utility +void Perl_NPC_AddDefensiveProc(NPC* self, int32_t spell_id, uint16_t chance) // @categories Script Utility { self->AddDefensiveProc(spell_id, chance); } -void Perl_NPC_RemoveMeleeProc(NPC* self, uint16_t spell_id) // @categories Script Utility +void Perl_NPC_RemoveMeleeProc(NPC* self, int32_t spell_id) // @categories Script Utility { self->RemoveProcFromWeapon(spell_id, false); } -void Perl_NPC_RemoveRangedProc(NPC* self, uint16_t spell_id) // @categories Script Utility +void Perl_NPC_RemoveRangedProc(NPC* self, int32_t spell_id) // @categories Script Utility { self->RemoveRangedProc(spell_id, false); } -void Perl_NPC_RemoveDefensiveProc(NPC* self, uint16_t spell_id) // @categories Script Utility +void Perl_NPC_RemoveDefensiveProc(NPC* self, int32_t spell_id) // @categories Script Utility { self->RemoveDefensiveProc(spell_id, false); } @@ -732,12 +732,12 @@ void Perl_NPC_SetLDoNTrapType(NPC* self, uint8 trap_type) self->SetLDoNTrapType(trap_type); } -uint16 Perl_NPC_GetLDoNTrapSpellID(NPC* self) +int32 Perl_NPC_GetLDoNTrapSpellID(NPC* self) { return self->GetLDoNTrapSpellID(); } -void Perl_NPC_SetLDoNTrapSpellID(NPC* self, uint16 spell_id) +void Perl_NPC_SetLDoNTrapSpellID(NPC* self, int32 spell_id) { self->SetLDoNTrapSpellID(spell_id); } @@ -920,8 +920,8 @@ void perl_register_npc() package.add("AI_SetRoambox", (void(*)(NPC*, float, float, float, float, float))&Perl_NPC_AI_SetRoambox); package.add("AI_SetRoambox", (void(*)(NPC*, float, float, float, float, float, uint32))&Perl_NPC_AI_SetRoambox); package.add("AI_SetRoambox", (void(*)(NPC*, float, float, float, float, float, uint32, uint32))&Perl_NPC_AI_SetRoambox); - package.add("AddAISpell", (void(*)(NPC*, int16, uint16, uint32, int, int, int16))&Perl_NPC_AddSpellToNPCList); - package.add("AddAISpell", (void(*)(NPC*, int16, uint16, uint32, int, int, int16, int8, int8))&Perl_NPC_AddSpellToNPCList); + package.add("AddAISpell", (void(*)(NPC*, int16, int32, uint32, int, int, int16))&Perl_NPC_AddSpellToNPCList); + package.add("AddAISpell", (void(*)(NPC*, int16, int32, uint32, int, int, int16, int8, int8))&Perl_NPC_AddSpellToNPCList); package.add("AddAISpellEffect", &Perl_NPC_AddAISpellEffect); package.add("AddCash", &Perl_NPC_AddLootCash); package.add("AddDefensiveProc", &Perl_NPC_AddDefensiveProc); diff --git a/zone/perl_player_corpse.cpp b/zone/perl_player_corpse.cpp index 0c349a558..836ddbf62 100644 --- a/zone/perl_player_corpse.cpp +++ b/zone/perl_player_corpse.cpp @@ -142,7 +142,7 @@ void Perl_Corpse_Summon(Corpse* self, Client* client, bool is_spell) // @categor self->Summon(client, is_spell, true); } -void Perl_Corpse_CastRezz(Corpse* self, uint16_t spell_id, Mob* caster) // @categories Spells and Disciplines, Corpse +void Perl_Corpse_CastRezz(Corpse* self, int32_t spell_id, Mob* caster) // @categories Spells and Disciplines, Corpse { self->CastRezz(spell_id, caster); } diff --git a/zone/perl_raids.cpp b/zone/perl_raids.cpp index ce13d31a2..76354ef4c 100644 --- a/zone/perl_raids.cpp +++ b/zone/perl_raids.cpp @@ -34,7 +34,7 @@ bool Perl_Raid_IsRaidMember(Raid* self, Client* c) // @categories Raid return self->IsRaidMember(c); } -void Perl_Raid_CastGroupSpell(Raid* self, Mob* caster, uint16 spell_id, uint32 group_id) // @categories Group, Raid +void Perl_Raid_CastGroupSpell(Raid* self, Mob* caster, int32 spell_id, uint32 group_id) // @categories Group, Raid { self->CastGroupSpell(caster, spell_id, group_id); } diff --git a/zone/perl_stat_bonuses.cpp b/zone/perl_stat_bonuses.cpp index d08203523..14bb9d47a 100644 --- a/zone/perl_stat_bonuses.cpp +++ b/zone/perl_stat_bonuses.cpp @@ -268,7 +268,7 @@ int32 Perl_StatBonuses_GetHeroicCorrup(StatBonuses* self) return self->HeroicCorrup; } -uint16 Perl_StatBonuses_GetDamageShieldSpellID(StatBonuses* self) +int32 Perl_StatBonuses_GetDamageShieldSpellID(StatBonuses* self) { return self->DamageShieldSpellID; } @@ -298,7 +298,7 @@ int Perl_StatBonuses_GetReverseDamageShield(StatBonuses* self) return self->ReverseDamageShield; } -uint16 Perl_StatBonuses_GetReverseDamageShieldSpellID(StatBonuses* self) +int32 Perl_StatBonuses_GetReverseDamageShieldSpellID(StatBonuses* self) { return self->ReverseDamageShieldSpellID; } diff --git a/zone/perl_zone.cpp b/zone/perl_zone.cpp index 0175554a0..a08bd6289 100644 --- a/zone/perl_zone.cpp +++ b/zone/perl_zone.cpp @@ -477,7 +477,7 @@ bool Perl_Zone_IsSpecialBindLocation(Zone* self, float x, float y, float z, floa return self->IsSpecialBindLocation(glm::vec4(x, y, z, heading)); } -bool Perl_Zone_IsSpellBlocked(Zone* self, uint32 spell_id, float x, float y, float z) +bool Perl_Zone_IsSpellBlocked(Zone* self, int32 spell_id, float x, float y, float z) { return self->IsSpellBlocked(spell_id, glm::vec3(x, y, z)); } diff --git a/zone/pets.cpp b/zone/pets.cpp index 029e69b33..84c29f75f 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -68,7 +68,7 @@ void GetRandPetName(char *name) strn0cpy(name, temp.c_str(), 64); } -void Mob::MakePet(uint16 spell_id, const char* pettype, const char *petname) { +void Mob::MakePet(int32 spell_id, const char* pettype, const char *petname) { // petpower of -1 is used to get the petpower based on whichever focus is currently // equipped. This should replicate the old functionality for the most part. MakePoweredPet(spell_id, pettype, -1, petname); @@ -78,7 +78,7 @@ void Mob::MakePet(uint16 spell_id, const char* pettype, const char *petname) { // making it possible for petpower to be retained without the focus item having to // stay equipped when the character zones. petpower of -1 means that the currently equipped petfocus // of a client is searched for and used instead. -void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, +void Mob::MakePoweredPet(int32 spell_id, const char* pettype, int16 petpower, const char *petname, float in_size) { // Sanity and early out checking first. if(HasPet() || pettype == nullptr) @@ -345,7 +345,7 @@ void NPC::TryDepopTargetLockedPets(Mob* current_target) { /* This is why the pets ghost - pets were being spawned too far away from its npc owner and some into walls or objects (+10), this sometimes creates the "ghost" effect. I changed to +2 (as close as I could get while it still looked good). I also noticed this can happen if an NPC is spawned on the same spot of another or in a related bad spot.*/ -Pet::Pet(NPCType *type_data, Mob *owner, uint8 pet_type, uint16 spell_id, int16 power) +Pet::Pet(NPCType *type_data, Mob *owner, uint8 pet_type, int32 spell_id, int16 power) : NPC(type_data, 0, owner->GetPosition() + glm::vec4(2.0f, 2.0f, 0.0f, 0.0f), GravityBehavior::Water) { GiveNPCTypeData(type_data); @@ -553,7 +553,7 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) { case SpellEffect::NegateAttacks: case SpellEffect::Illusion: buffs[j1].spellid = SPELL_UNKNOWN; - pet_buffs[j1].spellid = SPELLBOOK_UNKNOWN; + pet_buffs[j1].spellid = SPELL_UNKNOWN; pet_buffs[j1].effect_type = 0; pet_buffs[j1].level = 0; pet_buffs[j1].duration = 0; @@ -649,7 +649,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { return true; } -bool Pet::CheckSpellLevelRestriction(Mob *caster, uint16 spell_id) +bool Pet::CheckSpellLevelRestriction(Mob *caster, int32 spell_id) { auto owner = GetOwner(); if (owner) diff --git a/zone/pets.h b/zone/pets.h index 9c9d088b4..c1a30beec 100644 --- a/zone/pets.h +++ b/zone/pets.h @@ -22,6 +22,6 @@ struct NPCType; class Pet : public NPC { public: - Pet(NPCType *type_data, Mob *owner, uint8 pet_type, uint16 spell_id, int16 power); - virtual bool CheckSpellLevelRestriction(Mob *caster, uint16 spell_id); + Pet(NPCType *type_data, Mob *owner, uint8 pet_type, int32 spell_id, int16 power); + virtual bool CheckSpellLevelRestriction(Mob *caster, int32 spell_id); }; diff --git a/zone/quest_interface.h b/zone/quest_interface.h index cab920b24..9d9568b70 100644 --- a/zone/quest_interface.h +++ b/zone/quest_interface.h @@ -94,7 +94,7 @@ public: QuestEventID event_id, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector* extra_pointers @@ -204,7 +204,7 @@ public: return false; } - virtual bool SpellHasQuestSub(uint32 spell_id, QuestEventID event_id) + virtual bool SpellHasQuestSub(int32 spell_id, QuestEventID event_id) { return false; } @@ -259,7 +259,7 @@ public: virtual void LoadPlayerScript(std::string filename) { } virtual void LoadGlobalPlayerScript(std::string filename) { } virtual void LoadItemScript(std::string filename, EQ::ItemInstance* inst) { } - virtual void LoadSpellScript(std::string filename, uint32 spell_id) { } + virtual void LoadSpellScript(std::string filename, int32 spell_id) { } virtual void LoadEncounterScript(std::string filename, std::string encounter_name) { } virtual void LoadBotScript(std::string filename) { } virtual void LoadGlobalBotScript(std::string filename) { } @@ -308,7 +308,7 @@ public: QuestEventID event_id, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector* extra_pointers diff --git a/zone/quest_parser_collection.cpp b/zone/quest_parser_collection.cpp index 05680bb47..df4861780 100644 --- a/zone/quest_parser_collection.cpp +++ b/zone/quest_parser_collection.cpp @@ -238,13 +238,13 @@ bool QuestParserCollection::PlayerHasQuestSubGlobal(QuestEventID event_id) return false; } -bool QuestParserCollection::SpellHasEncounterSub(uint32 spell_id, QuestEventID event_id) +bool QuestParserCollection::SpellHasEncounterSub(int32 spell_id, QuestEventID event_id) { return HasEncounterSub(event_id, fmt::format("spell_{}", spell_id)) || HasEncounterSub(event_id, "spell_" + ENCOUNTER_NO_ENTITY_ID); } -bool QuestParserCollection::SpellHasQuestSub(uint32 spell_id, QuestEventID event_id) +bool QuestParserCollection::SpellHasQuestSub(int32 spell_id, QuestEventID event_id) { if (SpellHasEncounterSub(spell_id, event_id)) { return true; @@ -716,7 +716,7 @@ int QuestParserCollection::EventSpell( QuestEventID event_id, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector* extra_pointers @@ -1229,7 +1229,7 @@ QuestInterface* QuestParserCollection::GetQIByGlobalPlayerQuest(std::string& fil return nullptr; } -QuestInterface* QuestParserCollection::GetQIBySpellQuest(uint32 spell_id, std::string& filename) +QuestInterface* QuestParserCollection::GetQIBySpellQuest(int32 spell_id, std::string& filename) { if (!zone) { return nullptr; @@ -1703,7 +1703,7 @@ int QuestParserCollection::DispatchEventSpell( QuestEventID event_id, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector* extra_pointers diff --git a/zone/quest_parser_collection.h b/zone/quest_parser_collection.h index cd02ee994..a1ef5da5b 100644 --- a/zone/quest_parser_collection.h +++ b/zone/quest_parser_collection.h @@ -63,7 +63,7 @@ public: bool HasQuestSub(uint32 npc_id, QuestEventID event_id); bool PlayerHasQuestSub(QuestEventID event_id); - bool SpellHasQuestSub(uint32 spell_id, QuestEventID event_id); + bool SpellHasQuestSub(int32 spell_id, QuestEventID event_id); bool ItemHasQuestSub(EQ::ItemInstance* inst, QuestEventID event_id); bool BotHasQuestSub(QuestEventID event_id); bool MercHasQuestSub(QuestEventID event_id); @@ -100,7 +100,7 @@ public: QuestEventID event_id, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector* extra_pointers = nullptr @@ -206,7 +206,7 @@ private: bool PlayerHasQuestSubLocal(QuestEventID event_id); bool PlayerHasQuestSubGlobal(QuestEventID event_id); bool PlayerHasEncounterSub(QuestEventID event_id); - bool SpellHasEncounterSub(uint32 spell_id, QuestEventID event_id); + bool SpellHasEncounterSub(int32 spell_id, QuestEventID event_id); bool ItemHasEncounterSub(EQ::ItemInstance* inst, QuestEventID event_id); bool HasEncounterSub(QuestEventID event_id, const std::string& package_name); bool BotHasQuestSubLocal(QuestEventID event_id); @@ -306,7 +306,7 @@ private: QuestInterface* GetQIByGlobalNPCQuest(std::string& filename); QuestInterface* GetQIByPlayerQuest(std::string& filename); QuestInterface* GetQIByGlobalPlayerQuest(std::string& filename); - QuestInterface* GetQIBySpellQuest(uint32 spell_id, std::string& filename); + QuestInterface* GetQIBySpellQuest(int32 spell_id, std::string& filename); QuestInterface* GetQIByItemQuest(std::string item_script, std::string& filename); QuestInterface* GetQIByEncounterQuest(std::string encounter_name, std::string& filename); QuestInterface* GetQIByBotQuest(std::string& filename); @@ -347,7 +347,7 @@ private: QuestEventID event_id, Mob* mob, Client* client, - uint32 spell_id, + int32 spell_id, std::string data, uint32 extra_data, std::vector* extra_pointers diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 92de69567..988bf8b3d 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -397,7 +397,7 @@ void QuestManager::incstat(int stat, int value) { initiator->IncStats(stat, value); } -void QuestManager::castspell(uint16 spell_id, uint16 target_id) +void QuestManager::castspell(int32 spell_id, uint16 target_id) { QuestManagerCurrentQuestVars(); @@ -416,7 +416,7 @@ void QuestManager::castspell(uint16 spell_id, uint16 target_id) } } -void QuestManager::selfcast(uint16 spell_id) +void QuestManager::selfcast(int32 spell_id) { QuestManagerCurrentQuestVars(); @@ -1242,7 +1242,7 @@ std::string QuestManager::getracename(uint16 race_id) { return GetRaceIDName(race_id); } -std::string QuestManager::getspellname(uint32 spell_id) { +std::string QuestManager::getspellname(int32 spell_id) { if (!IsValidSpell(spell_id)) { return "INVALID SPELL ID IN GETSPELLNAME"; } @@ -4191,7 +4191,7 @@ const int QuestManager::getitemstat(uint32 item_id, std::string stat_identifier) return EQ::InventoryProfile::GetItemStatValue(item_id, stat_identifier); } -int QuestManager::getspellstat(uint32 spell_id, std::string stat_identifier, uint8 slot) { +int QuestManager::getspellstat(int32 spell_id, std::string stat_identifier, uint8 slot) { QuestManagerCurrentQuestVars(); return GetSpellStatValue(spell_id, stat_identifier.c_str(), slot); } @@ -4294,7 +4294,7 @@ void QuestManager::CrossZoneSignal(uint8 update_type, int update_identifier, int safe_delete(pack); } -void QuestManager::CrossZoneSpell(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 spell_id, const char* client_name) { +void QuestManager::CrossZoneSpell(uint8 update_type, uint8 update_subtype, int update_identifier, int32 spell_id, const char* client_name) { auto pack = new ServerPacket(ServerOP_CZSpell, sizeof(CZSpell_Struct)); CZSpell_Struct* CZS = (CZSpell_Struct*)pack->pBuffer; CZS->update_type = update_type; @@ -4404,7 +4404,7 @@ void QuestManager::WorldWideSignal(uint8 update_type, int signal_id, uint8 min_s safe_delete(pack); } -void QuestManager::WorldWideSpell(uint8 update_type, uint32 spell_id, uint8 min_status, uint8 max_status) { +void QuestManager::WorldWideSpell(uint8 update_type, int32 spell_id, uint8 min_status, uint8 max_status) { auto pack = new ServerPacket(ServerOP_WWSpell, sizeof(WWSpell_Struct)); WWSpell_Struct* WWS = (WWSpell_Struct*)pack->pBuffer; WWS->update_type = update_type; @@ -4429,7 +4429,7 @@ void QuestManager::WorldWideTaskUpdate(uint8 update_type, uint32 task_identifier safe_delete(pack); } -const SPDat_Spell_Struct* QuestManager::getspell(uint32 spell_id) { +const SPDat_Spell_Struct* QuestManager::getspell(int32 spell_id) { if (spells[spell_id].id) { return &spells[spell_id]; } diff --git a/zone/questmgr.h b/zone/questmgr.h index 35be7b976..87962a2fe 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -77,8 +77,8 @@ public: void disable_spawn2(uint32 spawn2_id); void setstat(int stat, int value); void incstat(int stat, int value); - void castspell(uint16 spell_id, uint16 target_id); - void selfcast(uint16 spell_id); + void castspell(int32 spell_id, uint16 target_id); + void selfcast(int32 spell_id); void addloot(int item_id, int charges = 0, bool equipitem = true, int aug1 = 0, int aug2 = 0, int aug3 = 0, int aug4 = 0, int aug5 = 0, int aug6 = 0); void Zone(const char *zone_name); void ZoneGroup(const char *zone_name); @@ -118,7 +118,7 @@ public: void traindisc(uint32 discipline_tome_item_id); bool isdisctome(uint32 item_id); std::string getracename(uint16 race_id); - std::string getspellname(uint32 spell_id); + std::string getspellname(int32 spell_id); std::string getskillname(int skill_id); std::string getldonthemename(uint32 theme_id); std::string getfactionname(int faction_id); @@ -322,7 +322,7 @@ public: void CrossZoneMove(const CZMove_Struct& m); void CrossZoneSetEntityVariable(uint8 update_type, int update_identifier, const char* variable_name, const char* variable_value, const char* client_name = ""); void CrossZoneSignal(uint8 update_type, int update_identifier, int signal_id, const char* client_name = ""); - void CrossZoneSpell(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 spell_id, const char* client_name = ""); + void CrossZoneSpell(uint8 update_type, uint8 update_subtype, int update_identifier, int32 spell_id, const char* client_name = ""); void CrossZoneTaskUpdate(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 task_identifier, int task_subidentifier = -1, int update_count = 1, bool enforce_level_requirement = false, const char* client_name = ""); void WorldWideDialogueWindow(const char* message, uint8 min_status = AccountStatus::Player, uint8 max_status = AccountStatus::Player); void WorldWideLDoNUpdate(uint8 update_type, uint32 theme_id, int points = 1, uint8 min_status = AccountStatus::Player, uint8 max_status = AccountStatus::Player); @@ -331,7 +331,7 @@ public: void WorldWideMove(uint8 update_type, const char* zone_short_name, uint16 instance_id = 0, uint8 min_status = AccountStatus::Player, uint8 max_status = AccountStatus::Player); void WorldWideSetEntityVariable(uint8 update_type, const char* variable_name, const char* variable_value, uint8 min_status = AccountStatus::Player, uint8 max_status = AccountStatus::Player); void WorldWideSignal(uint8 update_type, int signal_id, uint8 min_status = AccountStatus::Player, uint8 max_status = AccountStatus::Player); - void WorldWideSpell(uint8 update_type, uint32 spell_id, uint8 min_status = AccountStatus::Player, uint8 max_status = AccountStatus::Player); + void WorldWideSpell(uint8 update_type, int32 spell_id, uint8 min_status = AccountStatus::Player, uint8 max_status = AccountStatus::Player); void WorldWideTaskUpdate(uint8 update_type, uint32 task_identifier, int task_subidentifier = -1, int update_count = 1, bool enforce_level_requirement = false, uint8 min_status = AccountStatus::Player, uint8 max_status = AccountStatus::Player); bool EnableRecipe(uint32 recipe_id); bool DisableRecipe(uint32 recipe_id); @@ -346,8 +346,8 @@ public: std::string getdeityname(uint32 deity_id); std::string getinventoryslotname(int16 slot_id); const int getitemstat(uint32 item_id, std::string stat_identifier); - int getspellstat(uint32 spell_id, std::string stat_identifier, uint8 slot = 0); - const SPDat_Spell_Struct *getspell(uint32 spell_id); + int getspellstat(int32 spell_id, std::string stat_identifier, uint8 slot = 0); + const SPDat_Spell_Struct *getspell(int32 spell_id); std::string getenvironmentaldamagename(uint8 damage_type); void TrackNPC(uint32 entity_id); int GetRecipeMadeCount(uint32 recipe_id); diff --git a/zone/raids.cpp b/zone/raids.cpp index eb8acd73c..190cea476 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -655,7 +655,7 @@ Client *Raid::GetClientByIndex(uint16 index) return members[index].member; } -void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) +void Raid::CastGroupSpell(Mob* caster, int32 spellid, uint32 gid) { float range, distance; diff --git a/zone/raids.h b/zone/raids.h index bf30f7ae6..393f8512e 100644 --- a/zone/raids.h +++ b/zone/raids.h @@ -163,7 +163,7 @@ public: //Actual Implementation Stuff void RaidMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); - void CastGroupSpell(Mob* caster,uint16 spellid, uint32 gid); + void CastGroupSpell(Mob* caster,int32 spellid, uint32 gid); void SplitExp(ExpSource exp_source, const uint64 exp, Mob* other); uint32 GetTotalRaidDamage(Mob* other); void BalanceHP(int32 penalty, uint32 group_id, float range = 0, Mob* caster = nullptr, int32 limit = 0); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 4930f1154..ae2163c31 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -33,6 +33,8 @@ #include +#include "client_version.h" + extern Zone* zone; extern volatile bool is_zone_loaded; @@ -41,7 +43,7 @@ extern WorldServer worldserver; // the spell can still fail here, if the buff can't stack // in this case false will be returned, true otherwise -bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_override, int reflect_effectiveness, int32 duration_override, bool disable_buff_overwrite) +bool Mob::SpellEffect(Mob* caster, int32 spell_id, float partial, int level_override, int reflect_effectiveness, int32 duration_override, bool disable_buff_overwrite) { int caster_level, buffslot, effect, effect_value, i; EQ::ItemInstance *SummonedItem=nullptr; @@ -150,11 +152,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (spells[spell_id].endurance_upkeep > 0) SetEndurUpkeep(true); - if (IsClient() && CastToClient()->ClientVersionBit() & EQ::versions::maskUFAndLater) - { - EQApplicationPacket *outapp = MakeBuffsPacket(false); - CastToClient()->FastQueuePacket(&outapp); - } + ClientPatch::SendFullBuffRefresh(this); } if (IsClient()) { @@ -813,9 +811,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove // This was done in AddBuff, but we were not a pet yet, so // the target windows didn't get updated. - EQApplicationPacket *outapp = MakeBuffsPacket(); - entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQ::versions::maskSoDAndLater); - safe_delete(outapp); + ClientPatch::SendFullBuffRefresh(this); if(caster->IsClient()){ auto app = new EQApplicationPacket(OP_Charm, sizeof(Charm_Struct)); @@ -825,7 +821,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove ps->command = 1; entity_list.QueueClients(this, app); safe_delete(app); - SendPetBuffsToClient(); + ClientPatch::SendFullBuffRefresh(this); SendAppearancePacket(AppearanceType::Pet, caster->GetID(), true, true); } @@ -1614,7 +1610,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove GetPetType() != PetType::Charmed ) { - uint16 pet_spellid = CastToNPC()->GetPetSpellID(); + int32 pet_spellid = CastToNPC()->GetPetSpellID(); uint16 pet_ActSpellCost = caster->GetActSpellCost(pet_spellid, spells[pet_spellid].mana); int16 ImprovedReclaimMod = caster->spellbonuses.ImprovedReclaimEnergy + caster->itembonuses.ImprovedReclaimEnergy + @@ -3024,7 +3020,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove break; if (caster && zone->random.Roll(spells[spell_id].base_value[i])) { - uint32 best_spell_id = caster->CastToClient()->GetHighestScribedSpellinSpellGroup(spells[spell_id].limit_value[i]); + int32 best_spell_id = caster->CastToClient()->GetHighestScribedSpellinSpellGroup(spells[spell_id].limit_value[i]); if (IsValidSpell(best_spell_id)) caster->SpellFinished(best_spell_id, this, EQ::spells::CastingSlot::Item, 0, -1, spells[best_spell_id].resist_difficulty); @@ -3441,7 +3437,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove return true; } -int64 Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, uint32 instrument_mod, Mob *caster, +int64 Mob::CalcSpellEffectValue(int32 spell_id, int effect_id, int caster_level, uint32 instrument_mod, Mob *caster, int ticsremaining, uint16 caster_id) { if (!IsValidSpell(spell_id) || effect_id < 0 || effect_id >= EFFECT_COUNT) @@ -3510,7 +3506,7 @@ int64 Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level } // generic formula calculations -int64 Mob::CalcSpellEffectValue_formula(uint32 formula, int64 base_value, int64 max_value, int caster_level, uint16 spell_id, int ticsremaining) +int64 Mob::CalcSpellEffectValue_formula(uint32 formula, int64 base_value, int64 max_value, int caster_level, int32 spell_id, int ticsremaining) { #ifdef LUA_EQEMU int64 lua_ret = 0; @@ -3868,19 +3864,15 @@ void Mob::BuffProcess() } } - if(IsClient()) - { - if(buffs[buffs_i].UpdateClient == true) - { - CastToClient()->SendBuffDurationPacket(buffs[buffs_i], buffs_i); - // Hack to get UF to play nicer, RoF seems fine without it - if (CastToClient()->ClientVersion() == EQ::versions::ClientVersion::UF && buffs[buffs_i].hit_number > 0) - CastToClient()->SendBuffNumHitPacket(buffs[buffs_i], buffs_i); - buffs[buffs_i].UpdateClient = false; - } + // this is for older clients. Newer clients will simply discard this packet + if (IsClient() && buffs[buffs_i].UpdateClient == true) { + ClientPatch::SendSingleBuffChange(this, buffs[buffs_i], buffs_i); + buffs[buffs_i].UpdateClient = false; } } } + + ClientPatch::SendFullBuffRefresh(this); } void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) @@ -4251,9 +4243,6 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if(!IsValidSpell(buffs[slot].spellid)) return; - if (IsClient() && !CastToClient()->IsDead()) - CastToClient()->MakeBuffFadePacket(buffs[slot].spellid, slot); - LogSpells("Fading buff [{}] from slot [{}]", buffs[slot].spellid, slot); const auto has_fade_event = parse->SpellHasQuestSub(buffs[slot].spellid, EVENT_SPELL_FADE); @@ -4431,13 +4420,11 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) owner->SetPet(0); } - // Any client that has a previous charmed pet targetted shouldo + // Any client that has a previous charmed pet targeted should // no longer see the buffs on the old pet. // QueueClientsByTarget preserves GM and leadership cases. - EQApplicationPacket *outapp = MakeBuffsPacket(true, true); - - entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQ::versions::maskSoDAndLater, true, true); + ClientPatch::SendFullBuffRefresh(this, true); if (IsAIControlled()) { @@ -4660,36 +4647,13 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if (spells[buffs[slot].spellid].nimbus_effect > 0) RemoveNimbusEffect(spells[buffs[slot].spellid].nimbus_effect); + // the client expects remaining duration to be 0 in the single packet change + buffs[slot].ticsremaining = 0; + ClientPatch::SendSingleBuffChange(this, buffs[slot], slot, true); + + // don't set the spell to unknown until after the server has sent the single remove packets buffs[slot].spellid = SPELL_UNKNOWN; - if(IsPet() && GetOwner() && GetOwner()->IsClient()) { - SendPetBuffsToClient(); - } - if((IsClient() && !CastToClient()->GetPVP()) || - (IsPet() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()) || - (IsBot() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()) || - (IsMerc() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP())) - { - EQApplicationPacket *outapp = MakeBuffsPacket(); - - entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQ::versions::maskSoDAndLater); - if(IsClient() && GetTarget() == this) { - CastToClient()->QueuePacket(outapp); - } - - safe_delete(outapp); - } - - if (IsNPC()) { - EQApplicationPacket *outapp = MakeBuffsPacket(); - entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQ::versions::maskSoDAndLater, true); - safe_delete(outapp); - } - - if (IsClient() && CastToClient()->ClientVersionBit() & EQ::versions::maskUFAndLater) - { - EQApplicationPacket *outapp = MakeBuffsPacket(false); - CastToClient()->FastQueuePacket(&outapp); - } + ClientPatch::SendFullBuffRefresh(this); // we will eventually call CalcBonuses() even if we skip it right here, so should correct itself if we still have them degenerating_effects = false; @@ -4697,7 +4661,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) CalcBonuses(); } -int64 Mob::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) +int64 Mob::CalcAAFocus(focusType type, const AA::Rank &rank, int32 spell_id) { const SPDat_Spell_Struct &spell = spells[spell_id]; @@ -5450,7 +5414,7 @@ int64 Mob::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) //given an item/spell's focus ID and the spell being cast, determine the focus ammount, if any //assumes that spell_id is not a bard spell and that both ids are valid spell ids -int64 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus, uint16 casterid, Mob *caster) +int64 Mob::CalcFocusEffect(focusType type, uint16 focus_id, int32 spell_id, bool best_focus, uint16 casterid, Mob *caster) { /* 'this' is always the caster of the spell_id, most foci check for effects on the caster, however some check for effects on the target. @@ -5472,7 +5436,7 @@ int64 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo int lvlModifier = 100; int spell_level = 0; int lvldiff = 0; - uint32 Caston_spell_id = 0; + int32 Caston_spell_id = 0; int index_id = -1; uint32 focus_reuse_time = 0; //If this is set and all limits pass, start timer at end of script. @@ -6266,7 +6230,7 @@ int64 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return (value * lvlModifier / 100); } -void Mob::TryTriggerOnCastFocusEffect(focusType type, uint16 spell_id) +void Mob::TryTriggerOnCastFocusEffect(focusType type, int32 spell_id) { if (IsBardSong(spell_id)) { return; @@ -6367,7 +6331,7 @@ void Mob::TryTriggerOnCastFocusEffect(focusType type, uint16 spell_id) } } -bool Mob::TryTriggerOnCastProc(uint16 focusspellid, uint16 spell_id, uint16 proc_spellid) +bool Mob::TryTriggerOnCastProc(int32 focusspellid, int32 spell_id, int32 proc_spellid) { // We confirm spell_id and focuspellid are valid before passing into this. if (IsValidSpell(proc_spellid) && spell_id != focusspellid && spell_id != proc_spellid) { @@ -6385,12 +6349,12 @@ bool Mob::TryTriggerOnCastProc(uint16 focusspellid, uint16 spell_id, uint16 proc return false; } -uint16 Mob::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { +int32 Mob::GetSympatheticFocusEffect(focusType type, int32 spell_id) { if (IsBardSong(spell_id)) return 0; - uint16 proc_spellid = 0; + int32 proc_spellid = 0; float ProcChance = 0.0f; std::vector SympatheticProcList; @@ -6444,7 +6408,7 @@ uint16 Mob::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { //Spell Focus if (spellbonuses.FocusEffects[type]){ - uint16 focusspellid = 0; + int32 focusspellid = 0; int buff_max = GetMaxTotalSlots(); for (int buff_slot = 0; buff_slot < buff_max; buff_slot++) { @@ -6508,7 +6472,7 @@ uint16 Mob::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { return 0; } -int64 Mob::GetFocusEffect(focusType type, uint16 spell_id, Mob *caster, bool from_buff_tic) +int64 Mob::GetFocusEffect(focusType type, int32 spell_id, Mob *caster, bool from_buff_tic) { if (IsBardSong(spell_id) && type != focusFcBaseEffects && type != focusSpellDuration && type != focusReduceRecastTime) { return 0; @@ -6882,7 +6846,7 @@ int64 Mob::GetFocusEffect(focusType type, uint16 spell_id, Mob *caster, bool fro return realTotal + realTotal2 + realTotal3 + worneffect_bonus; } -int64 NPC::GetFocusEffect(focusType type, uint16 spell_id, Mob* caster, bool from_buff_tic) { +int64 NPC::GetFocusEffect(focusType type, int32 spell_id, Mob* caster, bool from_buff_tic) { int64 realTotal = 0; int64 realTotal2 = 0; @@ -7005,7 +6969,7 @@ int64 NPC::GetFocusEffect(focusType type, uint16 spell_id, Mob* caster, bool fro return realTotal + realTotal2; } -void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) +void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, int32 spell_id) { /* Field 175 = numhits type @@ -7047,7 +7011,7 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) if (!TryFadeEffect(d)) BuffFadeBySlot(d, true); } else if (IsClient()) { // still have numhits and client, update - CastToClient()->SendBuffNumHitPacket(buffs[d], d); + ClientPatch::SendSingleBuffChange(this, buffs[d], d); } } } @@ -7062,7 +7026,7 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) if (!TryFadeEffect(buff_slot)) BuffFadeBySlot(buff_slot , true); } else if (IsClient()) { // still have numhits and client, update - CastToClient()->SendBuffNumHitPacket(buffs[buff_slot], buff_slot); + ClientPatch::SendSingleBuffChange(this, buffs[buff_slot], buff_slot); } } } @@ -7080,7 +7044,7 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) if (!TryFadeEffect(d)) BuffFadeBySlot(d, true); } else if (IsClient()) { // still have numhits and client, update - CastToClient()->SendBuffNumHitPacket(buffs[d], d); + ClientPatch::SendSingleBuffChange(this, buffs[d], d); } } } @@ -7108,7 +7072,7 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) } //for some stupid reason SK procs return theirs one base off... -uint16 Mob::GetProcID(uint16 spell_id, uint8 effect_index) +int32 Mob::GetProcID(int32 spell_id, uint8 effect_index) { if (!RuleB(Spells, SHDProcIDOffByOne)) // UF+ spell files return spells[spell_id].base_value[effect_index]; @@ -7300,7 +7264,7 @@ bool Mob::AffectedBySpellExcludingSlot(int slot, int effect) return false; } -float Mob::GetSympatheticProcChances(uint16 spell_id, int16 ProcRateMod, int32 ItemProcRate) { +float Mob::GetSympatheticProcChances(int32 spell_id, int16 ProcRateMod, int32 ItemProcRate) { float ProcChance = 0.0f; int32 total_cast_time = 0; @@ -7326,7 +7290,7 @@ float Mob::GetSympatheticProcChances(uint16 spell_id, int16 ProcRateMod, int32 I return ProcChance; } -int16 Mob::GetSympatheticSpellProcRate(uint16 spell_id) +int16 Mob::GetSympatheticSpellProcRate(int32 spell_id) { for (int i = 0; i < EFFECT_COUNT; i++){ if (spells[spell_id].effect_id[i] == SpellEffect::SympatheticProc) @@ -7336,7 +7300,7 @@ int16 Mob::GetSympatheticSpellProcRate(uint16 spell_id) return 0; } -uint16 Mob::GetSympatheticSpellProcID(uint16 spell_id) +int32 Mob::GetSympatheticSpellProcID(int32 spell_id) { for (int i = 0; i < EFFECT_COUNT; i++){ if (spells[spell_id].effect_id[i] == SpellEffect::SympatheticProc) @@ -7369,7 +7333,7 @@ int64 Mob::GetFcDamageAmtIncoming(Mob *caster, int32 spell_id, bool from_buff_ti return dmg; } -int64 Mob::GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spell_id) { +int64 Mob::GetFocusIncoming(focusType type, int effect, Mob *caster, int32 spell_id) { //**** This can be removed when bot healing focus code is updated **** @@ -7441,7 +7405,7 @@ bool Mob::PassLimitClass(uint32 Classes_, uint16 Class_) return false; } -void Mob::DispelMagic(Mob* caster, uint16 spell_id, int effect_value) +void Mob::DispelMagic(Mob* caster, int32 spell_id, int effect_value) { for (int slot = 0; slot < GetMaxTotalSlots(); slot++) { if ( @@ -7457,7 +7421,7 @@ void Mob::DispelMagic(Mob* caster, uint16 spell_id, int effect_value) } } -bool Mob::TrySpellEffectResist(uint16 spell_id) +bool Mob::TrySpellEffectResist(int32 spell_id) { /* SEResist variable @@ -9614,7 +9578,7 @@ void Mob::SendCastRestrictionMessage(int requirement_id, bool target_requirement } } -bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed) { +bool Mob::TrySpellProjectile(Mob* spell_target, int32 spell_id, float speed) { /*For mage 'Bolt' line and other various spells. -This is mostly accurate for how the modern clients handle this effect. @@ -9722,7 +9686,7 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed) { return true; } -void Mob::ResourceTap(int64 damage, uint16 spellid) +void Mob::ResourceTap(int64 damage, int32 spellid) { //'this' = caster if (!IsValidSpell(spellid)) @@ -9774,7 +9738,7 @@ void Mob::TryTriggerThreshHold(int64 damage, int effect_id, Mob* attacker){ if (spells[buffs[slot].spellid].effect_id[i] == effect_id){ - uint16 spell_id = spells[buffs[slot].spellid].base_value[i]; + int32 spell_id = spells[buffs[slot].spellid].base_value[i]; if (damage > spells[buffs[slot].spellid].limit_value[i]){ @@ -9842,7 +9806,7 @@ void Mob::CastSpellOnLand(Mob* caster, int32 spell_id) } } -void Mob::CalcSpellPowerDistanceMod(uint16 spell_id, float range, Mob* caster) +void Mob::CalcSpellPowerDistanceMod(int32 spell_id, float range, Mob* caster) { if (IsDistanceModifierSpell(spell_id)){ @@ -10097,7 +10061,7 @@ int Mob::GetFocusRandomEffectivenessValue(int focus_base, int focus_base2, bool return zone->random.Int(focus_base, focus_base2); } -bool Mob::NegateSpellEffect(uint16 spell_id, int effect_id) +bool Mob::NegateSpellEffect(int32 spell_id, int effect_id) { /* This works for most effects, anything handled purely by the client will bypass this (ie Gate, Shadowstep) diff --git a/zone/spells.cpp b/zone/spells.cpp index 888b86406..2471ae602 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -145,7 +145,7 @@ void NPC::SpellProcess() // the rule is you can cast one triggered (usually timed) spell at a time // but things like SpellFinished() can run concurrent with a triggered cast // to allow procs to work -bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, +bool Mob::CastSpell(int32 spell_id, uint16 target_id, CastingSlot slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 timer, uint32 timer_duration, int16 *resist_adjust, uint32 aa_id) @@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, // this is the 2nd phase of CastSpell, broken up like this to make it easier // to repeat a spell for bard songs // -bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, +bool Mob::DoCastSpell(int32 spell_id, uint16 target_id, CastingSlot slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 timer, uint32 timer_duration, int16 resist_adjust, uint32 aa_id) @@ -339,12 +339,12 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, Links::FormatSpellLink(spell_link, Links::MAX_LINK_SIZE, spell_id); if (IsClient()) - Message::MessageString(CastToClient(), Chat::SpellFailure, fizzle_msg, spell_link); + ClientPatch::SendMessageString(CastToClient(), Chat::SpellFailure, fizzle_msg, spell_link); /** * Song Failure message */ - Message::CloseMessageString(this, true, RuleI(Range, SpellMessages), + ClientPatch::BroadcastMessageStringInRadius(this, true, RuleI(Range, SpellMessages), nullptr, true, IsClient() ? FilterPCSpells : FilterNPCSpells)( Chat::SpellFailure, fizzle_msg == MISS_NOTE ? MISSED_NOTE_OTHER : SPELL_FIZZLE_OTHER, GetName(), spell_link); @@ -480,7 +480,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, return true; } -void Mob::DoSpellInterrupt(uint16 spell_id, int32 mana_cost, int my_curmana) { +void Mob::DoSpellInterrupt(int32 spell_id, int32 mana_cost, int my_curmana) { //The client will prevent spell casting if insufficient mana, this is only for serverside enforcement. LogSpells("Not enough mana spell [{}] curmana [{}] cost [{}]\n", spell_id, my_curmana, mana_cost); if (IsClient()) { @@ -493,7 +493,7 @@ void Mob::DoSpellInterrupt(uint16 spell_id, int32 mana_cost, int my_curmana) { ZeroCastingVars(); } -void Mob::SendBeginCast(uint16 spell_id, uint32 casttime) +void Mob::SendBeginCast(int32 spell_id, uint32 casttime) { auto outapp = new EQApplicationPacket(OP_BeginCast, sizeof(BeginCast_Struct)); auto begincast = (BeginCast_Struct *)outapp->pBuffer; @@ -922,7 +922,7 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp return true; } -uint16 Mob::GetSpecializeSkillValue(uint16 spell_id) const { +uint16 Mob::GetSpecializeSkillValue(int32 spell_id) const { switch(spells[spell_id].skill) { case EQ::skills::SkillAbjuration: return(GetSkill(EQ::skills::SkillSpecializeAbjure)); @@ -941,7 +941,7 @@ uint16 Mob::GetSpecializeSkillValue(uint16 spell_id) const { return(0); } -void Client::CheckSpecializeIncrease(uint16 spell_id) { +void Client::CheckSpecializeIncrease(int32 spell_id) { // These are not active because CheckIncreaseSkill() already does so. // It's such a rare occurance that adding them here is wasted..(ref only) /* @@ -973,7 +973,7 @@ void Client::CheckSpecializeIncrease(uint16 spell_id) { } } -void Client::CheckSongSkillIncrease(uint16 spell_id){ +void Client::CheckSongSkillIncrease(int32 spell_id){ // These are not active because CheckIncreaseSkill() already does so. // It's such a rare occurance that adding them here is wasted..(ref only) /* @@ -1039,12 +1039,12 @@ only works for clients, npcs shouldn't be fizzling.. new algorithm thats closer to live eq (i hope) TODO: Add aa skills, item mods, reduced the chance to fizzle */ -bool Mob::CheckFizzle(uint16 spell_id) +bool Mob::CheckFizzle(int32 spell_id) { return(true); } -bool Client::CheckFizzle(uint16 spell_id) +bool Client::CheckFizzle(int32 spell_id) { // GMs don't fizzle if (GetGM()) { @@ -1228,7 +1228,7 @@ void Mob::ZeroBardPulseVars() bardsong_timer.Disable(); } -void Mob::InterruptSpell(uint16 spellid) +void Mob::InterruptSpell(int32 spellid) { if (!IsValidSpell(spellid)) { spellid = casting_spell_id; @@ -1238,7 +1238,7 @@ void Mob::InterruptSpell(uint16 spellid) } // color not used right now -void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) +void Mob::InterruptSpell(uint16 message, uint16 color, int32 spellid) { uint16 message_other; bool bard_song_mode = false; //has the bard song gone to auto repeat mode @@ -1303,7 +1303,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) // the interrupt message char spell_link[Links::MAX_LINK_SIZE]; Links::FormatSpellLink(spell_link, Links::MAX_LINK_SIZE, spellid); - Message::InterruptSpell(CastToClient(), message, GetID(), spell_link); + ClientPatch::InterruptSpell(CastToClient(), message, GetID(), spell_link); SendSpellBarEnable(spellid); } @@ -1331,7 +1331,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) // this is the actual message, it works the same as a formatted message char spell_link[Links::MAX_LINK_SIZE]; Links::FormatSpellLink(spell_link, Links::MAX_LINK_SIZE, spellid); - Message::InterruptSpellOther(this, message_other, GetID(), GetCleanName(), spell_link); + ClientPatch::InterruptSpellOther(this, message_other, GetID(), GetCleanName(), spell_link); } // this is like interrupt, just it doesn't spam interrupt packets to everyone @@ -1390,7 +1390,7 @@ void Mob::StopCastSpell(int32 spell_id, bool send_spellbar_enable) // NOTE: do not put range checking, etc into this function. this should // just check timed spell specific things before passing off to SpellFinished // which figures out proper targets etc -void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slot, +void Mob::CastedSpellFinished(int32 spell_id, uint32 target_id, CastingSlot slot, int32 mana_used, uint32 inventory_slot, int16 resist_adjust) { if (!IsValidSpell(spell_id)) @@ -1839,7 +1839,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo } -bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction, CastingSlot slot, bool isproc) +bool Mob::DetermineSpellTargets(int32 spell_id, Mob *&spell_target, Mob *&ae_center, CastAction_type &CastAction, CastingSlot slot, bool isproc) { /* The basic types of spells: @@ -2383,7 +2383,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce // only used from CastedSpellFinished, and procs // we can't interrupt in this, or anything called from this! // if you need to abort the casting, return false -bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, int32 mana_used, +bool Mob::SpellFinished(int32 spell_id, Mob *spell_target, CastingSlot slot, int32 mana_used, uint32 inventory_slot, int16 resist_adjust, bool isproc, int level_override, uint32 timer, uint32 timer_duration, bool from_casted_spell, uint32 aa_id) { @@ -2856,7 +2856,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in if (IsClient() && IsEffectInSpell(spell_id, SpellEffect::BindSight)) { for (int i = 0; i < GetMaxTotalSlots(); i++) { if (buffs[i].spellid == spell_id) { - CastToClient()->SendBuffNumHitPacket(buffs[i], i);//its hack, it works. + ClientPatch::SendSingleBuffChange(this, buffs[i], i);//its hack, it works. } } } @@ -2864,7 +2864,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in if (IsClient() && spells[spell_id].hit_number) { for (int i = 0; i < GetMaxTotalSlots(); i++) { if (buffs[i].spellid == spell_id && buffs[i].hit_number > 0) { - CastToClient()->SendBuffNumHitPacket(buffs[i], i); + ClientPatch::SendSingleBuffChange(this, buffs[i], i); break; } } @@ -2928,7 +2928,7 @@ bool Mob::ApplyBardPulse(int32 spell_id, Mob *spell_target, CastingSlot slot) { // even be created depending on the types of mobs involved // // right now this is just an outline, working on this.. -int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caster_level_override) +int Mob::CalcBuffDuration(Mob *caster, Mob *target, int32 spell_id, int32 caster_level_override) { int formula, duration; @@ -3054,7 +3054,7 @@ int CalcBuffDuration_formula(int level, int formula, int duration) // -1 if they can't stack and spellid2 should be stopped //currently, a spell will not land if it would overwrite a better spell on any effect //if all effects are better or the same, we overwrite, else we do nothing -int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int caster_level2, Mob* caster1, Mob* caster2, int buffslot) +int Mob::CheckStackConflict(int32 spellid1, int caster_level1, int32 spellid2, int caster_level2, Mob* caster1, Mob* caster2, int buffslot) { const SPDat_Spell_Struct &sp1 = spells[spellid1]; const SPDat_Spell_Struct &sp2 = spells[spellid2]; @@ -3411,7 +3411,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, // spells 1-50: no restrictons // 51-65: SpellLevel/2+15 // 66+ Group Spells 62, Single Target 61 -bool Mob::CheckSpellLevelRestriction(Mob *caster, uint16 spell_id) +bool Mob::CheckSpellLevelRestriction(Mob *caster, int32 spell_id) { if (spells[spell_id].target_type == ST_Self) { LogSpells("[CheckSpellLevelRestriction] Self Only spell - no restrictions"); @@ -3517,7 +3517,7 @@ bool Mob::HasDiscBuff() // stacking problems, and -2 if this is not a buff // if caster is null, the buff will be added with the caster level being // the level of the mob -int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_override, bool disable_buff_overwrite) +int Mob::AddBuff(Mob *caster, int32 spell_id, int duration, int32 level_override, bool disable_buff_overwrite) { int buffslot, ret, caster_level, emptyslot = -1; bool will_overwrite = false; @@ -3720,6 +3720,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid memset(buffs[emptyslot].caster_name, 0, 64); buffs[emptyslot].casterid = caster ? caster->GetID() : 0; buffs[emptyslot].ticsremaining = duration; + buffs[emptyslot].initialduration = duration; buffs[emptyslot].counters = CalculateCounters(spell_id); buffs[emptyslot].hit_number = spells[spell_id].hit_number; buffs[emptyslot].client = caster ? caster->IsClient() : 0; @@ -3741,29 +3742,8 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } LogSpells("Buff [{}] added to slot [{}] with caster level [{}]", spell_id, emptyslot, caster_level); - if (IsPet() && GetOwner() && GetOwner()->IsClient()) - SendPetBuffsToClient(); - - if((IsClient() && !CastToClient()->GetPVP()) || - (IsPet() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()) || - (IsBot() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP()) || - (IsMerc() && GetOwner() && GetOwner()->IsClient() && !GetOwner()->CastToClient()->GetPVP())) - { - EQApplicationPacket *outapp = MakeBuffsPacket(); - - entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQ::versions::maskSoDAndLater); - - if(IsClient() && GetTarget() == this) - CastToClient()->QueuePacket(outapp); - - safe_delete(outapp); - } - - if (IsNPC()) { - EQApplicationPacket *outapp = MakeBuffsPacket(); - entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQ::versions::maskSoDAndLater, true); - safe_delete(outapp); - } + ClientPatch::SendSingleBuffChange(this, buffs[emptyslot], emptyslot); + ClientPatch::SendFullBuffRefresh(this); // recalculate bonuses since we stripped/added buffs CalcBonuses(); @@ -3776,7 +3756,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid // note that this should not be used for determining which slot to place a // buff into // returns -1 on stack failure, -2 if all slots full, the slot number if the buff should overwrite another buff, or a free buff slot -int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) +int Mob::CanBuffStack(int32 spellid, uint8 caster_level, bool iFailIfOverwrite) { int i, ret, firstfree = -2; @@ -3873,7 +3853,7 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) // break stuff // bool Mob::SpellOnTarget( - uint16 spell_id, + int32 spell_id, Mob *spelltar, int reflect_effectiveness, bool use_resist_adjust, @@ -4733,11 +4713,11 @@ std::vector Mob::GetBuffSpellIDs() return l; } -bool Mob::FindBuff(uint16 spell_id, uint16 caster_id) +bool Mob::FindBuff(int32 spell_id, uint16 caster_id) { const int buff_count = GetMaxTotalSlots(); for (int buff_slot = 0; buff_slot < buff_count; buff_slot++) { - const uint16 current_spell_id = buffs[buff_slot].spellid; + const int32 current_spell_id = buffs[buff_slot].spellid; if ( IsValidSpell(current_spell_id) && current_spell_id == spell_id && @@ -4916,7 +4896,7 @@ void Mob::BuffFadeBySitModifier() } } -void Mob::BuffFadeBySpellID(uint16 spell_id) +void Mob::BuffFadeBySpellID(int32 spell_id) { bool recalc_bonus = false; int buff_count = GetMaxTotalSlots(); @@ -4932,7 +4912,7 @@ void Mob::BuffFadeBySpellID(uint16 spell_id) } } -void Mob::BuffFadeBySpellIDAndCaster(uint16 spell_id, uint16 caster_id) +void Mob::BuffFadeBySpellIDAndCaster(int32 spell_id, uint16 caster_id) { bool recalc_bonus = false; auto buff_count = GetMaxTotalSlots(); @@ -4977,7 +4957,7 @@ void Mob::BuffFadeSongs() { int buff_count = GetMaxTotalSlots(); for (int buff_slot = 0; buff_slot < buff_count; buff_slot++) { - const uint16 current_spell_id = buffs[buff_slot].spellid; + const int32 current_spell_id = buffs[buff_slot].spellid; if (IsBardSong(current_spell_id)) { BuffFadeBySlot(buff_slot, false); recalc_bonus = true; @@ -5027,7 +5007,7 @@ void Mob::BuffDetachCaster(Mob *caster) { // checks if 'this' can be affected by spell_id from caster // returns true if the spell should fail, false otherwise -bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) +bool Mob::IsImmuneToSpell(int32 spell_id, Mob *caster) { int effect_index; @@ -5267,7 +5247,7 @@ int Mob::GetResist(uint8 resist_type) // pvp_resist_base // pvp_resist_calc // pvp_resist_cap -float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool CharismaCheck, bool CharmTick, bool IsRoot, int level_override) +float Mob::ResistSpell(uint8 resist_type, int32 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool CharismaCheck, bool CharmTick, bool IsRoot, int level_override) { if(!caster) @@ -5651,7 +5631,7 @@ int16 Mob::CalcFearResistChance() return resist_chance; } -float Mob::GetAOERange(uint16 spell_id) +float Mob::GetAOERange(int32 spell_id) { float range = spells[spell_id].aoe_range; @@ -5737,7 +5717,7 @@ void Mob::SendSpellBarDisable() } // this puts the spell bar back into a usable state fast -void Mob::SendSpellBarEnable(uint16 spell_id) +void Mob::SendSpellBarEnable(int32 spell_id) { if(!IsClient()) return; @@ -5830,54 +5810,7 @@ void Mob::Mesmerize() StopNavigation(); } -void Client::MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message) -{ - EQApplicationPacket* outapp = nullptr; - - outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffPacket_Struct)); - SpellBuffPacket_Struct* sbf = (SpellBuffPacket_Struct*) outapp->pBuffer; - - sbf->entityid = GetID(); - // i dont know why but this works.. for now - sbf->buff.effect_type = 2; -// sbf->slot=m_pp.buffs[slot_id].slotid; -// sbf->level=m_pp.buffs[slot_id].level; -// sbf->effect=m_pp.buffs[slot_id].effect; - sbf->buff.spellid = spell_id; - sbf->slotid = slot_id; - sbf->bufffade = 1; -#if EQDEBUG >= 11 - printf("Sending SBF 1 from server:\n"); - DumpPacket(outapp); -#endif - QueuePacket(outapp); - -/* - sbf->effect=0; - sbf->level=0; - sbf->slot=0; -*/ - sbf->buff.spellid = 0xffffffff; -#if EQDEBUG >= 11 - printf("Sending SBF 2 from server:\n"); - DumpPacket(outapp); -#endif - QueuePacket(outapp); - safe_delete(outapp); - - if(send_message) - { - const char *fadetext = spells[spell_id].spell_fades; - outapp = new EQApplicationPacket(OP_ColoredText, sizeof(ColoredText_Struct) + strlen(fadetext)); - ColoredText_Struct *bfm = (ColoredText_Struct *) outapp->pBuffer; - bfm->color = Chat::Spells; - memcpy(bfm->msg, fadetext, strlen(fadetext)); - QueuePacket(outapp); - safe_delete(outapp); - } -} - -void Client::MemSpell(uint16 spell_id, int slot, bool update_client) +void Client::MemSpell(int32 spell_id, int slot, bool update_client) { if (slot >= EQ::spells::SPELL_GEM_COUNT || slot < 0) { return; @@ -5935,7 +5868,7 @@ void Client::UnmemSpellAll(bool update_client) } } -uint32 Client::GetSpellIDByBookSlot(int book_slot) { +int32 Client::GetSpellIDByBookSlot(int book_slot) { if (book_slot <= EQ::spells::SPELLBOOK_SIZE) { return GetSpellByBookSlot(book_slot); } @@ -5968,7 +5901,7 @@ int Client::MemmedCount() { return memmed_count; } -int Client::FindMemmedSpellBySpellID(uint16 spell_id) { +int Client::FindMemmedSpellBySpellID(int32 spell_id) { for (int spell_gem = 0; spell_gem < EQ::spells::SPELL_GEM_COUNT; spell_gem++) { if (IsValidSpell(m_pp.mem_spells[spell_gem]) && m_pp.mem_spells[spell_gem] == spell_id) { return spell_gem; @@ -5978,7 +5911,7 @@ int Client::FindMemmedSpellBySpellID(uint16 spell_id) { } -void Client::ScribeSpell(uint16 spell_id, int slot, bool update_client, bool defer_save) +void Client::ScribeSpell(int32 spell_id, int slot, bool update_client, bool defer_save) { if (slot >= EQ::spells::SPELLBOOK_SIZE || slot < 0) { return; @@ -6046,7 +5979,7 @@ void Client::UnscribeSpellAll(bool update_client) SaveSpells(); } -void Client::UnscribeSpellBySpellID(uint16 spell_id, bool update_client) +void Client::UnscribeSpellBySpellID(int32 spell_id, bool update_client) { for (int index = 0; index < EQ::spells::SPELLBOOK_SIZE; index++) { if (IsValidSpell(m_pp.spell_book[index]) && m_pp.spell_book[index] == spell_id) { @@ -6086,7 +6019,7 @@ void Client::UntrainDiscAll(bool update_client) SaveDisciplines(); } -void Client::UntrainDiscBySpellID(uint16 spell_id, bool update_client) +void Client::UntrainDiscBySpellID(int32 spell_id, bool update_client) { for (int slot = 0; slot < MAX_PP_DISCIPLINES; slot++) { if (m_pp.disciplines.values[slot] == spell_id) { @@ -6105,7 +6038,7 @@ int Client::GetNextAvailableSpellBookSlot(int starting_slot) { return -1; //default } -int Client::FindSpellBookSlotBySpellID(uint16 spellid) { +int Client::FindSpellBookSlotBySpellID(int32 spellid) { for(int i = 0; i < EQ::spells::SPELLBOOK_SIZE; i++) { if(m_pp.spell_book[i] == spellid) return i; @@ -6114,12 +6047,12 @@ int Client::FindSpellBookSlotBySpellID(uint16 spellid) { return -1; //default } -uint32 Client::GetHighestScribedSpellinSpellGroup(uint32 spell_group) +int32 Client::GetHighestScribedSpellinSpellGroup(uint32 spell_group) { //Typical live spells follow 1/5/10 rank value for actual ranks 1/2/3, but this can technically be set as anything. int highest_rank = 0; //highest ranked found in spellgroup - uint32 highest_spell_id = 0; //spell_id of the highest ranked spell you have scribed in that spell rank. + int32 highest_spell_id = 0; //spell_id of the highest ranked spell you have scribed in that spell rank. for (int i = 0; i < EQ::spells::SPELLBOOK_SIZE; i++) { @@ -6162,7 +6095,7 @@ std::unordered_map> Client::LoadSpellGroupCache(uint return spell_group_cache; } -bool Client::SpellGlobalCheck(uint16 spell_id, uint32 character_id) { +bool Client::SpellGlobalCheck(int32 spell_id, uint32 character_id) { std::string query = fmt::format( "SELECT qglobal, value FROM spell_globals WHERE spellid = {}", spell_id @@ -6239,7 +6172,7 @@ bool Client::SpellGlobalCheck(uint16 spell_id, uint32 character_id) { return false; } -bool Client::SpellBucketCheck(uint16 spell_id, uint32 character_id) +bool Client::SpellBucketCheck(int32 spell_id, uint32 character_id) { const auto& e = SpellBucketsRepository::FindOne(database, spell_id); if (!e.spell_id || e.bucket_name.empty() || e.bucket_value.empty()) { @@ -6269,7 +6202,7 @@ int16 Mob::GetBuffSlotFromType(uint16 type) { return -1; } -uint16 Mob::GetSpellIDFromSlot(uint8 slot) +int32 Mob::GetSpellIDFromSlot(uint8 slot) { if (IsValidSpell(buffs[slot].spellid)) { return buffs[slot].spellid; @@ -6309,7 +6242,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { return false; } -bool Mob::IsCombatProc(uint16 spell_id) { +bool Mob::IsCombatProc(int32 spell_id) { if (RuleB(Spells, FocusCombatProcs)) { return false; @@ -6342,7 +6275,7 @@ bool Mob::IsCombatProc(uint16 spell_id) { return false; } -bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 base_spell_id, int level_override, uint32 proc_reuse_time) { +bool Mob::AddProcToWeapon(int32 spell_id, bool bPerma, uint16 iChance, int32 base_spell_id, int level_override, uint32 proc_reuse_time) { if(!IsValidSpell(spell_id)) { return false; } @@ -6402,7 +6335,7 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b return false; } -bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) { +bool Mob::RemoveProcFromWeapon(int32 spell_id, bool bAll) { // Special case for Vampiric Embrace. If this is a Shadow Knight, the proc is different. if (spell_id == SPELL_VAMPIRIC_EMBRACE && GetClass() == Class::ShadowKnight) { spell_id = SPELL_VAMPIRIC_EMBRACE_OF_SHADOW; @@ -6421,7 +6354,7 @@ bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) { return true; } -bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id, uint32 proc_reuse_time) +bool Mob::AddDefensiveProc(int32 spell_id, uint16 iChance, int32 base_spell_id, uint32 proc_reuse_time) { if(!IsValidSpell(spell_id)) return(false); @@ -6441,7 +6374,7 @@ bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id return false; } -bool Mob::RemoveDefensiveProc(uint16 spell_id, bool bAll) +bool Mob::RemoveDefensiveProc(int32 spell_id, bool bAll) { for (int i = 0; i < m_max_procs; i++) { if (bAll || DefensiveProcs[i].spellID == spell_id) { @@ -6455,7 +6388,7 @@ bool Mob::RemoveDefensiveProc(uint16 spell_id, bool bAll) return true; } -bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id, uint32 proc_reuse_time) +bool Mob::AddRangedProc(int32 spell_id, uint16 iChance, int32 base_spell_id, uint32 proc_reuse_time) { if(!IsValidSpell(spell_id)) return(false); @@ -6475,7 +6408,7 @@ bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id, u return false; } -bool Mob::RemoveRangedProc(uint16 spell_id, bool bAll) +bool Mob::RemoveRangedProc(int32 spell_id, bool bAll) { for (int i = 0; i < m_max_procs; i++) { if (bAll || RangedProcs[i].spellID == spell_id) { @@ -6491,7 +6424,7 @@ bool Mob::RemoveRangedProc(uint16 spell_id, bool bAll) // this is checked in a few places to decide wether special bard // behavior should be used. -bool Mob::UseBardSpellLogic(uint16 spell_id, int slot) +bool Mob::UseBardSpellLogic(int32 spell_id, int slot) { if (!IsValidSpell(spell_id)) { spell_id = casting_spell_id; @@ -6510,7 +6443,7 @@ bool Mob::UseBardSpellLogic(uint16 spell_id, int slot) ); } -int Mob::GetCasterLevel(uint16 spell_id) { +int Mob::GetCasterLevel(int32 spell_id) { int level = GetLevel(); if (GetClass() == Class::Bard) { // Bards receive effective casting level increases to resists/effect. They don't receive benefit from spells like intellectual superiority, however. @@ -6522,170 +6455,7 @@ int Mob::GetCasterLevel(uint16 spell_id) { return std::max(1, level); } -//This member function sets the buff duration on the client -//however it does not work if sent quickly after an action packets, which is what one might perfer to do -//Thus I use this in the buff process to update the correct duration once after casting -//this allows AAs and focus effects that increase buff duration to work correctly, but could probably -//be used for other things as well -void Client::SendBuffDurationPacket(Buffs_Struct &buff, int slot) -{ - EQApplicationPacket* outapp = nullptr; - outapp = new EQApplicationPacket(OP_Buff, sizeof(SpellBuffPacket_Struct)); - SpellBuffPacket_Struct* sbf = (SpellBuffPacket_Struct*) outapp->pBuffer; - - sbf->entityid = GetID(); - - sbf->buff.effect_type = 2; - - sbf->buff.level = buff.casterlevel > 0 ? buff.casterlevel : GetLevel(); - sbf->buff.bard_modifier = buff.instrument_mod; - sbf->buff.spellid = buff.spellid; - sbf->buff.duration = buff.ticsremaining; - if (buff.dot_rune) - sbf->buff.counters = buff.dot_rune; - else if (buff.magic_rune) - sbf->buff.counters = buff.magic_rune; - else if (buff.melee_rune) - sbf->buff.counters = buff.melee_rune; - else if (buff.counters) - sbf->buff.counters = buff.counters; - sbf->buff.player_id = buff.casterid; - sbf->buff.num_hits = buff.hit_number; - sbf->buff.y = buff.caston_y; - sbf->buff.x = buff.caston_x; - sbf->buff.z = buff.caston_z; - - sbf->slotid = slot; - sbf->bufffade = 0; - FastQueuePacket(&outapp); -} - -void Client::SendBuffNumHitPacket(Buffs_Struct &buff, int slot) -{ - // UF+ use this packet - if (ClientVersion() < EQ::versions::ClientVersion::UF) - return; - EQApplicationPacket *outapp = nullptr; - outapp = new EQApplicationPacket(OP_BuffCreate, sizeof(BuffIcon_Struct) + sizeof(BuffIconEntry_Struct)); - BuffIcon_Struct *bi = (BuffIcon_Struct *)outapp->pBuffer; - bi->entity_id = GetID(); - bi->count = 1; - bi->all_buffs = 0; - bi->tic_timer = tic_timer.GetRemainingTime(); - - bi->entries[0].buff_slot = slot; - bi->entries[0].spell_id = buff.spellid; - bi->entries[0].tics_remaining = buff.ticsremaining; - bi->entries[0].num_hits = buff.hit_number; - strn0cpy(bi->entries[0].caster, buff.caster_name, 64); - bi->name_lengths = strlen(bi->entries[0].caster); - FastQueuePacket(&outapp); -} - -void Mob::SendPetBuffsToClient() -{ - // Don't really need this check, as it should be checked before this method is called, but it doesn't hurt - // too much to check again. - if(!(GetOwner() && GetOwner()->IsClient())) - return; - - int PetBuffCount = 0; - - auto outapp = new EQApplicationPacket(OP_PetBuffWindow, sizeof(PetBuff_Struct)); - PetBuff_Struct* pbs=(PetBuff_Struct*)outapp->pBuffer; - memset(outapp->pBuffer,0,outapp->size); - pbs->petid=GetID(); - - int MaxSlots = GetMaxTotalSlots(); - - if(MaxSlots > PET_BUFF_COUNT) - MaxSlots = PET_BUFF_COUNT; - - for(int buffslot = 0; buffslot < MaxSlots; buffslot++) - { - if (IsValidSpell(buffs[buffslot].spellid)) { - pbs->spellid[buffslot] = buffs[buffslot].spellid; - pbs->ticsremaining[buffslot] = buffs[buffslot].ticsremaining; - PetBuffCount++; - } - } - - pbs->buffcount=PetBuffCount; - GetOwner()->CastToClient()->QueuePacket(outapp); - safe_delete(outapp); -} - -void Mob::SendBuffsToClient(Client *c) -{ - if(!c) - return; - - if (c->ClientVersionBit() & EQ::versions::maskSoDAndLater) - { - EQApplicationPacket *outapp = MakeBuffsPacket(); - c->FastQueuePacket(&outapp); - } -} - -EQApplicationPacket *Mob::MakeBuffsPacket(bool for_target, bool clear_buffs) -{ - uint32 count = 0; - uint32 buff_count; - - // for self we want all buffs, for target, we want to skip song window buffs - // since NPCs and pets don't have a song window, we still see it for them :P - if (for_target) { - buff_count = (clear_buffs) ? 0 : GetMaxBuffSlots(); - } - else { - buff_count = GetMaxTotalSlots(); - } - - for(int i = 0; i < buff_count; ++i) { - if (IsValidSpell(buffs[i].spellid)) { - ++count; - } - } - - EQApplicationPacket* outapp = nullptr; - - //Create it for a targeting window, else create it for a create buff packet. - if(for_target) { - outapp = new EQApplicationPacket(OP_TargetBuffs, sizeof(BuffIcon_Struct) + sizeof(BuffIconEntry_Struct) * count); - } - else { - outapp = new EQApplicationPacket(OP_BuffCreate, sizeof(BuffIcon_Struct) + sizeof(BuffIconEntry_Struct) * count); - } - BuffIcon_Struct *buff = (BuffIcon_Struct*)outapp->pBuffer; - buff->entity_id = GetID(); - buff->count = count; - buff->all_buffs = 1; - buff->tic_timer = tic_timer.GetRemainingTime(); - // there are more types, the client doesn't seem to really care though. The others are also currently hard to fill in here ... - // (see comment in common/eq_packet_structs.h) - if (for_target) - buff->type = IsClient() ? 5 : 7; - else - buff->type = 0; - - buff->name_lengths = 0; // hacky shit - uint32 index = 0; - for(int i = 0; i < buff_count; ++i) { - if (IsValidSpell(buffs[i].spellid)) { - buff->entries[index].buff_slot = i; - buff->entries[index].spell_id = buffs[i].spellid; - buff->entries[index].tics_remaining = buffs[i].ticsremaining; - buff->entries[index].num_hits = buffs[i].hit_number; - strn0cpy(buff->entries[index].caster, buffs[i].caster_name, 64); - buff->name_lengths += strlen(buff->entries[index].caster); - ++index; - } - } - - return outapp; -} - -void Mob::BuffModifyDurationBySpellID(uint16 spell_id, int32 newDuration) +void Mob::BuffModifyDurationBySpellID(int32 spell_id, int32 newDuration) { int buff_count = GetMaxTotalSlots(); for(int i = 0; i < buff_count; ++i) @@ -6693,10 +6463,7 @@ void Mob::BuffModifyDurationBySpellID(uint16 spell_id, int32 newDuration) if (buffs[i].spellid == spell_id) { buffs[i].ticsremaining = newDuration; - if(IsClient()) - { - CastToClient()->SendBuffDurationPacket(buffs[i], i); - } + ClientPatch::SendSingleBuffChange(this, buffs[i], i); } } } @@ -6749,7 +6516,7 @@ void NPC::UninitializeBuffSlots() safe_delete_array(buffs); } -void Client::SendSpellAnim(uint16 target_id, uint16 spell_id) +void Client::SendSpellAnim(uint16 target_id, int32 spell_id) { if (!target_id || !IsValidSpell(spell_id)) { return; @@ -6972,7 +6739,7 @@ void Mob::CalcDestFromHeading(float heading, float distance, float MaxZDiff, flo dZ = FindGroundZ(dX, dY, MaxZDiff); } -void Mob::BeamDirectional(uint16 spell_id, int16 resist_adjust) +void Mob::BeamDirectional(int32 spell_id, int16 resist_adjust) { int maxtarget_count = 0; bool beneficial_targets = false; @@ -7056,7 +6823,7 @@ void Mob::BeamDirectional(uint16 spell_id, int16 resist_adjust) } } -void Mob::ConeDirectional(uint16 spell_id, int16 resist_adjust) +void Mob::ConeDirectional(int32 spell_id, int16 resist_adjust) { int maxtarget_count = 0; bool beneficial_targets = false; @@ -7236,7 +7003,7 @@ void Client::ResetAllCastbarCooldowns() { } } -void Client::ResetCastbarCooldownBySpellID(uint32 spell_id) { +void Client::ResetCastbarCooldownBySpellID(int32 spell_id) { for (unsigned int i = 0; i < EQ::spells::SPELL_GEM_COUNT; ++i) { if(IsValidSpell(m_pp.mem_spells[i]) && m_pp.mem_spells[i] == spell_id) { m_pp.spellSlotRefresh[i] = 1; @@ -7271,7 +7038,7 @@ void Mob::DoBardCastingFromItemClick(bool is_casting_bard_song, uint32 cast_time if (cast_time != 0) { char spell_link[Links::MAX_LINK_SIZE]; Links::FormatSpellLink(spell_link, Links::MAX_LINK_SIZE, spell_id); - Message::InterruptSpell(CastToClient(), SONG_ENDS, GetID(), spell_link); + ClientPatch::InterruptSpell(CastToClient(), SONG_ENDS, GetID(), spell_link); ZeroCastingVars(); ZeroBardPulseVars(); diff --git a/zone/trap.h b/zone/trap.h index 15950529f..233308025 100644 --- a/zone/trap.h +++ b/zone/trap.h @@ -43,7 +43,7 @@ public: virtual bool IsTrap() const { return true; } void Trigger(Mob* trigger); - void SpellOnTarget(Mob* trigger, uint32 spell_id); + void SpellOnTarget(Mob* trigger, int32 spell_id); NPC * GetHiddenTrigger() { return hiddenTrigger; } void SetHiddenTrigger(NPC* n) { hiddenTrigger = n; } diff --git a/zone/zone.cpp b/zone/zone.cpp index e0c6c44bc..1ad3060a2 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2277,7 +2277,7 @@ void Zone::ClearBlockedSpells() zone_total_blocked_spells = 0; } -bool Zone::IsSpellBlocked(uint32 spell_id, const glm::vec3 &location) +bool Zone::IsSpellBlocked(int32 spell_id, const glm::vec3 &location) { if (blocked_spells) { bool exception = false; @@ -2330,7 +2330,7 @@ bool Zone::IsSpellBlocked(uint32 spell_id, const glm::vec3 &location) return false; } -const char *Zone::GetSpellBlockedMessage(uint32 spell_id, const glm::vec3 &location) +const char *Zone::GetSpellBlockedMessage(int32 spell_id, const glm::vec3 &location) { if (blocked_spells) { for (int x = 0; x < GetZoneTotalBlockedSpells(); x++) { @@ -2379,7 +2379,7 @@ void Zone::LoadLDoNTraps() t->id = e.id; t->type = static_cast(e.type); - t->spell_id = static_cast(e.spell_id); + t->spell_id = e.spell_id; t->skill = e.skill; t->locked = e.locked; diff --git a/zone/zone.h b/zone/zone.h index d1d8c188c..09af5083e 100755 --- a/zone/zone.h +++ b/zone/zone.h @@ -146,7 +146,7 @@ public: bool IsHotzone() const { return (is_hotzone); } bool IsLoaded(); bool IsPVPZone() { return pvpzone; } - bool IsSpellBlocked(uint32 spell_id, const glm::vec3 &location); + bool IsSpellBlocked(int32 spell_id, const glm::vec3 &location); bool IsUCSServerAvailable() { return m_ucss_available; } bool IsZone(uint32 zone_id, uint16 instance_id) const; bool LoadGroundSpawns(); @@ -160,7 +160,7 @@ public: char *adv_data; - const char *GetSpellBlockedMessage(uint32 spell_id, const glm::vec3 &location); + const char *GetSpellBlockedMessage(int32 spell_id, const glm::vec3 &location); EQ::Random random; EQTime zone_time; diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 24414a2d0..0236c4ef4 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1221,7 +1221,7 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru ); } -bool ZoneDatabase::SaveCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id){ +bool ZoneDatabase::SaveCharacterMemorizedSpell(uint32 character_id, int32 spell_id, uint32 slot_id){ if (!IsValidSpell(spell_id)) { return false; } @@ -1231,12 +1231,12 @@ bool ZoneDatabase::SaveCharacterMemorizedSpell(uint32 character_id, uint32 spell CharacterMemmedSpellsRepository::CharacterMemmedSpells{ .id = character_id, .slot_id = static_cast(slot_id), - .spell_id = static_cast(spell_id) + .spell_id = spell_id } ); } -bool ZoneDatabase::SaveCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id) +bool ZoneDatabase::SaveCharacterSpell(uint32 character_id, int32 spell_id, uint32 slot_id) { if (!IsValidSpell(spell_id)) { return false; @@ -1247,7 +1247,7 @@ bool ZoneDatabase::SaveCharacterSpell(uint32 character_id, uint32 spell_id, uint CharacterSpellsRepository::CharacterSpells{ .id = character_id, .slot_id = static_cast(slot_id), - .spell_id = static_cast(spell_id) + .spell_id = spell_id } ); } diff --git a/zone/zonedb.h b/zone/zonedb.h index c751a4737..6cf9aacee 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -68,7 +68,7 @@ struct wplist { #pragma pack(1) struct DBnpcspells_entries_Struct { - uint16 spellid; + int32 spellid; uint8 minlevel; uint8 maxlevel; uint32 type; @@ -123,7 +123,7 @@ struct DBnpcspellseffects_Struct { #pragma pack(1) struct DBbotspells_entries_Struct { - uint16 spellid; + int32 spellid; uint8 minlevel; uint8 maxlevel; uint32 type; @@ -204,7 +204,7 @@ struct AuraRecord { // Actual pet info for a client. struct PetInfo { - uint16 SpellID; + int32 SpellID; int16 petpower; uint32 HP; uint32 Mana; @@ -216,7 +216,7 @@ struct PetInfo { }; struct ZoneSpellsBlocked { - uint32 spellid; + int32 spellid; int8 type; glm::vec3 m_Location; glm::vec3 m_Difference; @@ -286,7 +286,7 @@ struct MercInfo { struct MercSpellEntry { uint8 proficiencyid; - uint16 spellid; // <= 0 = no spell + int32 spellid; // <= 0 = no spell uint32 type; // 0 = never, must be one (and only one) of the defined values int16 stance; // 0 = all, + = only this stance, - = all except this stance uint8 minlevel; @@ -470,10 +470,10 @@ public: bool SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value); bool SaveCharacterLeadershipAbilities(uint32 character_id, PlayerProfile_Struct* pp); bool SaveCharacterMaterialColor(uint32 character_id, uint8 slot_id, uint32 color); - bool SaveCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id); + bool SaveCharacterMemorizedSpell(uint32 character_id, int32 spell_id, uint32 slot_id); bool SaveCharacterPotionBelt(uint32 character_id, uint8 potion_id, uint32 item_id, uint32 icon); bool SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value); - bool SaveCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id); + bool SaveCharacterSpell(uint32 character_id, int32 spell_id, uint32 slot_id); void ZeroPlayerProfileCurrency(PlayerProfile_Struct* pp); @@ -582,7 +582,7 @@ public: bool GetBasePetItems(int32 equipmentset, uint32 *items); BeastlordPetData::PetStruct GetBeastlordPetData(uint16 race_id); uint32 GetMaxNPCSpellsEffectsID(); - bool GetAuraEntry(uint16 spell_id, AuraRecord &record); + bool GetAuraEntry(int32 spell_id, AuraRecord &record); void LoadGlobalLoot(); DBnpcspells_Struct* GetNPCSpells(uint32 npc_spells_id); @@ -591,7 +591,7 @@ public: const NPCType* LoadNPCTypesData(uint32 id, bool bulk_load = false); /*Bots */ - DBbotspells_Struct* GetBotSpells(uint32 bot_spell_id); + DBbotspells_Struct* GetBotSpells(int32 bot_spell_id); void ClearBotSpells() { bot_spells_cache.clear(); bot_spells_loadtried.clear(); } /* Mercs */