{
// Args
Faction otherFaction = this.arg(0, ARFaction.get(sender));
if (otherFaction == null) return;
Rel newRelation = targetRelation;
/*if ( ! them.isNormal())
{
msg("<b>Nope! You can't.");
return;
}*/
// Verify
if (otherFaction == usenderFaction)
{
msg("<b>Nope! You can't declare a relation to yourself :)");
return;
}
if (usenderFaction.getRelationWish(otherFaction) == newRelation)
{
msg("<b>You already have that relation wish set with %s.", otherFaction.getName());
return;
}
// Event
FactionsEventRelationChange event = new FactionsEventRelationChange(sender, usenderFaction, otherFaction, newRelation);
event.run();
if (event.isCancelled()) return;
newRelation = event.getNewRelation();
// try to set the new relation
usenderFaction.setRelationWish(otherFaction, newRelation);
Rel currentRelation = usenderFaction.getRelationTo(otherFaction, true);
// if the relation change was successful
if (newRelation == currentRelation)
{
otherFaction.msg("%s<i> is now %s.", usenderFaction.describeTo(otherFaction, true), newRelation.getDescFactionOne());