mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
79 lines
2.0 KiB
Plaintext
79 lines
2.0 KiB
Plaintext
|
|
include library.group;
|
|
include library.space_combat;
|
|
include library.money;
|
|
include library.utils;
|
|
|
|
trigger OnGetAttributes(obj_id player, string[] names, string[] attribs)
|
|
{
|
|
int intCredits = getIntObjVar(self, "loot.intCredits");
|
|
|
|
int idx = utils.getValidAttributeIndex(names);
|
|
if (idx == -1)
|
|
return SCRIPT_CONTINUE;
|
|
names[idx] = "amount";
|
|
attribs[idx] = Integer.toString(intCredits);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
trigger OnObjectMenuSelect(obj_id player, int item)
|
|
{
|
|
obj_id objTopmostContainer = utils.getContainingPlayer(self);
|
|
if(objTopmostContainer!=player)
|
|
{
|
|
LOG("space", "container is "+objTopmostContainer);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if ( item == menu_info_types.ITEM_USE )
|
|
{
|
|
int intCredits = getIntObjVar(self, "loot.intCredits");
|
|
money.bankTo("space_loot", player, intCredits);
|
|
destroyObject(self);
|
|
|
|
}
|
|
/*
|
|
else if(item==menu_info_types.SPLIT)
|
|
{//{ THIS STUFF DOESN'T FUCKING WORK. THE GROUP MONEY FUNCTIONS EAT CASH. THIS SUCKS
|
|
int intCredits = getIntObjVar(self, "loot.intCredits");
|
|
string_id strPayout = new string_id("space/space_loot", "group_credit_payout");
|
|
group.systemPayoutToGroup("space_loot", player, intCredits, strPayout, null, null);
|
|
destroyObject(self);
|
|
}
|
|
*/
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
trigger OnObjectMenuRequest (obj_id objPlayer, menu_info mi)
|
|
{
|
|
|
|
|
|
// somethign about groups here
|
|
//obj_id objGroup = getGroupObject(objPlayer);
|
|
|
|
//if(isIdValid(objGroup))
|
|
//{ THIS STUFF DOESN'T FUCKING WORK. THE GROUP MONEY FUNCTIONS EAT CASH. THIS SUCKS
|
|
// mi.addRootMenu(menu_info_types.SPLIT, new string_id("space/space_loot", "split_with_group"));
|
|
//}
|
|
mi.addRootMenu(menu_info_types.ITEM_USE, new string_id("space/space_loot", "use_credit_chip"));
|
|
|
|
return SCRIPT_CONTINUE;
|
|
|
|
|
|
}
|
|
/*
|
|
|
|
// when put into someone's invnetory, we check for auto stacking.
|
|
|
|
trigger OnTransferred(obj_id objSource, obj_id objDest , obj_id objTransferer)
|
|
{
|
|
obj_id objOwner = getContainedBy(objDest);
|
|
if(isPlayer(objOwner))
|
|
{
|
|
space_combat.handleCreditChips(objOwner, self, objSource);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
*/ |