[Question] Larger Aggro Range? menu

User Tag List

Results 1 to 6 of 6
  1. #1
    ilikepiehehe's Avatar Sergeant
    Reputation
    1
    Join Date
    Feb 2013
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question] Larger Aggro Range?

    I want to make these npcs spawn on top of wintergrasp fortress but since there all the way up there they don't aggro is there a way to make them aggro from a farther range? King of the the Bowman in AV.

    [Question] Larger Aggro Range?
  2. #2
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Currently aggro range is based on a formula given in creature class. You would need to make a custom flag to set this if the creature is flagged for a different aggro range to the default formula.

  3. #3
    ilikepiehehe's Avatar Sergeant
    Reputation
    1
    Join Date
    Feb 2013
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So i'm new to this and have no idea how to do this...How would i go about making the aggro range larger step by step

  4. #4
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ilikepiehehe View Post
    So i'm new to this and have no idea how to do this...How would i go about making the aggro range larger step by step
    What emulator are you using? You will need C++ knowledge to implement what you want but I will show you where it is handled.

  5. #5
    ilikepiehehe's Avatar Sergeant
    Reputation
    1
    Join Date
    Feb 2013
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use Arcemu

  6. #6
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ilikepiehehe View Post
    I use Arcemu
    Inside AIInterface.cpp you will find the code to calculate aggro range:

    Code:
    float AIInterface::_CalcAggroRange(Unit* target)
    {
    	//float baseAR = 15.0f; // Base Aggro Range
    	//                    -8     -7     -6      -5    -4      -3     -2     -1     0      +1     +2     +3    +4     +5     +6     +7    +8
    	//float baseAR[17] = {29.0f, 27.5f, 26.0f, 24.5f, 23.0f, 21.5f, 20.0f, 18.5f, 17.0f, 15.5f, 14.0f, 12.5f, 11.0f,  9.5f,  8.0f,  6.5f, 5.0f};
    	float baseAR[17] = {19.0f, 18.5f, 18.0f, 17.5f, 17.0f, 16.5f, 16.0f, 15.5f, 15.0f, 14.5f, 12.0f, 10.5f, 8.5f,  7.5f,  6.5f,  6.5f, 5.0f};
    	// Lvl Diff -8 -7 -6 -5 -4 -3 -2 -1 +0 +1 +2  +3  +4  +5  +6  +7  +8
    	// Arr Pos   0  1  2  3  4  5  6  7  8  9 10  11  12  13  14  15  16
    	int8 lvlDiff = static_cast<int8>(target->getLevel() - m_Unit->getLevel());
    	uint8 realLvlDiff = lvlDiff;
    	if(lvlDiff > 8)
    	{
    		lvlDiff = 8;
    	}
    	if(lvlDiff < -8)
    	{
    		lvlDiff = -8;
    	}
    	if(!TO_CREATURE(m_Unit)->CanSee(target))
    		return 0;
    
    	// Retrieve aggrorange from table
    	float AggroRange = baseAR[lvlDiff + 8];
    
    	// Check to see if the target is a player mining a node
    	bool isMining = false;
    	if(target->IsPlayer())
    	{
    		if(target->IsCasting())
    		{
    			// If nearby miners weren't spotted already we'll give them a little surprise.
    			Spell* sp = target->GetCurrentSpell();
    			if(sp->GetProto()->Effect[0] == SPELL_EFFECT_OPEN_LOCK && sp->GetProto()->EffectMiscValue[0] == LOCKTYPE_MINING)
    			{
    				isMining = true;
    			}
    		}
    	}
    
    	// If the target is of a much higher level the aggro range must be scaled down, unless the target is mining a nearby resource node
    	if(realLvlDiff > 8 && !isMining)
    	{
    		AggroRange += AggroRange * ((lvlDiff - 8) * 5 / 100);
    	}
    
    	// Multiply by elite value
    	if(m_Unit->IsCreature() && TO_CREATURE(m_Unit)->GetCreatureInfo()->Rank > 0)
    	{
    		AggroRange *= (TO_CREATURE(m_Unit)->GetCreatureInfo()->Rank) * 1.50f;
    	}
    
    	// Cap Aggro range at 40.0f
    	if(AggroRange > 40.0f)
    	{
    		AggroRange = 40.0f;
    	}
    
    	/*  //printf("aggro range: %f , stealthlvl: %d , detectlvl: %d\n",AggroRange,target->GetStealthLevel(),m_Unit->m_stealthDetectBonus);
    		if(! ((Creature*)m_Unit)->CanSee(target))
    		{
    			AggroRange = 0;
    		//	AggroRange *= ( 100.0f - (target->m_stealthLevel - m_Unit->m_stealthDetectBonus)* 20.0f ) / 100.0f;
    		}
    	*/
    
    	// SPELL_AURA_MOD_DETECT_RANGE
    	int32 modDetectRange = target->getDetectRangeMod(m_Unit->GetGUID());
    	AggroRange += modDetectRange;
    	if(target->IsPlayer())
    	{
    		AggroRange += TO< Player* >(target)->DetectedRange;
    	}
    
    	// Re-check if aggro range exceeds Minimum/Maximum caps
    	if(AggroRange < 3.0f)
    	{
    		AggroRange = 3.0f;
    	}
    	if(AggroRange > 40.0f)
    	{
    		AggroRange = 40.0f;
    	}
    
    	return (AggroRange * AggroRange);
    }
    So you would add something like, before the final return:

    Code:
    if (m_Unit->GetEntry() == 10181)
         AggroRange = 5f;
    return (AggroRange * AggroRange);
    This is a very hacky and hardcoded fix. If the units entry is 10181, then set the aggro range to 5f. This is a guessed value, and guessed API. It is only showing you the concept of what you need to do. A real solution would be to check if the creature has a flag (a new flag in creature_proto or whatever you want to implement) then to use that flag to calculate a new aggro range.

Similar Threads

  1. [QUESTION] Aggroing more mobs than wanted/ How to make them yellow?
    By Romis in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-01-2008, 06:44 AM
  2. [Problem] Massive aggro range?
    By foamysquirl in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 02-22-2008, 08:18 PM
  3. [Question] Range markings around enemies.
    By sigi in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 11-08-2007, 05:43 AM
  4. [Question] Is it possible to make an model larger?
    By Wiseguy in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 10-11-2007, 07:55 PM
  5. Question on agrgo range
    By crwilborn in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 09-23-2007, 01:03 AM
All times are GMT -5. The time now is 08:03 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search