ES_PRC8/_module/nss/aquiretest.nss
Jaysyn904 08e84b4e71 Initial upload
Initial upload.
2023-11-14 12:09:02 -05:00

35 lines
1.3 KiB
Plaintext

void main()
{
} int preEvent()
{
object oItem = GetModuleItemAcquired();
object oPC = GetItemPossessor(oItem);
object oItemOwner = GetModuleItemAcquiredFrom();
string sItemName = GetName (oItem);
string sPlayerName = GetName (oPC);
string sItemOwnerName = GetName (oItemOwner);
object oPartyMember = GetFirstFactionMember (oPC);
if (!GetIsObjectValid (oItemOwner))
{
while (GetIsObjectValid(oPartyMember))
{
SendMessageToPC (oPartyMember, sPlayerName + " has accquired " + sItemName + " from the ground.");
oPartyMember = GetNextFactionMember (oPC);
WriteTimestampedLogEntry (sPlayerName + " has accquired " + sItemName + " from the ground.");
}
return TRUE;
}
if ((GetObjectType (oItemOwner) == OBJECT_TYPE_PLACEABLE)
|| (GetObjectType (oItemOwner) == OBJECT_TYPE_CREATURE))
{
while (GetIsObjectValid(oPartyMember))
{
SendMessageToPC (oPartyMember, sPlayerName + " has accquired " + sItemName + " from " + sItemOwnerName);
oPartyMember = GetNextFactionMember (oPC);
WriteTimestampedLogEntry (sPlayerName + " has accquired " + sItemName + " from " + sItemOwnerName);
}
}
return TRUE;
}