extern void InitNations(); #event_handler(GET_RELATION_EVENT,"GetRelationEvent"); void Nations_SetAllFriends() { int i; for(i=0;i= 0) { rCharacter = GetCharacter(sti(rCharacter.relation.UseOtherCharacter)); } } int iMCI = GetMainCharacterIndex(); int iNation2 = sti(rCharacter.nation); if (iMCI == sti(rCharacter.index)) { return NationsRelations2MainCharacter[iNation]; } return NationsRelations[iNation * MAX_NATIONS + iNation2]; } int GetRelation(int iCharacterIndex1, int iCharacterIndex2) { int iMCI = GetMainCharacterIndex(); ref rCharacter1 = GetCharacter(iCharacterIndex1); ref rCharacter2 = GetCharacter(iCharacterIndex2); if (CheckAttribute(&rCharacter1, "relation.UseOtherCharacter")) { if (sti(rCharacter1.relation.UseOtherCharacter) >= 0) { rCharacter1 = GetCharacter(sti(rCharacter1.relation.UseOtherCharacter)); } } if (CheckAttribute(&rCharacter2, "relation.UseOtherCharacter")) { if (sti(rCharacter2.relation.UseOtherCharacter) >= 0) { rCharacter2 = GetCharacter(sti(rCharacter2.relation.UseOtherCharacter)); } } if (rCharacter1.index == rCharacter2.index) return RELATION_FRIEND; // character 2 character relation { string sTemp = "relation." + rCharacter2.index; if (CheckAttribute(&rCharacter1,sTemp)) { return sti(rCharacter1.(sTemp)); } } //Trace("iNation1 = " + iNation1 + ", iNation2 = " + iNation2); int iNation1 = sti(rCharacter1.nation); int iNation2 = sti(rCharacter2.nation); // nation 2 character relation if (iMCI == sti(rCharacter1.index)) { //Trace("iMainCharacterRelation = " + NationsRelations2MainCharacter[iNation2]); return NationsRelations2MainCharacter[iNation2]; } if (iMCI == sti(rCharacter2.index)) { //Trace("iMainCharacterRelation = " + NationsRelations2MainCharacter[iNation1]); return NationsRelations2MainCharacter[iNation1]; } // nation 2 nation relation return NationsRelations[iNation1 * MAX_NATIONS + iNation2]; } int GetRelationEvent() { int iCharacterIndex1 = GetEventData(); int iCharacterIndex2 = GetEventData(); return GetRelation(iCharacterIndex1, iCharacterIndex2); } int FindEnemyNation2Nation(int iNation) { int iNations[MAX_NATIONS]; int iNumNations = 0; for (int i=0;i