Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2017, 10:11 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,479
Default Request/Question - always aggros npc

Forgive me if I am out of date on this but here is what I know:

Back when I was actively messing with the server, I learned that in order to make npc always aggro on a player regardless of a level (like lev 5 undead aggro on lev 50 players) you had to set their INT below 75. Which is a bit awkward and obscure and most people don't even know this. I know npc stats probably not used for much, but wouldn't it be better to change that and set it with proper npc Flag instead, like we do for Special Attacks? (http://wiki.eqemulator.org/p?NPC_Spe...tacks&frm=Main)

Thank You!
Reply With Quote
  #2  
Old 03-24-2017, 01:13 PM
GRUMPY
Discordant
 
Join Date: Oct 2016
Posts: 446
Default

Could this ruletype help ?
Code:
RULE_INT(Aggro, IntAggroThreshold, 75) // Int <= this will aggro regardless of level difference.
Reply With Quote
  #3  
Old 03-24-2017, 01:25 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,479
Default

Yeah, but I think its sort of weird assigning it to a stat score rather than having a special attack flag.
Reply With Quote
  #4  
Old 03-24-2017, 01:44 PM
GRUMPY
Discordant
 
Join Date: Oct 2016
Posts: 446
Default

Quote:
Originally Posted by ChaosSlayerZ View Post
Yeah, but I think its sort of weird assigning it to a stat score rather than having a special attack flag.
Yes, I agree with you. It is a weird way of doing it.
Reply With Quote
  #5  
Old 03-24-2017, 03:09 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 501
Default

Quote:
Originally Posted by ChaosSlayerZ View Post
Yeah, but I think its sort of weird assigning it to a stat score rather than having a special attack flag.
I experienced a brain fart initially. So the request is to make it a special attack. Hmm.
Reply With Quote
  #6  
Old 03-24-2017, 05:02 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,479
Default

Quote:
Originally Posted by ghanja View Post
I experienced a brain fart initially. So the request is to make it a special attack. Hmm.
Exactly Like the similar things here:
http://wiki.eqemulator.org/p?NPC_Spe...tacks&frm=Main
Reply With Quote
  #7  
Old 04-13-2017, 01:24 AM
Coenxai's Avatar
Coenxai
Hill Giant
 
Join Date: Dec 2013
Posts: 151
Default

This is a pretty basic change guys.

You'll need to add the special ability. Here's an example:

Code:
common.h

	IGNORE_ROOT_AGGRO_RULES = 42,
	CASTING_RESIST_DIFF = 43,
	COUNTER_AVOID_DAMAGE = 44,
	PROX_AGGRO = 45,
	ALWAYS_AGGRO = 46, <-----
	MAX_SPECIAL_ATTACK = 47
Then, just add it in where it fits your goal. Such as:

Code:
aggro.cpp

Mob::CheckWillAggro

   ...

	if (RuleB(Aggro, UseLevelAggro) && ((
		( GetLevel() >= 18 )
		||(GetBodyType() == BT_Undead)
		||( mob->IsClient() && mob->CastToClient()->IsSitting() )
		||( mob->GetLevelCon(GetLevel()) != CON_GREEN )
		||( GetSpecialAbility(ALWAYS_AGGRO) ))
After that, add the special ability to the NPC's that you desire. Voilą.

That function is so abhorrent it deserves an award.
__________________
"The true sign of intelligence is not knowledge but imagination."
Reply With Quote
  #8  
Old 04-13-2017, 02:37 AM
The_Beast's Avatar
The_Beast
Discordant
 
Join Date: May 2016
Location: Under a rock
Posts: 290
Default

How does this current rule fit into that ? Because I'm ok, with it so far.
Code:
RULE_BOOL(Aggro, UseLevelAggro, true) // Level 18+ and Undead will aggro regardless of level difference. (this will disable Rule:IntAggroThreshold if set to true)
Reply With Quote
  #9  
Old 04-13-2017, 07:47 AM
tdanger84
Fire Beetle
 
Join Date: Aug 2012
Posts: 20
Default

you would have to have pretty low intelligence to attack a a lvl 50 at lvl 5. maybe that's the reasoning? =p
Reply With Quote
  #10  
Old 04-13-2017, 10:18 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,479
Default

Quote:
Originally Posted by Coenxai View Post
This is a pretty basic change guys.

You'll need to add the special ability. Here's an example:

Code:
common.h

	IGNORE_ROOT_AGGRO_RULES = 42,
	CASTING_RESIST_DIFF = 43,
	COUNTER_AVOID_DAMAGE = 44,
	PROX_AGGRO = 45,
	ALWAYS_AGGRO = 46, <-----
	MAX_SPECIAL_ATTACK = 47
Then, just add it in where it fits your goal. Such as:

Code:
aggro.cpp

Mob::CheckWillAggro

   ...

	if (RuleB(Aggro, UseLevelAggro) && ((
		( GetLevel() >= 18 )
		||(GetBodyType() == BT_Undead)
		||( mob->IsClient() && mob->CastToClient()->IsSitting() )
		||( mob->GetLevelCon(GetLevel()) != CON_GREEN )
		||( GetSpecialAbility(ALWAYS_AGGRO) ))
After that, add the special ability to the NPC's that you desire. Voilą.

That function is so abhorrent it deserves an award.


Thank You Coenxai!
Would be great our devs would add this to the official source!

BTW the mob doesn't necessarily needs to be Undead
It can be any type of mob that's needs to be always aggro
Reply With Quote
  #11  
Old 04-13-2017, 11:04 PM
Coenxai's Avatar
Coenxai
Hill Giant
 
Join Date: Dec 2013
Posts: 151
Default

Delete this post.
__________________
"The true sign of intelligence is not knowledge but imagination."
Reply With Quote
  #12  
Old 04-13-2017, 11:05 PM
Coenxai's Avatar
Coenxai
Hill Giant
 
Join Date: Dec 2013
Posts: 151
Default

Quote:
Originally Posted by The_Beast View Post
How does this current rule fit into that ? Because I'm ok, with it so far.
Code:
RULE_BOOL(Aggro, UseLevelAggro, true) // Level 18+ and Undead will aggro regardless of level difference. (this will disable Rule:IntAggroThreshold if set to true)
It will aggro regardless of BodyType with the special ability. Undead will aggro regardless of special ability.
__________________
"The true sign of intelligence is not knowledge but imagination."
Reply With Quote
  #13  
Old 04-14-2017, 12:11 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,479
Default

Quote:
Originally Posted by Coenxai View Post
It will aggro regardless of BodyType with the special ability. Undead will aggro regardless of special ability.


actually it would be better if Undead don't always aggro automatically - because you may want undead that don't aggro. (not all undead on live were always aggro - there was a number of undead in various places/levels that obeyed level difference green status)
So its better to have all mobs without default rules, and then apply the "always aggro" flag where actually needed.
Reply With Quote
  #14  
Old 04-14-2017, 12:17 AM
Coenxai's Avatar
Coenxai
Hill Giant
 
Join Date: Dec 2013
Posts: 151
Default

Quote:
Originally Posted by ChaosSlayerZ View Post
actually it would be better if Undead don't always aggro automatically - because you may want undead that don't aggro. (not all undead on live were always aggro - there was a number of undead in various places/levels that obeyed level difference green status)
So its better to have all mobs without default rules, and then apply the "always aggro" flag where actually needed.
You can have a mob of type BT_Undead that doesn't aggro. This purely relates to FACTION_THREATENLY && FACTION_SCOWLS.

I'm going to post slightly more readable aggro code.

I didn't test this properly but it should work.
Code:
aggro.cpp

bool Mob::CheckWillAggro(Mob *mob) {

	if(!mob)
		return false;

	if (mob->IsClient()) {
		if (!mob->CastToClient()->ClientFinishedLoading() || mob->CastToClient()->IsHoveringForRespawn() || mob->CastToClient()->zoning || !mob->CastToClient()->Connected() 
			|| mob->CastToClient()->GetGM() || mob->CastToClient()->IsLD() || mob->CastToClient()->IsBecomeNPC() || mob->IsInvisible(this))
			return false;
	}

	Mob *ownr = mob->GetOwner();
	if (ownr && ownr->IsClient() && !ownr->CastToClient()->ClientFinishedLoading() || mob == ownr)
		return false;

	// Don't aggro new clients if we are already engaged unless PROX_AGGRO is set. WHY ARE WE CHECKING COMBAT AND AGGRO RANGE? THIS SHOULD BE COMBINED.
	if (IsEngaged() && !GetSpecialAbility(PROX_AGGRO) || GetSpecialAbility(PROX_AGGRO) && !CombatRange(mob)) {
		Log(Logs::Moderate, Logs::Aggro, "%s is in combat, and does not have prox_aggro, or does and is out of combat range with %s", GetName(), mob->GetName());
		return false;
	}

	float AggroRange, t1, t2, t3;

	AggroRange = GetAggroRange();
	t1 = mob->GetX() - GetX();
	t2 = mob->GetY() - GetY();
	t3 = mob->GetZ() - GetZ();

	if (t1 < 0)
		t1 = 0 - t1;
	if (t2 < 0)
		t2 = 0 - t2;
	if (t3 < 0)
		t3 = 0 - t3;

	if ((t1 > AggroRange) || (t2 > AggroRange) || (t3 > AggroRange))
		return false;

	float dist2 = DistanceSquared(mob->GetPosition(), m_Position);
	float AggroRange2 = AggroRange*AggroRange;

	if (dist2 > AggroRange2)
		return false;

	FACTION_VALUE fv = mob->GetReverseFactionCon(this);
	uint8 MyLevel = GetLevel();

	int heroicCHA_mod = mob->itembonuses.HeroicCHA/25; // 800 Heroic CHA cap
	if(heroicCHA_mod > THREATENLY_ARRGO_CHANCE)
		heroicCHA_mod = THREATENLY_ARRGO_CHANCE;

	if (MyLevel >= RuleI(Aggro, LevelAggro) || (GetBodyType() == BT_Undead && MyLevel >= RuleI(Aggro, UndeadLevelAggro)) || GetINT() <= RuleI(Aggro, IntAggroThreshold)
		|| mob->IsClient() && mob->CastToClient()->IsSitting() || GetSpecialAbility(ALWAYS_AGGRO) || mob->GetLevelCon(GetLevel()) != CON_GREEN) {
		if (fv == FACTION_SCOWLS || fv == FACTION_THREATENLY && zone->random.Roll(THREATENLY_ARRGO_CHANCE - heroicCHA_mod) 
			|| (mob->GetPrimaryFaction() != GetPrimaryFaction() && mob->GetPrimaryFaction() == -4 && GetOwner() == nullptr)) {
			if (CheckLosFN(mob)) {
				Log(Logs::Detail, Logs::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName());
				return(mod_will_aggro(mob, this));
			}
		}
	}

	Log(Logs::Detail, Logs::Aggro, "InZone: %d | Dist^2: %f | Range^2: %f | Faction: %d | Con: %d | Int: %d | MyLevel: %d", mob->InZone(), dist2, AggroRange2, fv, GetINT(), GetLevelCon(mob->GetLevel()), MyLevel);

	return false;
}
Code:
ruletypes.h

RULE_CATEGORY(Aggro)
RULE_BOOL(Aggro, SmartAggroList, true)
RULE_INT(Aggro, SittingAggroMod, 35) //35%
RULE_INT(Aggro, MeleeRangeAggroMod, 10) //10%
RULE_INT(Aggro, CurrentTargetAggroMod, 0) //0% -- will prefer our current target to any other; makes it harder for our npcs to switch targets.
RULE_INT(Aggro, CriticallyWoundedAggroMod, 100) //100%
RULE_INT(Aggro, SpellAggroMod, 100)
RULE_INT(Aggro, SongAggroMod, 33)
RULE_INT(Aggro, PetSpellAggroMod, 10)
RULE_REAL(Aggro, TunnelVisionAggroMod, 0.75) //people not currently the top hate generate this much hate on a Tunnel Vision mob
RULE_INT(Aggro, MaxScalingProcAggro, 400) // Set to -1 for no limit. Maxmimum amount of aggro that HP scaling SPA effect in a proc will add.
RULE_INT(Aggro, IntAggroThreshold, 75) // Int <= this will aggro regardless of level difference.
RULE_BOOL(Aggro, AllowTickPulling, false) // tick pulling is an exploit in an NPC's call for help fixed sometime in 2006 on live
RULE_BOOL(Aggro, UseLevelAggro, true)
RULE_INT(Aggro, LevelAggro, 18)
RULE_INT(Aggro, UndeadLevelAggro, 6)
RULE_INT(Aggro, ClientAggroCheckInterval, 6) // Interval in which clients actually check for aggro - in seconds
RULE_CATEGORY_END()
Code:
common.h

   ...

	COUNTER_AVOID_DAMAGE = 44,
	PROX_AGGRO = 45,
	ALWAYS_AGGRO = 46, <---
	MAX_SPECIAL_ATTACK = 47
__________________
"The true sign of intelligence is not knowledge but imagination."
Reply With Quote
  #15  
Old 04-14-2017, 12:31 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,479
Default

I am not exactly sure what BT_Undead is? and how its different from just Undead?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:13 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3