# setFactionRelation

<p class="callout info">An eventCall to force an emotion between an instigating and target faction in an idEncounterManager.</p>

## Usage

```
item[0] = {
	eventCall = {
		eventDef = "setFactionRelation";
		args = {
			num = 4;
			item[0] = {
				eEncounterSpawnType_t = ""; // instigatorSpawnType
			}
			item[1] = {
				string = ""; // groupLabel
			}
			item[2] = {
				eEncounterSpawnType_t = ""; // targetSpawnType
			}
			item[3] = {
				socialEmotion_t = ""; // relation
			}
		}
	}
}
```

- `instigatorSpawnType` is the ai type for the instigator.
- `targetSpawnType` is the ai type for the target.
- `relation` is the [`socialEmotion_t`](https://wiki.eternalmods.com/books/entities-custom-encounters/page/socialemotion-t) (emotion) that the instigator feels towards the target.

<p class="callout info">The set emotion is only for the instigator towards the target. The target does not automatically reciprocate the same set emotion.</p>

## Example Usage

```
item[0] = {
	eventCall = {
		eventDef = "setFactionRelation";
		args = {
			num = 4;
			item[0] = {
				eEncounterSpawnType_t = "ENCOUNTER_SPAWN_BARON"; // instigatorSpawnType
			}
			item[1] = {
				string = ""; // groupLabel
			}
			item[2] = {
				eEncounterSpawnType_t = "ENCOUNTER_SPAWN_IMP ENCOUNTER_SPAWN_HELL_SOLDIER"; // targetSpawnType
			}
			item[3] = {
				socialEmotion_t = "EMOTION_DESTROY_AT_ALL_COSTS"; // relation
			}
		}
	}
}
item[1] = {
	eventCall = {
		eventDef = "setFactionRelation";
		args = {
			num = 4;
			item[0] = {
				eEncounterSpawnType_t = "ENCOUNTER_SPAWN_IMP ENCOUNTER_SPAWN_HELL_SOLDIER"; // instigatorSpawnType
			}
			item[1] = {
				string = ""; // groupLabel
			}
			item[2] = {
				eEncounterSpawnType_t = "ENCOUNTER_SPAWN_BARON"; // targetSpawnType
			}
			item[3] = {
				socialEmotion_t = "EMOTION_DESTROY_AT_ALL_COSTS"; // relation
			}
		}
	}
}
```

In this example, Barons are set to `EMOTION_DESTROY_AT_ALL_COSTS` against Imps/Soldiers, and vice versa. This results in forced infighting between Barons and Imps/Soldiers.

## See Also

- [clearFactionOverrides](https://wiki.eternalmods.com/books/entities-custom-encounters/page/clearfactionoverrides)