mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-28 22:15:54 -04:00
94 lines
2.6 KiB
Plaintext
94 lines
2.6 KiB
Plaintext
/* Copyright (c) ©2000,2001 Sony Online Entertainment Inc.
|
|
* All Rights Reserved
|
|
*
|
|
* Title: qabuff.script
|
|
* Description: QA script used to test buffs
|
|
* @author $Author: Jeff Haskell $
|
|
* @version $Revision: #2 $
|
|
*/
|
|
|
|
/**********************************************************
|
|
* Inlcudes
|
|
**********************************************************/
|
|
|
|
include library.sui;
|
|
include library.qa;
|
|
include library.utils;
|
|
|
|
/***********************************************************
|
|
* Constants
|
|
***********************************************************/
|
|
|
|
const string MY_SCRIPTVAR = "qabuff";
|
|
const string BUFF_TABLE = "datatables/buff/buff.iff";
|
|
const string BUFF_TOOL_PROMPT = "Select Spacial Attack or Buff to be performed on your test character.\n\nTo remove all buffs use the command:\n\n/qatool buff clear";
|
|
const string BUFF_TOOL_TITLE = "Special Attack & Buff Tool";
|
|
|
|
|
|
trigger OnAttach()
|
|
{
|
|
if (isGod(self))
|
|
{
|
|
if(getGodLevel(self) < 10)
|
|
{
|
|
detachScript(self, "test.qabuff");
|
|
sendSystemMessage(self, "You do not have the appropriate access level to use this script.", null);
|
|
}
|
|
}
|
|
else if (!isGod(self))
|
|
{
|
|
detachScript(self, "test.qabuff");
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
messageHandler buffOptionHandler()
|
|
{
|
|
if (isGod(self))
|
|
{
|
|
if (utils.hasScriptVar( self, MY_SCRIPTVAR + ".pid"))
|
|
{
|
|
qa.checkParams(params, "bufftool");
|
|
int idx = sui.getListboxSelectedRow(params);
|
|
int btn = sui.getIntButtonPressed(params);
|
|
|
|
string previousMainMenuArray[] = utils.getStringArrayScriptVar( self, MY_SCRIPTVAR + ".buffMenu" );
|
|
|
|
if (btn == sui.BP_CANCEL)
|
|
{
|
|
utils.removeScriptVarTree(self, MY_SCRIPTVAR);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
else if(btn == sui.BP_REVERT)
|
|
{
|
|
utils.removeScriptVarTree(self, MY_SCRIPTVAR);
|
|
string[] tool_options = dataTableGetStringColumn("datatables/test/qa_tool_menu.iff", "main_tool");
|
|
qa.refreshMenu(self, "Choose the tool you want to use", "QA Tools", tool_options, "toolMainMenu", true, "qatool.pid");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
else
|
|
{
|
|
string buffArg = previousMainMenuArray[idx];
|
|
string buffName = qa.getClientBuffName(self, buffArg);
|
|
if (buffName != "null")
|
|
{
|
|
qa.applyBuffOption(self, buffArg, buffName);
|
|
createMainMenu(self);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void createMainMenu(obj_id self)
|
|
{
|
|
string[] allBuffs = dataTableGetStringColumn(BUFF_TABLE, "NAME");
|
|
Arrays.sort(allBuffs);
|
|
|
|
utils.setScriptVar(self, "qabuff.buffMenu", allBuffs);
|
|
qa.refreshMenu (self, BUFF_TOOL_PROMPT, BUFF_TOOL_TITLE, allBuffs, "buffOptionHandler", "qabuff.pid", sui.OK_CANCEL_REFRESH );
|
|
} |