I need to know if I'm reading this function right - its commented out in nw-o0_death, but I think its perfect for what I need with resetting custom factions to base reputation...
void ClearAllFactionMembers(object oMember, object oPlayer)
{
AdjustReputation(oPlayer, oMember, 100);
object oClear = GetFirstFactionMember(oMember, FALSE);
while (GetIsObjectValid(oClear) == TRUE)
{
ClearPersonalReputation(oPlayer, oClear);
oClear = GetNextFactionMember(oMember, FALSE);
}
}
If I read this correctly, it basically makes oMember "friendly" (100) to oPlayer then loops through oMember's factions and resets the faction's personal reputation in regards to oPlayer back to its baseline value.
For example, oMember's faction is "neutral" (50) towards oPlayer. oPlayer accidently hits oMember with a fireball, making oMember's faction hostile towards oPlayer. However, this function is called from oMember's OnSpellCastAt Event - setting the personal reputation of oMember to 100 regarding oPlayer. Then it loops through oMember's faction, restoring oMember and all other faction members back to the original reputaion of 50 regarding oPlayer. So everything is all peaceful again???
Modifié par Pstemarie, 21 août 2012 - 08:43 .