Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Cilraaz 2015-11-03 15:12:27 -05:00
commit 9d01e832a8
9 changed files with 53 additions and 11 deletions

View File

@ -1,5 +1,16 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50) EQEMu Changelog (Started on Sept 24, 2003 15:50)
------------------------------------------------------- -------------------------------------------------------
== 11/2/2015 ==
Akkadius: Performance boost (exponential) - Adjusted default idle cast check timers in rules
- Spells:AI_IdleNoSpellMinRecast 500 (Now 6000) 6 seconds
- Spells:AI_IdleNoSpellMaxRecast 2000 (Now 60000) 60 seconds
- Database version 9089 will take care of this update automatically only if you used the default values
- The CPU cost of NPC's checking the entire entity list to cast beneficial spells (Heals/Buffs) becomes extremely high when higher NPC count zones exist (Based off of process profiling)
- Distance checks for every single NPC to every single other NPC who are casting beneficial spells occur every .5 - 2 seconds unless npc_spells dictates other values, which most of the time it does not
- Zones that once fluctuated from 1-8% CPU with no activity (Idle but players present) now idle at .5% based on my testings due
to this change in conjunction with the past few performance commits, these are zones that have 600-800 NPC's in them
- These values normally are overidden by the spells table (npc_spells), fields (idle_no_sp_recast_min, idle_no_sp_recast_max)
== 11/1/2015 == == 11/1/2015 ==
Akkadius: Made many performance optimizing oriented code changes in the source Akkadius: Made many performance optimizing oriented code changes in the source
- Added Rate limit the rate in which signals are processed for NPC's (.5 seconds instead of .01 seconds) - Added Rate limit the rate in which signals are processed for NPC's (.5 seconds instead of .01 seconds)

View File

@ -349,8 +349,8 @@ RULE_INT(Spells, AI_EngagedDetrimentalChance, 20) // Chance during third AI Cast
RULE_INT(Spells, AI_PursueNoSpellMinRecast, 500) // AI spell recast time(MS) check when no spell is cast while chasing target. (min time in random) RULE_INT(Spells, AI_PursueNoSpellMinRecast, 500) // AI spell recast time(MS) check when no spell is cast while chasing target. (min time in random)
RULE_INT(Spells, AI_PursueNoSpellMaxRecast, 2000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random) RULE_INT(Spells, AI_PursueNoSpellMaxRecast, 2000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random)
RULE_INT(Spells, AI_PursueDetrimentalChance, 90) // Chance while chasing target to cast a detrimental spell. RULE_INT(Spells, AI_PursueDetrimentalChance, 90) // Chance while chasing target to cast a detrimental spell.
RULE_INT(Spells, AI_IdleNoSpellMinRecast, 500) // AI spell recast time(MS) check when no spell is cast while idle. (min time in random) RULE_INT(Spells, AI_IdleNoSpellMinRecast, 6000) // AI spell recast time(MS) check when no spell is cast while idle. (min time in random)
RULE_INT(Spells, AI_IdleNoSpellMaxRecast, 2000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random) RULE_INT(Spells, AI_IdleNoSpellMaxRecast, 60000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random)
RULE_INT(Spells, AI_IdleBeneficialChance, 100) // Chance while idle to do a beneficial spell on self or others. RULE_INT(Spells, AI_IdleBeneficialChance, 100) // Chance while idle to do a beneficial spell on self or others.
RULE_BOOL(Spells, SHDProcIDOffByOne, true) // pre June 2009 SHD spell procs were off by 1, they stopped doing this in June 2009 (so UF+ spell files need this false) RULE_BOOL(Spells, SHDProcIDOffByOne, true) // pre June 2009 SHD spell procs were off by 1, they stopped doing this in June 2009 (so UF+ spell files need this false)
RULE_BOOL(Spells, Jun182014HundredHandsRevamp, false) // this should be true for if you import a spell file newer than June 18, 2014 RULE_BOOL(Spells, Jun182014HundredHandsRevamp, false) // this should be true for if you import a spell file newer than June 18, 2014

View File

@ -30,7 +30,7 @@
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/ */
#define CURRENT_BINARY_DATABASE_VERSION 9088 #define CURRENT_BINARY_DATABASE_VERSION 9089
#ifdef BOTS #ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9000 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9000
#else #else

View File

