mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
include library.utils;
|
|
include library.static_item;
|
|
|
|
const string SET_BONUS_TABLE = "datatables/item/item_sets.iff";
|
|
|
|
trigger OnGetAttributes(obj_id player, string[] names, string[] attribs)
|
|
{
|
|
|
|
int free = getFirstFreeIndex(names);
|
|
if (free == -1)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
int setBonusIndex = static_item.getSetBonusIndex(self);
|
|
|
|
if(setBonusIndex == -1)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
int numTableRows = dataTableGetNumRows(static_item.SET_BONUS_TABLE);
|
|
|
|
if(!static_item.isStaticItem(self))
|
|
{
|
|
for(int i = 0; i < numTableRows; i++)
|
|
{
|
|
int thisRowSetBonusIndex = dataTableGetInt(static_item.SET_BONUS_TABLE, i, "SETID");
|
|
int numberOfSetItems = dataTableGetInt(static_item.SET_BONUS_TABLE, i, "NUM_ITEMS");
|
|
|
|
if(setBonusIndex == thisRowSetBonusIndex)
|
|
{
|
|
string setBonusBuffName = dataTableGetString(static_item.SET_BONUS_TABLE, i, "EFFECT");
|
|
names[free] = utils.packStringId( new string_id ( "set_bonus", "piece_bonus_count_" + numberOfSetItems));
|
|
attribs[free++] = utils.packStringId( new string_id ( "set_bonus", setBonusBuffName));
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|