This commit is contained in:
Akkadius 2017-02-13 01:26:44 -06:00
commit e3173d04d4
14 changed files with 62 additions and 49 deletions

View File

@ -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

View File

@ -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

View File

@ -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"};

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
ALTER TABLE `npc_spells_entries` MODIFY COLUMN `type` INT(10) UNSIGNED NOT NULL DEFAULT '0';

View File

@ -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;

View File

@ -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<BotSpell> GetBotSpellsForSpellEffect(Bot* botCaster, int spellEffect);
static std::list<BotSpell> GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster, int spellEffect, SpellTargetType targetType);
static std::list<BotSpell> GetBotSpellsBySpellType(Bot* botCaster, uint16 spellType);
static BotSpell GetFirstBotSpellBySpellType(Bot* botCaster, uint16 spellType);
static std::list<BotSpell> 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()); }

View File

@ -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<BotSpell> Bot::GetBotSpellsForSpellEffectAndTargetType(Bot* botCaster,
return result;
}
std::list<BotSpell> Bot::GetBotSpellsBySpellType(Bot* botCaster, uint16 spellType) {
std::list<BotSpell> Bot::GetBotSpellsBySpellType(Bot* botCaster, uint32 spellType) {
std::list<BotSpell> result;
if(botCaster && botCaster->AI_HasSpells()) {
@ -1444,7 +1444,7 @@ std::list<BotSpell> 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;

View File

@ -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<Bot*> 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*> bot_list;

View File

@ -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<MercSpell> Merc::GetMercSpellsBySpellType(Merc* caster, int spellType) {
std::list<MercSpell> Merc::GetMercSpellsBySpellType(Merc* caster, uint32 spellType) {
std::list<MercSpell> result;
if(caster && caster->AI_HasSpells()) {
@ -2918,7 +2918,7 @@ std::list<MercSpell> 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;

View File

@ -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<MercSpell> GetMercSpellsForSpellEffect(Merc* caster, int spellEffect);
static std::list<MercSpell> GetMercSpellsForSpellEffectAndTargetType(Merc* caster, int spellEffect, SpellTargetType targetType);
static std::list<MercSpell> GetMercSpellsBySpellType(Merc* caster, int spellType);
static MercSpell GetFirstMercSpellBySpellType(Merc* caster, int spellType);
static std::list<MercSpell> 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);

View File

@ -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

View File

@ -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_Struct> 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);