mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-27 13:13:10 -04:00
75 lines
1.6 KiB
Plaintext
75 lines
1.6 KiB
Plaintext
include library.prose;
|
|
include library.utils;
|
|
include library.stealth;
|
|
|
|
// Holographic Environment Projector
|
|
const java.text.NumberFormat floatFormat = new java.text.DecimalFormat("###.##");
|
|
|
|
trigger OnGetAttributes(obj_id player, string[] names, string[] attribs)
|
|
{
|
|
int free = getFirstFreeIndex(names);
|
|
if (free == -1)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
names[free] = "power";
|
|
attribs[free++] = "" + getCount(self);
|
|
|
|
names[free] = "effectiveness";
|
|
attribs[free++] = "" + floatFormat.format(getIntObjVar(self, stealth.HEP_EFFECTIVENESS) / 10) + "%";
|
|
|
|
utils.addClassRequirementAttributes(player, self, names, attribs, free, "");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnObjectMenuRequest(obj_id player, menu_info mi)
|
|
{
|
|
if(!utils.isNestedWithin(self, player))
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
|
|
if(!utils.testItemClassRequirements(player, self, true, ""))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
if(!utils.testItemLevelRequirements(player, self, true, ""))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
menu_info_data mid2 = mi.getMenuItemByType(menu_info_types.ITEM_USE);
|
|
if(mid2 != null )
|
|
{
|
|
mid2.setServerNotify(true);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnObjectMenuSelect(obj_id player, int item)
|
|
{
|
|
if(item == menu_info_types.ITEM_USE)
|
|
{
|
|
if(!utils.isNestedWithin(self, player))
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
|
|
if(!utils.testItemClassRequirements(player, self, true, ""))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
if(!utils.testItemLevelRequirements(player, self, true, ""))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
queueCommand(player, getStringCrc(toLower("urbanStealth")), self, "", COMMAND_PRIORITY_NORMAL);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
} |