@ -342,6 +342,7 @@
9086|2015_07_02_aa_rework.sql|SHOW TABLES LIKE 'aa_ranks'|empty| 9086|2015_07_02_aa_rework.sql|SHOW TABLES LIKE 'aa_ranks'|empty|
9087|2015_09_25_inventory_snapshots.sql|SHOW TABLES LIKE 'inventory_snapshots'|empty| 9087|2015_09_25_inventory_snapshots.sql|SHOW TABLES LIKE 'inventory_snapshots'|empty|
9088|2015_11_01_perl_event_export_settings.sql|SHOW TABLES LIKE 'perl_event_export_settings'|empty| 9088|2015_11_01_perl_event_export_settings.sql|SHOW TABLES LIKE 'perl_event_export_settings'|empty|
9089|2015_11_02_ai_idle_no_spell_recast_default_changes.sql|SELECT * FROM `rule_values` WHERE `rule_name` LIKE '%Spells:AI_IdleNoSpellMinRecast%' AND `rule_value` = '500'|not_empty|
# Upgrade conditions: # Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not # This won't be needed after this system is implemented, but it is used database that are not

View File

@ -0,0 +1,2 @@
UPDATE `rule_values` SET `rule_value` = '6000' WHERE `rule_value` = '500' AND `rule_name` = 'Spells:AI_IdleNoSpellMinRecast';
UPDATE `rule_values` SET `rule_value` = '60000' WHERE `rule_value` = '2000' AND `rule_name` = 'Spells:AI_IdleNoSpellMaxRecast';

View File

@ -2438,6 +2438,8 @@ void EntityList::Depop(bool StartSpawnTimer)
if (pnpc->IsFindable()) if (pnpc->IsFindable())
UpdateFindableNPCState(pnpc, true); UpdateFindableNPCState(pnpc, true);
pnpc->WipeHateList();
pnpc->Depop(StartSpawnTimer); pnpc->Depop(StartSpawnTimer);
} }
} }

View File

