mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
merge upstream
This commit is contained in:
+12
-16
@@ -491,7 +491,7 @@ void Mob::AI_Start(uint32 iMoveDelay) {
|
||||
pAggroRange = 70;
|
||||
if (GetAssistRange() == 0)
|
||||
pAssistRange = 70;
|
||||
hate_list.Wipe();
|
||||
hate_list.WipeHateList();
|
||||
|
||||
m_Delta = xyz_heading::Origin();
|
||||
pRunAnimSpeed = 0;
|
||||
@@ -548,7 +548,7 @@ void Mob::AI_Stop() {
|
||||
safe_delete(AIscanarea_timer);
|
||||
safe_delete(AIfeignremember_timer);
|
||||
|
||||
hate_list.Wipe();
|
||||
hate_list.WipeHateList();
|
||||
}
|
||||
|
||||
void NPC::AI_Stop() {
|
||||
@@ -811,12 +811,12 @@ void Client::AI_Process()
|
||||
if (engaged)
|
||||
{
|
||||
if (IsRooted())
|
||||
SetTarget(hate_list.GetClosest(this));
|
||||
SetTarget(hate_list.GetClosestEntOnHateList(this));
|
||||
else
|
||||
{
|
||||
if(AItarget_check_timer->Check())
|
||||
{
|
||||
SetTarget(hate_list.GetTop(this));
|
||||
SetTarget(hate_list.GetEntWithMostHateOnList(this));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1036,7 +1036,7 @@ void Mob::AI_Process() {
|
||||
//
|
||||
if(RuleB(Combat, EnableFearPathing)){
|
||||
if(curfp) {
|
||||
if(IsRooted() || (IsBlind() && CombatRange(hate_list.GetClosest(this)))) {
|
||||
if(IsRooted() || (IsBlind() && CombatRange(hate_list.GetClosestEntOnHateList(this)))) {
|
||||
//make sure everybody knows were not moving, for appearance sake
|
||||
if(IsMoving())
|
||||
{
|
||||
@@ -1086,18 +1086,18 @@ void Mob::AI_Process() {
|
||||
// we are prevented from getting here if we are blind and don't have a target in range
|
||||
// from above, so no extra blind checks needed
|
||||
if ((IsRooted() && !GetSpecialAbility(IGNORE_ROOT_AGGRO_RULES)) || IsBlind())
|
||||
SetTarget(hate_list.GetClosest(this));
|
||||
SetTarget(hate_list.GetClosestEntOnHateList(this));
|
||||
else
|
||||
{
|
||||
if(AItarget_check_timer->Check())
|
||||
{
|
||||
if (IsFocused()) {
|
||||
if (!target) {
|
||||
SetTarget(hate_list.GetTop(this));
|
||||
SetTarget(hate_list.GetEntWithMostHateOnList(this));
|
||||
}
|
||||
} else {
|
||||
if (!ImprovedTaunt())
|
||||
SetTarget(hate_list.GetTop(this));
|
||||
SetTarget(hate_list.GetEntWithMostHateOnList(this));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1373,7 +1373,7 @@ void Mob::AI_Process() {
|
||||
if(IsNPC() && CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
||||
auto targetPosition = xyz_location(target->GetX(), target->GetY(), target->GetZ());
|
||||
if(!zone->watermap->InLiquid(targetPosition)) {
|
||||
Mob *tar = hate_list.GetTop(this);
|
||||
Mob *tar = hate_list.GetEntWithMostHateOnList(this);
|
||||
if(tar == target) {
|
||||
WipeHateList();
|
||||
Heal();
|
||||
@@ -2333,7 +2333,6 @@ create table npc_spells_entries (
|
||||
|
||||
bool IsSpellInList(DBnpcspells_Struct* spell_list, int16 iSpellID);
|
||||
bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSpellEffectID, int32 base, int32 limit, int32 max);
|
||||
bool Compare_AI_Spells(AISpells_Struct i, AISpells_Struct j);
|
||||
|
||||
bool NPC::AI_AddNPCSpells(uint32 iDBSpellsID) {
|
||||
// ok, this function should load the list, and the parent list then shove them into the struct and sort
|
||||
@@ -2458,7 +2457,9 @@ bool NPC::AI_AddNPCSpells(uint32 iDBSpellsID) {
|
||||
spell_list->entries[i].resist_adjust);
|
||||
}
|
||||
}
|
||||
std::sort(AIspells.begin(), AIspells.end(), Compare_AI_Spells);
|
||||
std::sort(AIspells.begin(), AIspells.end(), [](const AISpells_Struct& a, const AISpells_Struct& b) {
|
||||
return a.priority > b.priority;
|
||||
});
|
||||
|
||||
if (IsValidSpell(attack_proc_spell))
|
||||
AddProcToWeapon(attack_proc_spell, true, proc_chance);
|
||||
@@ -2598,11 +2599,6 @@ bool IsSpellInList(DBnpcspells_Struct* spell_list, int16 iSpellID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Compare_AI_Spells(AISpells_Struct i, AISpells_Struct j)
|
||||
{
|
||||
return(i.priority > j.priority);
|
||||
}
|
||||
|
||||
// adds a spell to the list, taking into account priority and resorting list as needed.
|
||||
void NPC::AddSpellToNPCList(int16 iPriority, int16 iSpellID, uint16 iType,
|
||||
int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust)
|
||||
|
||||
Reference in New Issue
Block a user