dclark
02-02-2006, 08:45 AM
For starters I have the peq-velious DB and latest 0.6.4 source. I when running around eastwastes when I came to the orc fort. I saw it was setup as if the 8th ring quest was starting. Well I changed this and add quests to start this and not have the fort in a constant start of war. I got to the point where the dwarfs and orcs/giants would charge one another, but the dwarfs would do more damage to themselfs than they would to the orcs/giants. I came to find out that if I took out the healers the palies and priests then all was fine, so something was wrong with the casters. I did alot of digging though the code and decided to add debug messages everywhere someone was added to the hatelist. I found out if an npc healed himself or anyone all npcs around him friend or foe added him to their hatelist. Well this realy goes bad for an event like this when friends attack friends. I added this code to entity.cpp about line 2650 in void EntityList::AddHealAggro(Mob* target, Mob* caster, int16 thedam).
while(iterator.MoreElements())
{
cur = iterator.GetData();
if (!cur->GetOwnerID() && !cur->IsMezzed() && !cur->IsStunned()
&& cur->CheckAggro(target))
{
int16 tmpd = thedam;
if (cur->GetHateAmount(caster) < 100)
tmpd /= 20;
// This is the start
if(cur->GetPrimaryFaction() == caster->GetPrimaryFaction() ||
cur->IsFactionListAlly(caster->GetPrimaryFaction()))
{
LogFile->write(EQEMuLog::Debug, "I %s won't attack %s because we are friends",
cur->GetName(), caster->GetName());
}
else if(cur->GetOwnerID() == caster->GetOwnerID())
{
LogFile->write(EQEMuLog::Debug, "I %s am not a masticist",
cur->GetName());
}
else
{
cur->AddToHateList(caster, tmpd);
LogFile->write(EQEMuLog::Debug, "I %s don't like %s because he healed %s",
cur->GetName(), caster->GetName(), caster->GetTarget());
}//ending right here
}
iterator.Advance();
}
This keeps any npc on the same primary faction from being added to the hatelist and any faction that is allied with them. I am not so sure the else if statment is need. If they heal themselfs it would get added to their own hatelist. Never didn't see one attack themselfs I think the code prevents that elsewhere.
while(iterator.MoreElements())
{
cur = iterator.GetData();
if (!cur->GetOwnerID() && !cur->IsMezzed() && !cur->IsStunned()
&& cur->CheckAggro(target))
{
int16 tmpd = thedam;
if (cur->GetHateAmount(caster) < 100)
tmpd /= 20;
// This is the start
if(cur->GetPrimaryFaction() == caster->GetPrimaryFaction() ||
cur->IsFactionListAlly(caster->GetPrimaryFaction()))
{
LogFile->write(EQEMuLog::Debug, "I %s won't attack %s because we are friends",
cur->GetName(), caster->GetName());
}
else if(cur->GetOwnerID() == caster->GetOwnerID())
{
LogFile->write(EQEMuLog::Debug, "I %s am not a masticist",
cur->GetName());
}
else
{
cur->AddToHateList(caster, tmpd);
LogFile->write(EQEMuLog::Debug, "I %s don't like %s because he healed %s",
cur->GetName(), caster->GetName(), caster->GetTarget());
}//ending right here
}
iterator.Advance();
}
This keeps any npc on the same primary faction from being added to the hatelist and any faction that is allied with them. I am not so sure the else if statment is need. If they heal themselfs it would get added to their own hatelist. Never didn't see one attack themselfs I think the code prevents that elsewhere.