mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-07-31 01:15:55 -04:00
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
|
|
/***** INCLUDES ********************************************************/
|
|
|
|
include library.utils;
|
|
include library.prose;
|
|
include library.group;
|
|
|
|
/***** CONSTANTS *******************************************************/
|
|
|
|
const string STF_SPAM = "spam";
|
|
|
|
const string_id PROSE_LOOT_ITEM_SELF = new string_id(STF_SPAM, "loot_item_self");
|
|
const string_id PROSE_LOOT_ITEM_OTHER = new string_id(STF_SPAM, "loot_item_other");
|
|
|
|
/***** FUNCTIONS *******************************************************/
|
|
void lootItem(obj_id player, obj_id item, obj_id corpseId, boolean toGroup)
|
|
{
|
|
if ( !isIdValid(player) || !isIdValid(item) || !isIdValid(corpseId) )
|
|
return;
|
|
|
|
//send to looter's combat spam...
|
|
prose_package ppSelf = prose.getPackage(PROSE_LOOT_ITEM_SELF, item, corpseId);
|
|
string oobPP = packOutOfBandProsePackage("", ppSelf);
|
|
//chatSendToRoom("", "", oobPP);
|
|
|
|
if ( toGroup )
|
|
{
|
|
obj_id gid = getGroupObject(player);
|
|
if ( isIdValid(gid) )
|
|
{
|
|
prose_package ppOther = prose.getPackage(PROSE_LOOT_ITEM_OTHER, player, item, corpseId);
|
|
group.sendGroupChatMessage(gid, ppOther);
|
|
}
|
|
}
|
|
}
|
|
|
|
void lootItem(obj_id player, obj_id item, obj_id corpseId)
|
|
{
|
|
lootItem(player, item, corpseId, true);
|
|
}
|