View Single Post
  #22  
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