@ -1364,9 +1364,14 @@ void Mob::AI_Process() {
* *
*/ */
Mob* tmptar = entity_list.AICheckCloseAggro(this, GetAggroRange(), GetAssistRange()); Mob* temp_target = entity_list.AICheckCloseAggro(this, GetAggroRange(), GetAssistRange());
if (tmptar) if (temp_target){
AddToHateList(tmptar); AddToHateList(temp_target);
}
AI_scan_area_timer->Disable();
AI_scan_area_timer->Start(RandomTimer(RuleI(NPC, NPCToNPCAggroTimerMin), RuleI(NPC, NPCToNPCAggroTimerMax)), false);
} }
else if (AI_movement_timer->Check() && !IsRooted()) else if (AI_movement_timer->Check() && !IsRooted())
{ {
@ -1867,6 +1872,9 @@ bool NPC::AI_IdleCastCheck() {
//if we didnt cast any spells, our autocast timer just resets to the //if we didnt cast any spells, our autocast timer just resets to the
//last duration it was set to... try to put up a more reasonable timer... //last duration it was set to... try to put up a more reasonable timer...
AIautocastspell_timer->Start(RandomTimer(AISpellVar.idle_no_sp_recast_min, AISpellVar.idle_no_sp_recast_max), false); AIautocastspell_timer->Start(RandomTimer(AISpellVar.idle_no_sp_recast_min, AISpellVar.idle_no_sp_recast_max), false);
Log.Out(Logs::Moderate, Logs::Spells, "Triggering AI_IdleCastCheck :: Mob %s - Min : %u Max : %u", this->GetCleanName(), AISpellVar.idle_no_sp_recast_min, AISpellVar.idle_no_sp_recast_max);
} //else, spell casting finishing will reset the timer. } //else, spell casting finishing will reset the timer.
} //else, spell casting finishing will reset the timer. } //else, spell casting finishing will reset the timer.
return(true); return(true);

View File

@ -283,9 +283,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
//do any AAs apply to these spells? //do any AAs apply to these spells?
if(dmg < 0) { if(dmg < 0) {
if (!PassCastRestriction(false, spells[spell_id].base2[i], true))
break;
dmg = -dmg; dmg = -dmg;
Damage(caster, dmg, spell_id, spell.skill, false, buffslot, false); Damage(caster, dmg, spell_id, spell.skill, false, buffslot, false);
} else { } else {
if (!PassCastRestriction(false, spells[spell_id].base2[i], false))
break;
HealDamage(dmg, caster); HealDamage(dmg, caster);
} }
break; break;
@ -3429,6 +3433,8 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
switch (effect) { switch (effect) {
case SE_CurrentHP: { case SE_CurrentHP: {
if (!PassCastRestriction(false, spells[buff.spellid].base2[i], true))
break;
effect_value = CalcSpellEffectValue(buff.spellid, i, buff.casterlevel, buff.instrument_mod, effect_value = CalcSpellEffectValue(buff.spellid, i, buff.casterlevel, buff.instrument_mod,
caster, buff.ticsremaining); caster, buff.ticsremaining);
// Handle client cast DOTs here. // Handle client cast DOTs here.
@ -6224,16 +6230,17 @@ bool Mob::PassCastRestriction(bool UseCastRestriction, int16 value, bool IsDama
Range 410 - 411 : UNKOWN Range 410 - 411 : UNKOWN
Range 500 - 599 : Heal if HP less than a specified value Range 500 - 599 : Heal if HP less than a specified value
Range 600 - 699 : Limit to Body Type [base2 - 600 = Body] Range 600 - 699 : Limit to Body Type [base2 - 600 = Body]
Range 700 : UNKNOWN Range 700 : UNKNOWN -- Was added to higher HTs in Oct 21 2015 live patch
Range 701 : NOT PET Range 701 : NOT PET
Range 800 : UKNOWN Range 800 : UKNOWN
Range 818 - 819 : If Undead/If Not Undead Range 818 - 819 : If Undead/If Not Undead
Range 820 - 822 : UKNOWN Range 820 - 822 : UKNOWN
Range 835 : Unknown *not implemented Range 835 : Unknown *not implemented
Range 836 - 837 : Progression Server / Live Server *not implemented Range 836 - 837 : Progression Server / Live Server *not fully implemented
Range 839 : Unknown *not implemented Range 839 : Progression Server and GoD released -- broken until Oct 21 2015 on live *not fully implemented
Range 842 - 844 : Humaniod lv MAX ((842 - 800) * 2) Range 842 - 844 : Humaniod lv MAX ((842 - 800) * 2)
Range 845 - 847 : UNKNOWN Range 845 - 847 : UNKNOWN
Range 860 - 871 : Humanoid lv MAX 860 = 90, 871 = 104 *not implemented
Range 10000 - 11000 : Limit to Race [base2 - 10000 = Race] (*Not on live: Too useful a function to not implement) Range 10000 - 11000 : Limit to Race [base2 - 10000 = Race] (*Not on live: Too useful a function to not implement)
THIS IS A WORK IN PROGRESS THIS IS A WORK IN PROGRESS
*/ */
@ -6402,6 +6409,15 @@ bool Mob::PassCastRestriction(bool UseCastRestriction, int16 value, bool IsDama
return true; return true;
break; break;
case 836:
return true; // todo implement progression flag assume not progression for now
case 837:
return false; // todo implement progression flag assume not progression for now
case 839:
return true; // todo implement progression flag assume not progression for now, this one is a check if GoD is live
case 842: case 842:
if (GetBodyType() == BT_Humanoid && GetLevel() <= 84) if (GetBodyType() == BT_Humanoid && GetLevel() <= 84)
return true; return true;
@ -6789,4 +6805,4 @@ void Client::BreakFeignDeathWhenCastOn(bool IsResisted)
SetFeigned(false); SetFeigned(false);
Message_StringID(MT_SpellFailure,FD_CAST_ON); Message_StringID(MT_SpellFailure,FD_CAST_ON);
} }
} }

View File

@ -2267,7 +2267,9 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
} }
} }
// one may want to check if this is a disc or not, but we actually don't, there are non disc stuff that have end cost // one may want to check if this is a disc or not, but we actually don't, there are non disc stuff that have end cost
if (spells[spell_id].EndurCost) { // lets not consume end for custom items that have disc procs.
// One might also want to filter out USE_ITEM_SPELL_SLOT, but DISCIPLINE_SPELL_SLOT are both #defined to the same thing ...
if (spells[spell_id].EndurCost && !isproc) {
auto end_cost = spells[spell_id].EndurCost; auto end_cost = spells[spell_id].EndurCost;
if (mgb) if (mgb)
end_cost *= 2; end_cost *= 2;