Files
dsrc/sku.0/sys.server/compiled/game/script/working/jmichener_test.script
T

145 lines
4.6 KiB
Plaintext

include java.util.StringTokenizer;
include java.lang.Math;
include library.ai_lib;
include library.buff;
include library.beast_lib;
include library.create;
include library.expertise;
include library.groundquests;
include library.guild;
include library.incubator;
include library.instance;
include library.npe;
include library.player_structure;
include library.pet_lib;
include library.skill;
include library.skill_template;
include library.space_combat;
include library.space_flags;
include library.space_quest;
include library.static_item;
include library.sui;
include library.transition;
include library.trial;
include library.utils;
trigger OnSpeaking(string text)
{
obj_id player = self;
if(isGod(player))
{
StringTokenizer st = new java.util.StringTokenizer(text);
int tokens = st.countTokens();
string command = null;
if (st.hasMoreTokens())
command = st.nextToken();
//Lists player's buffs in system messages.
if(command.equals("list_player_buffs"))
{
//list the buffs the player currently has on him.
int[] playerBuffs = buff.getAllBuffs(player);
string[] strPlayerBuffs = new string[playerBuffs.length];
for(int i = 0; i < playerBuffs.length; i++)
{
strPlayerBuffs[i] = buff.getBuffNameFromCrc(playerBuffs[i]);
sendSystemMessageTestingOnly(player, strPlayerBuffs[i]);
}
return SCRIPT_CONTINUE;
}
//Removes all buffs from the player
if(command.equals("remove_player_buffs"))
{
buff.removeAllBuffs(player);
sendSystemMessageTestingOnly(player, "All buffs have been removed from player");
return SCRIPT_CONTINUE;
}
//Removes only the Entertainer Timer Buff (Collections)
if(command.equals("remove_entertainer_invis_buff"))
{
buff.removeBuff(player, "col_ent_invis_buff_tracker");
sendSystemMessageTestingOnly(player, "Entertainer Timer Buff Removed(Build-A-Buff collection)");
return SCRIPT_CONTINUE;
}
//Returns whether or not the player has the Entertainer timer buff on him or not.
if(command.equals("check_has_entertainer_invis_buff"))
{
if(buff.hasBuff(player, "col_ent_invis_buff_tracker"))
{
sendSystemMessageTestingOnly(player, "player has buff: 'col_ent_invis_buff_tracker'.");
}
else
{
sendSystemMessageTestingOnly(player, "player does NOT have buff: 'col_ent_invis_buff_tracker'.");
}
return SCRIPT_CONTINUE;
}
//Removes Heroic SD Taxi Timer Buff
if(command.equals("remove_heroic_sd_invis_buff"))
{
buff.removeBuff(player, "col_sd_invis_buff_tracker");
sendSystemMessageTestingOnly(player, "Heroic SD Taxi Buff Removed");
return SCRIPT_CONTINUE;
}
//Returns whether or not the player has the Heroic SD Taxi Timer Buff on him or not.
if(command.equals("check_has_heroic_sd_invis_buff"))
{
if(buff.hasBuff(player, "col_sd_invis_buff_tracker"))
{
sendSystemMessageTestingOnly(player, "player has buff: 'col_sd_invis_buff_tracker'.");
}
else
{
sendSystemMessageTestingOnly(player, "player does NOT have buff: 'col_sd_invis_buff_tracker'.");
}
return SCRIPT_CONTINUE;
}
//Used to bypass the roll for the Exceptional Harvest Collections (Meat, Hide and Bone)
if(command.equals("bypass_harvest_roll"))
{
utils.setScriptVar(player, "qa.resource_roll_bypass", "testing");
sendSystemMessageTestingOnly(player, "resource roll has been bypassed - drop rate for exceptionals is 100%");
}
//Return the Exceptional Harvest Collection Roll to normal
if(command.equals("remove_bypass_harvest_roll"))
{
utils.removeScriptVar(player, "qa.resource_roll_bypass");
sendSystemMessageTestingOnly(player, "resource roll has been negated - drop rate for exceptionals is no longer bypassed");
}
if(command.equals("durni"))
{
location myLoc = getLocation(self);
create.object("durni", myLoc, true);
sendSystemMessageTestingOnly(player, "you created a durni");
}
if(command.equals("stop_regen"))
{
float QARegenRate = getActionRegenRate(player);
//Store the objvar on the character to restore later
setObjVar(player, "QARegenRate", QARegenRate);
//this is a SET
getActionRegenRate(player, 0);
sendSystemMessageTestingOnly(player, "Your Regen Rate has been set to Zero!");
}
if(command.equals("restore_regen"))
{
float myStoredRegen = getFloatObjVar(player, "QARegenRate");
getActionRegenRate(player, myStoredRegen);
removeObjVar(self, "QARegenRate");
if(!hasObjVar(player, "QARegenRate"))
{
sendSystemMessageTestingOnly(player, "Your Action Regen Rate has been restored");
}
else
{
sendSystemMessageTestingOnly(player, "Problem - Regen Rate was not restored!");
}
}
}
return SCRIPT_CONTINUE;
}