Project 1999

Go Back   Project 1999 > Red Community > Red Server Chat

View Poll Results: Should Classic NPC faction mechanics be in?
Yes, faction assist should be in 58 92.06%
No, npc's should not ever agro faction differences 5 7.94%
Voters: 63. You may not vote on this poll

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 09-21-2011, 11:45 AM
gloinz gloinz is offline
Planar Protector

gloinz's Avatar

Join Date: Aug 2011
Posts: 1,003
Default

Quote:
Originally Posted by naez [You must be logged in to view images. Log in or Register.]
Bros I always like when you bring these riddles to my attention. of course i fixed the fansy rivervale carnage exploit



attack.cpp (edit Mob::CommonDamage() line 1)
PHP Code:
// void Mob::CommonDamage(Mob* attacker, sint32 &damage, const int16 spell_id /* */) {
    // This method is called with skill_used=ABJURE for Damage Shield damage. 
    
bool FromDamageShield = (skill_used == ABJURE);
    if (
this->IsClient() && attacker->IsClient() && !FromDamageShield)
        
entity_list.CheckFactionBurnAggro(thisattacker); 
aggro.cpp (add 3 new methods)
PHP Code:
void EntityList::CheckFactionBurnAggro(Client *victimClient *attacker)
{
    
LinkedListIterator<Mob*> iterator(mob_list);
    for(
iterator.Reset(); iterator.MoreElements(); iterator.Advance()) {
        
Mobmob iterator.GetData();
        if(
mob->IsNPC() 
            && 
attacker->CheckAggroRange(mob)
            && 
attacker->CheckFactionBurn(victimmob)
            && 
attacker->CheckLosFN(mob)) // check LoS last for performance
        
{
            
mob->AddToHateList(attacker);
        }
    }

PHP Code:
// returns true if the attacker should get aggroed for attacking the victim
bool Client::CheckFactionBurn(Client *victimMob *Mob)
{
    
FACTION_VALUE fv_attacker this->GetReverseFactionCon(mob);
    
FACTION_VALUE fv_victim victim->GetReverseFactionCon(mob);

    return (
fv_victim fv_attacker); // 1 = Ally, 6 = Scowls... could be <= ??

PHP Code:
bool Mob::CheckAggroRange(Mobmob)
{
    
float iAggroRange GetAggroRange();

    
float t1t2t3;
    
t1 mob->GetX() - GetX();
    
t2 mob->GetY() - GetY();
    
t3 mob->GetZ() - GetZ();
    
//Cheap ABS()
    
if(t1 0)
        
t1 t1;
    if(
t2 0)
        
t2 t2;
    if(
t3 0)
        
t3 t3;

    if(( 
t1 iAggroRange) || ( t2 iAggroRange) || ( t3 iAggroRange))
        return 
false;

    
float dist2  mob->DistNoRoot(*this);
    
float iAggroRange2 iAggroRange*iAggroRange;

    if( 
dist2 iAggroRange2 )
        return 
false;

    return 
true;

looks legit
all the fat ogres better watch out cuz noone like u cuz ur fat
__________________
Griefer of Greenie, 1999-2003
PvP Champ, 2003-2005
Senior Vice President, <PvP Champs> 2006-Present
Closed Thread


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 11:03 PM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.