mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-28 22:15:54 -04:00
27 lines
651 B
Plaintext
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;
|
|
}
|