diff --git a/common/spdat.h b/common/spdat.h index 3344489df..ba275f933 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -43,29 +43,37 @@ const int Z_AGGRO=10; -const int MobAISpellRange=100; // max range of buffs -const int SpellType_Nuke=1; -const int SpellType_Heal=2; -const int SpellType_Root=4; -const int SpellType_Buff=8; -const int SpellType_Escape=16; -const int SpellType_Pet=32; -const int SpellType_Lifetap=64; -const int SpellType_Snare=128; -const int SpellType_DOT=256; -const int SpellType_Dispel=512; -const int SpellType_InCombatBuff=1024; -const int SpellType_Mez=2048; -const int SpellType_Charm=4096; -const int SpellType_Slow = 8192; -const int SpellType_Debuff = 16384; -const int SpellType_Cure = 32768; -const int SpellType_Resurrect = 65536; +const uint32 MobAISpellRange=100; // max range of buffs -const int SpellTypes_Detrimental = SpellType_Nuke|SpellType_Root|SpellType_Lifetap|SpellType_Snare|SpellType_DOT|SpellType_Dispel|SpellType_Mez|SpellType_Charm|SpellType_Debuff|SpellType_Slow; -const int SpellTypes_Beneficial = SpellType_Heal|SpellType_Buff|SpellType_Escape|SpellType_Pet|SpellType_InCombatBuff|SpellType_Cure; +enum SpellTypes : uint32 +{ + SpellType_Nuke = (1 << 0), + SpellType_Heal = (1 << 1), + SpellType_Root = (1 << 2), + SpellType_Buff = (1 << 3), + SpellType_Escape = (1 << 4), + SpellType_Pet = (1 << 5), + SpellType_Lifetap = (1 << 6), + SpellType_Snare = (1 << 7), + SpellType_DOT = (1 << 8), + SpellType_Dispel = (1 << 9), + SpellType_InCombatBuff = (1 << 10), + SpellType_Mez = (1 << 11), + SpellType_Charm = (1 << 12), + SpellType_Slow = (1 << 13), + SpellType_Debuff = (1 << 14), + SpellType_Cure = (1 << 15), + SpellType_Resurrect = (1 << 16), + SpellType_HateRedux = (1 << 17), + SpellType_InCombatBuffSong = (1 << 18), + SpellType_OutOfCombatBuffSong = (1 << 19), + + SpellTypes_Detrimental = (SpellType_Nuke | SpellType_Root | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Charm | SpellType_Debuff | SpellType_Slow), + SpellTypes_Beneficial = (SpellType_Heal | SpellType_Buff | SpellType_Escape | SpellType_Pet | SpellType_InCombatBuff | SpellType_Cure | SpellType_HateRedux | SpellType_InCombatBuffSong | SpellType_OutOfCombatBuffSong), + + SpellType_Any = 0xFFFFFFFF +}; -#define SpellType_Any 0xFFFF // These should not be used to determine spell category.. // They are a graphical affects (effects?) index only diff --git a/common/version.h b/common/version.h index f7f2ad05d..7afe02279 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9103 +#define CURRENT_BINARY_DATABASE_VERSION 9104 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9008 #else diff --git a/utils/scripts/eqemu_server.pl b/utils/scripts/eqemu_server.pl index e0960847e..e9ba02099 100644 --- a/utils/scripts/eqemu_server.pl +++ b/utils/scripts/eqemu_server.pl @@ -334,7 +334,7 @@ sub build_linux_source { } print "Building EQEmu Server code. This will take a while."; - #::: Build + #::: Build print `make`; chdir ($current_directory); @@ -1340,7 +1340,7 @@ sub do_linux_login_server_setup { get_remote_file($install_repository_request_url . "linux/login.ini", "login_template.ini"); get_remote_file($install_repository_request_url . "linux/login_opcodes.conf", "login_opcodes.conf"); - get_remote_file($install_repository_request_url . "linux/login_opcodes.conf", "login_opcodes_sod.conf"); + get_remote_file($install_repository_request_url . "linux/login_opcodes_sod.conf", "login_opcodes_sod.conf"); get_installation_variables(); my $db_name = $installation_variables{"mysql_eqemu_db_name"}; diff --git a/utils/scripts/linux_installer/install.sh b/utils/scripts/linux_installer/install.sh index 5d43230c5..97cfa582e 100644 --- a/utils/scripts/linux_installer/install.sh +++ b/utils/scripts/linux_installer/install.sh @@ -87,6 +87,7 @@ echo "mysql_eqemu_password:$eqemu_db_password" >> install_variables.txt if [[ "$OS" == "Debian" ]]; then # Install pre-req packages + apt-get -y update apt-get $apt_options install bash apt-get $apt_options install build-essential apt-get $apt_options install cmake @@ -105,6 +106,8 @@ if [[ "$OS" == "Debian" ]]; then apt-get $apt_options install libperl-dev apt-get $apt_options install libperl5i-perl apt-get $apt_options install libwtdbomysql-dev + apt-get $apt_options install libmysqlclient-dev + apt-get $apt_options install minizip apt-get $apt_options install lua5.1 apt-get $apt_options install make apt-get $apt_options install mariadb-client diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 2c27d858d..98dc22fc1 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -357,6 +357,7 @@ 9101|2016_12_01_pcnpc_only.sql|SHOW COLUMNS FROM `spells_new` LIKE 'pcnpc_only_flag'|empty| 9102|2017_01_10_book_languages.sql|SHOW COLUMNS FROM `books` LIKE 'language'|empty| 9103|2017_01_30_book_languages_fix.sql|SELECT `language` from `books` WHERE `language` IS NULL|not_empty| +9104|2017_02_09_npc_spells_entries_type_update.sql|SHOW COLUMNS IN `npc_spells_entries` LIKE `type`|contains|smallint(5) unsigned # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2017_02_09_npc_spells_entries_type_update.sql b/utils/sql/git/required/2017_02_09_npc_spells_entries_type_update.sql new file mode 100644 index 000000000..faa46e86e --- /dev/null +++ b/utils/sql/git/required/2017_02_09_npc_spells_entries_type_update.sql @@ -0,0 +1 @@ +ALTER TABLE `npc_spells_entries` MODIFY COLUMN `type` INT(10) UNSIGNED NOT NULL DEFAULT '0'; diff --git a/zone/bot.cpp b/zone/bot.cpp index d5f6ff814..56d8fd5d1 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -7495,7 +7495,7 @@ bool Bot::GroupHasClass(Group* group, uint8 classId) { return result; } -bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint16 iSpellTypes) { +bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint32 iSpellTypes) { if((iSpellTypes&SpellTypes_Detrimental) != 0) { Log.Out(Logs::General, Logs::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return false; diff --git a/zone/bot.h b/zone/bot.h index bda693094..dda1c5f0e 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -235,7 +235,7 @@ public: virtual void Depop(); void CalcBotStats(bool showtext = true); uint16 BotGetSpells(int spellslot) { return AIspells[spellslot].spellid; } - uint16 BotGetSpellType(int spellslot) { return AIspells[spellslot].type; } + uint32 BotGetSpellType(int spellslot) { return AIspells[spellslot].type; } uint16 BotGetSpellPriority(int spellslot) { return AIspells[spellslot].priority; } virtual float GetProcChances(float ProcBonus, uint16 hand); virtual int GetHandToHandDamage(void); @@ -350,7 +350,7 @@ public: void DoEnduranceUpkeep(); //does the endurance upkeep // AI Methods - virtual bool AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes); + virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes); virtual bool AI_EngagedCastCheck(); virtual bool AI_PursueCastCheck(); virtual bool AI_IdleCastCheck(); @@ -416,8 +416,8 @@ public: static uint32 GetDisciplineRemainingTime(Bot *caster, int timer_index); static std::list GetBotSpellsForSpellEffect(Bot* botCaster, int spellEffect); static std::list GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster, int spellEffect, SpellTargetType targetType); - static std::list GetBotSpellsBySpellType(Bot* botCaster, uint16 spellType); - static BotSpell GetFirstBotSpellBySpellType(Bot* botCaster, uint16 spellType); + static std::list GetBotSpellsBySpellType(Bot* botCaster, uint32 spellType); + static BotSpell GetFirstBotSpellBySpellType(Bot* botCaster, uint32 spellType); static BotSpell GetBestBotSpellForFastHeal(Bot* botCaster); static BotSpell GetBestBotSpellForHealOverTime(Bot* botCaster); static BotSpell GetBestBotSpellForPercentageHeal(Bot* botCaster); @@ -467,7 +467,7 @@ public: bool GetRangerAutoWeaponSelect() { return _rangerAutoWeaponSelect; } BotRoleType GetBotRole() { return _botRole; } BotStanceType GetBotStance() { return _botStance; } - uint8 GetChanceToCastBySpellType(uint16 spellType); + uint8 GetChanceToCastBySpellType(uint32 spellType); bool IsGroupPrimaryHealer(); bool IsGroupPrimarySlower(); bool IsBotCaster() { return IsCasterClass(GetClass()); } diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index a35760535..c36e928bb 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -29,7 +29,7 @@ #define BotAI_DEBUG_Spells -1 #endif -bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) { +bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { if (!tar) { return false; @@ -1417,7 +1417,7 @@ std::list Bot::GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster, return result; } -std::list Bot::GetBotSpellsBySpellType(Bot* botCaster, uint16 spellType) { +std::list Bot::GetBotSpellsBySpellType(Bot* botCaster, uint32 spellType) { std::list result; if(botCaster && botCaster->AI_HasSpells()) { @@ -1444,7 +1444,7 @@ std::list Bot::GetBotSpellsBySpellType(Bot* botCaster, uint16 spellTyp return result; } -BotSpell Bot::GetFirstBotSpellBySpellType(Bot* botCaster, uint16 spellType) { +BotSpell Bot::GetFirstBotSpellBySpellType(Bot* botCaster, uint32 spellType) { BotSpell result; result.SpellId = 0; @@ -3324,7 +3324,7 @@ void Bot::CalcChanceToCast() { _spellCastingChances[botStance][SpellType_CureIndex] = castChance; } -uint8 Bot::GetChanceToCastBySpellType(uint16 spellType) { +uint8 Bot::GetChanceToCastBySpellType(uint32 spellType) { int index = 0; int botStance = (int)GetBotStance(); uint8 chance = 0; diff --git a/zone/entity.h b/zone/entity.h index 9a532cdb1..1ea9a4c03 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -413,7 +413,7 @@ public: Mob* AICheckCloseAggro(Mob* sender, float iAggroRange, float iAssistRange); int GetHatedCount(Mob *attacker, Mob *exclude); void AIYellForHelp(Mob* sender, Mob* attacker); - bool AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float iRange, uint16 iSpellTypes); + bool AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float iRange, uint32 iSpellTypes); bool Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, float iRange, uint32 iSpellTypes); Mob* GetTargetForMez(Mob* caster); uint32 CheckNPCsClose(Mob *center); @@ -502,7 +502,7 @@ private: Bot* GetBotByBotName(std::string botName); std::list GetBotsByBotOwnerCharacterID(uint32 botOwnerCharacterID); - bool Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint16 iSpellTypes); // TODO: Evaluate this closesly in hopes to eliminate + bool Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint32 iSpellTypes); // TODO: Evaluate this closesly in hopes to eliminate void ShowSpawnWindow(Client* client, int Distance, bool NamedOnly); // TODO: Implement ShowSpawnWindow in the bot class but it needs entity list stuff private: std::list bot_list; diff --git a/zone/merc.cpp b/zone/merc.cpp index be8f75e60..3e3dfae93 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1985,7 +1985,7 @@ bool Merc::AIDoSpellCast(uint16 spellid, Mob* tar, int32 mana_cost, uint32* oDon return result; } -bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) { +bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) { if(!AI_HasSpells()) return false; @@ -2746,7 +2746,7 @@ int32 Merc::GetActSpellCasttime(uint16 spell_id, int32 casttime) return casttime; } -int8 Merc::GetChanceToCastBySpellType(int16 spellType) { +int8 Merc::GetChanceToCastBySpellType(uint32 spellType) { int mercStance = (int)GetStance(); int8 mercClass = GetClass(); int8 chance = 0; @@ -2888,7 +2888,7 @@ bool Merc::CheckStance(int16 stance) { return false; } -std::list Merc::GetMercSpellsBySpellType(Merc* caster, int spellType) { +std::list Merc::GetMercSpellsBySpellType(Merc* caster, uint32 spellType) { std::list result; if(caster && caster->AI_HasSpells()) { @@ -2918,7 +2918,7 @@ std::list Merc::GetMercSpellsBySpellType(Merc* caster, int spellType) return result; } -MercSpell Merc::GetFirstMercSpellBySpellType(Merc* caster, int spellType) { +MercSpell Merc::GetFirstMercSpellBySpellType(Merc* caster, uint32 spellType) { MercSpell result; result.spellid = 0; diff --git a/zone/merc.h b/zone/merc.h index 7bd4c2b9b..e3eb6c029 100644 --- a/zone/merc.h +++ b/zone/merc.h @@ -78,8 +78,8 @@ public: virtual void AI_Stop(); virtual void AI_Process(); - //virtual bool AICastSpell(Mob* tar, int8 iChance, int16 iSpellTypes); - virtual bool AICastSpell(int8 iChance, int32 iSpellTypes); + //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 AI_EngagedCastCheck(); //virtual bool AI_PursueCastCheck(); @@ -97,7 +97,7 @@ public: // Merc Spell Casting Methods virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime); virtual int32 GetActSpellCost(uint16 spell_id, int32 cost); - int8 GetChanceToCastBySpellType(int16 spellType); + 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); @@ -108,8 +108,8 @@ public: 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, int spellType); - static MercSpell GetFirstMercSpellBySpellType(Merc* caster, int spellType); + 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 GetBestMercSpellForVeryFastHeal(Merc* caster); diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index d2340581d..5034925d9 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -47,7 +47,7 @@ extern Zone *zone; #endif //NOTE: do NOT pass in beneficial and detrimental spell types into the same call here! -bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) { +bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { if (!tar) return false; @@ -344,7 +344,7 @@ bool NPC::AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgain return CastSpell(AIspells[i].spellid, tar->GetID(), EQEmu::CastingSlot::Gem2, AIspells[i].manacost == -2 ? 0 : -1, mana_cost, oDontDoAgainBefore, -1, -1, 0, &(AIspells[i].resist_adjust)); } -bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float iRange, uint16 iSpellTypes) { +bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float iRange, uint32 iSpellTypes) { if((iSpellTypes&SpellTypes_Detrimental) != 0) { //according to live, you can buff and heal through walls... //now with PCs, this only applies if you can TARGET the target, but diff --git a/zone/npc.h b/zone/npc.h index 543725c28..2db110d98 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -54,7 +54,7 @@ typedef struct { } NPCProximity; struct AISpells_Struct { - uint16 type; // 0 = never, must be one (and only one) of the defined values + uint32 type; // 0 = never, must be one (and only one) of the defined values uint16 spellid; // <= 0 = no spell int16 manacost; // -1 = use spdat, -2 = no cast time uint32 time_cancast; // when we can cast this spell next @@ -453,7 +453,7 @@ protected: uint32* pDontCastBefore_casting_spell; std::vector AIspells; bool HasAISpell; - virtual bool AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes); + virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes); virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0); AISpellsVar_Struct AISpellVar; int16 GetFocusEffect(focusType type, uint16 spell_id);