mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-08-02 03:16:42 -04:00
31 lines
1.0 KiB
Groovy
31 lines
1.0 KiB
Groovy
import java.lang.String
|
|
import intents.FactionIntent
|
|
import resources.PvpFaction
|
|
import resources.objects.SWGObject
|
|
import resources.player.Player
|
|
import services.galaxy.GalacticManager
|
|
import utilities.IntentFactory
|
|
|
|
|
|
static def execute(GalacticManager galacticManager, Player player, SWGObject target, String args) {
|
|
def creature = player.getCreatureObject()
|
|
def intent = null
|
|
|
|
// Ziggy was using this to test until recruiters are enabled.
|
|
|
|
if (!args.isEmpty()) {
|
|
if (args.indexOf("imperial") > -1) {
|
|
intent = new FactionIntent(creature, PvpFaction.IMPERIAL)
|
|
} else if (args.indexOf("rebel") > -1) {
|
|
intent = new FactionIntent(creature, PvpFaction.REBEL)
|
|
} else {
|
|
intent = new FactionIntent(creature, PvpFaction.NEUTRAL)
|
|
}
|
|
intent.broadcast()
|
|
} else if (creature.getPvpFaction() != PvpFaction.NEUTRAL) {
|
|
intent = new FactionIntent(creature, FactionIntent.FactionIntentType.SWITCHUPDATE)
|
|
intent.broadcast()
|
|
} else {
|
|
IntentFactory.sendSystemMessage(player, "@faction_recruiter:not_aligned")
|
|
}
|
|
} |