// gradual reputation improvement // will gradually improve reputation of Merchant, CityGuard, and Mage Guild factions // towards a player. These factions are important to game play so, it is important that // they eventually forgive or forget a PCs actions towards them. void main() { object oMerch; object oGuard; object oMage; object oPC; object oWP=GetWaypointByTag("UND_RESOURCES"); object oFaction; object oCreature=CreateObject(OBJECT_TYPE_CREATURE,"nw_stirge",GetLocation(oWP)); int nRep; object oMyTeam; float fDist; string sID; if (GetFirstPC()!=OBJECT_INVALID) { // PCs are connected oGuard=GetObjectByTag("CityGuard"); oMage=GetObjectByTag("MGS1"); oMerch=GetObjectByTag("Wizard"); if (oMage==OBJECT_INVALID) oMage=GetObjectByTag("MGS2"); if (oMage==OBJECT_INVALID) oMage=GetObjectByTag("MGS3"); oPC=GetFirstPC(); while(oPC!=OBJECT_INVALID) { // reputation adjust if (GetIsDM(oPC)==FALSE) { // not DM if (oGuard!=OBJECT_INVALID) { // city guards nRep=GetReputation(oGuard,oPC); if (nRep<35) { // adjust nRep=nRep+1; AdjustReputation(oPC,oGuard,nRep); } // adjust if (nRep>34) { // clear personal reputation oFaction=GetFirstFactionMember(oGuard,FALSE); while(oFaction!=OBJECT_INVALID) { // adjust faction ClearPersonalReputation(oPC,oFaction); oFaction=GetNextFactionMember(oGuard,FALSE); } // adjust faction } // clear personal reputation } // city guards if (oMage!=OBJECT_INVALID) { // mages nRep=GetReputation(oMage,oPC); if (nRep<35) { // adjust nRep=nRep+1; AdjustReputation(oPC,oMage,nRep); } // adjust if (nRep>34) { // clear personal reputation oFaction=GetFirstFactionMember(oMage,FALSE); while(oFaction!=OBJECT_INVALID) { // adjust faction ClearPersonalReputation(oPC,oFaction); oFaction=GetNextFactionMember(oMage,FALSE); } // adjust faction } // clear personal reputation } // mages if (oMerch!=OBJECT_INVALID) { // merchants nRep=GetReputation(oMerch,oPC); if (nRep<35) { // adjust nRep=nRep+2; AdjustReputation(oPC,oMerch,nRep); } // adjust if (nRep>34) { // clear personal reputation oFaction=GetFirstFactionMember(oMerch,FALSE); while(oFaction!=OBJECT_INVALID) { // adjust faction ClearPersonalReputation(oPC,oFaction); oFaction=GetNextFactionMember(oMerch,FALSE); } // adjust faction } // clear personal reputation } // merchants ClearPersonalReputation(oPC,oCreature); AdjustReputation(oPC,oCreature,0); } // not DM oPC=GetNextPC(); } // reputation adjust DestroyObject(oCreature); } // PCs are connected }