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

27 lines
651 B
Plaintext

trigger OnObjectMenuSelect(obj_id player, int item)
{
LOG("tony_test", "player " + player + " item " + item);
if (item == menu_info_types.ITEM_PUBLIC_CONTAINER_USE1)
debugSpeakMsg(player, "You just purchased " + self + "!");
return SCRIPT_CONTINUE;
}
trigger OnGetAttributes(obj_id player, string[] names, string[] attribs)
{
if (names == null || attribs == null || names.length != attribs.length)
return SCRIPT_CONTINUE;
const int firstFreeIndex = getFirstFreeIndex(names);
if (firstFreeIndex >= 0 && firstFreeIndex < names.length)
{
names[firstFreeIndex] = "cost";
attribs[firstFreeIndex] = "42";
}
return SCRIPT_CONTINUE;
}