Created a TicketPurchaseIntent which is broadcasted upon purchasing a ticket

This commit is contained in:
Mads Boddum
2015-09-26 02:00:30 +02:00
parent 8125f0b447
commit 28bc58a055
2 changed files with 49 additions and 0 deletions
@@ -0,0 +1,10 @@
var execute = function(galManager, player, target, args) {
var TicketPurchaseIntent = Java.type("intents.travel.TicketPurchaseIntent");
params = args.split(" ");
destinationPlanet = params[2];
destinationName = params[3].replaceAll("_", " ");
roundTrip = params[4].equals("1");
new TicketPurchaseIntent(player.getCreatureObject(), destinationPlanet, destinationName, roundTrip).broadcast();
};