Files
dsrc/sku.0/sys.server/compiled/game/script/test/tford_test.script
T
2013-09-10 23:17:15 -07:00

177 lines
4.8 KiB
Plaintext

include library.colors;
include library.combat;
include library.money;
include library.quests;
include library.sui;
include library.hue;
include library.utils;
//----------------------------------------------------------------------
trigger OnLootLotterySelected(obj_id target_id, obj_id[] selection_ids)
{
debugConsoleMsg(self, "loot lottery by " + self + " for " + target_id);
debugSpeakMsg (self, "selected items:" );
for (int i = 0; i < selection_ids.length; ++i )
{
obj_id item = selection_ids[i];
debugSpeakMsg (self, "[" + item + "]");
}
return SCRIPT_CONTINUE;
}
//----------------------------------------------------------------------
trigger OnHearSpeech(obj_id speaker, string text)
{
if(speaker == self)
return SCRIPT_CONTINUE;
if(text == "tauntme")
{
prose_package pp = new prose_package ();
pp.stringId = new string_id ("ui", "test_pp");
pp.actor.set (self);
pp.target.set (self);
pp.other.set ("other_here");
pp.digitInteger = 666;
pp.digitFloat = 0.333f;
dogfightTauntPlayer(self, speaker, pp);
}
return SCRIPT_CONTINUE;
}
//----------------------------------------------------------------------
trigger OnSpeaking(String text)
{
if(isGod(self))
{
debugConsoleMsg( self, "tford_test OnSpeaking: " + text );
java.util.StringTokenizer tok = new java.util.StringTokenizer (text);
if (tok.hasMoreTokens ())
{
String command = tok.nextToken ();
debugConsoleMsg( self, "command is: " + command);
//----------------------------------------------------------------------
if (command.equals("tmf_showLotteryMyInventory"))
{
//debugConsoleMsg(self, "tmf_showLotteryMyInventory");
//obj_id inventory = utils.getInventoryContainer(self);
//queueCommand(self, ##"openLotteryContainer", inventory, "", COMMAND_PRIORITY_DEFAULT);
}
else if (command.equals("tmf_pvpPrepareToBeCovert"))
{
debugConsoleMsg(self, "pvpPrepareToBeCovert");
pvpPrepareToBeCovert(self);
}
else if (command.equals("tmf_pvpPrepareToBeDeclared"))
{
debugConsoleMsg(self, "pvpPrepareToBeDeclared");
pvpPrepareToBeDeclared(self);
}
else if (command.equals("tmf_pvpPrepareToBeNeutral"))
{
debugConsoleMsg(self, "pvpPrepareToBeNeutral");
pvpPrepareToBeNeutral(self);
}
if (command.equals("tmf_hideFromClient"))
{
debugConsoleMsg(self, "hit tmf_hideFromClient");
obj_id target = getLookAtTarget(self);
hideFromClient(target, true);
}
if (command.equals("tmf_noHideFromClient"))
{
debugConsoleMsg(self, "hit tmf_noHideFromClient");
obj_id target = getLookAtTarget(self);
hideFromClient(target, false);
}
else if (command.equals("tmf_makePrivate"))
{
debugConsoleMsg(self, "hit tmf_makePrivate");
location here = getLocation(self);
obj_id target = here.cell;
permissionsMakePrivate(target);
}
else if (command.equals("tmf_makePublic"))
{
debugConsoleMsg(self, "hit tmf_makePublic");
location here = getLocation(self);
obj_id target = here.cell;
permissionsMakePublic(target);
}
/*
if (command.equals("tmf_addMissionCriticalShip"))
{
debugConsoleMsg(self, "hit tmf_addMissionCriticalShip");
obj_id ship = getLookAtTarget(self);
obj_id myship = getPilotedShip(self);
addMissionCriticalShip(myship, ship);
}
else if (command.equals("tmf_removeMissionCriticalShip"))
{
debugConsoleMsg(self, "hit tmf_removeMissionCriticalShip");
obj_id ship = getLookAtTarget(self);
obj_id myship = getPilotedShip(self);
removeMissionCriticalShip(myship, ship);
}
else if (command.equals("tmf_clearMissionCriticalShips"))
{
debugConsoleMsg(self, "hit tmf_clearMissionCriticalShips");
obj_id myship = getPilotedShip(self);
clearMissionCriticalShips(myship);
}
*/
}
}
return SCRIPT_CONTINUE;
}
//----------------------------------------------------------------------
trigger OnAttach()
{
debugSpeakMsg(self, "tford_test.script attached");
return SCRIPT_CONTINUE;
}
//----------------------------------------------------------------------
trigger OnLocomotionChanged(int newLocomotion, int oldLocomotion)
{
//debugSpeakMsg (self, "OnLocomotionChanged: newLocomotion = " + newLocomotion + " newLocomotion = " + oldLocomotion);
return SCRIPT_CONTINUE;
}
//----------------------------------------------------------------------
trigger OnCombatLevelChanged(int oldCombatLevel, int newCombatLevel)
{
debugSpeakMsg(self, "oldCombatLevel = " + oldCombatLevel + " newCombatLevel = " + newCombatLevel);
return SCRIPT_CONTINUE;
}
//----------------------------------------------------------------------
/*
trigger OnPlayerSelectedMenuOnObject(int item)
{
debugSpeakMsg (self, "OnPlayerSelectedMenuOnObject: item = " + item);
return SCRIPT_CONTINUE;
}
*/
//----------------------------------------------------------------------