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

99 lines
2.6 KiB
Plaintext

include library.utils;
include library.static_item;
trigger OnSpeaking(String text)
{
if(isGod(self))
{
java.util.StringTokenizer tok = new java.util.StringTokenizer (text);
// if (tok.countTokens() == 3)
// {
String command = tok.nextToken ();
if (command.equalsIgnoreCase ("d_item"))
{
string strName = tok.nextToken();
string levelStr = tok.nextToken();
int intLevel = utils.stringToInt(levelStr);
if(strName == null || strName.equals("") || levelStr == null || levelStr.equals(""))
{
sendSystemMessageTestingOnly(self, "Use d_item itemCat intLevel");
return SCRIPT_CONTINUE;
}
obj_id inventory = utils.getInventoryContainer(self);
static_item.makeDynamicObject(strName, inventory, intLevel);
}
if(command.equalsIgnoreCase("num_combos"))
{
string numberStr1 = tok.nextToken();
string numberStr2 = tok.nextToken();
// string verbose = tok.nextToken();
int number1 = utils.stringToInt(numberStr1);
int number2 = utils.stringToInt(numberStr2);
if(numberStr1 == null || numberStr1.equals("") || numberStr2 == null || numberStr2.equals(""))
{
sendSystemMessageTestingOnly(self, "num_combos number1 number2");
return SCRIPT_CONTINUE;
}
int numCombos = 0;
for(int i = 1; i < 71; i++)
{
for(int j = 1; j < 71; j++)
{
if( (i*j) >= number1 && (i*j) <= number2)
{
numCombos++;
// if(verbose.equals("verbose") )
// {
sendSystemMessageTestingOnly(self, "Valid hit " + i +"*"+j +"= " + (i*j) );
// }
}
}
}
sendSystemMessageTestingOnly(self, "numbCombos =" + numCombos);
}
// }
if(command.equalsIgnoreCase("buildabuff"))
{
utils.removeScriptVar(self, "performance.buildabuff.modNames");
utils.removeScriptVar(self, "performance.buildabuff.modValues");
string modName1 = tok.nextToken();
string modValStr1 = tok.nextToken();
string modName2 = tok.nextToken();
string modValStr2 = tok.nextToken();
int modVal1 = utils.stringToInt(modValStr1);
int modVal2 = utils.stringToInt(modValStr2);
string[] modNames = {modName1, modName2};
float[] modVals = {modVal1, modVal2};
utils.setScriptVar(self, "performance.buildabuff.modNames", modNames);
utils.setScriptVar(self, "performance.buildabuff.modValues", modVals);
sendSystemMessageTestingOnly(self, "buildabuff!"+modName1+modVal1+modName2+modVal2);
}
if(command.equalsIgnoreCase("token_vendor_sui"))
{
dictionary d = new dictionary();
d.put("player", self);
messageTo(self, "showInventorySUI", d, 0, false);
}
}
return SCRIPT_CONTINUE;
}