PoA_PRC8/_module/nss/prc_pwondeath.nss
Jaysyn904 11df331172 Modified loot.
Gave all items worn by enemies a chance to drop.  Drastically reduced gold awards.
2023-09-24 23:34:36 -04:00

75 lines
2.6 KiB
Plaintext

//:://////////////////////////////////////////////////
//:: PRC_PWONDEATH
/*
PRC's OnDeath event handler for NPCs.
Just hands out XP
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/22/2002
//:://////////////////////////////////////////////////
void RndDropGear(object oNPC);
void RndDropGear(object oNPC)
{
//:: Declare major variables
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oNPC);
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oNPC);
object oShield = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oNPC);
object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, oNPC);
object oNecklace = GetItemInSlot(INVENTORY_SLOT_NECK, oNPC);
object oArms = GetItemInSlot(INVENTORY_SLOT_ARMS, oNPC);
object oArrows = GetItemInSlot(INVENTORY_SLOT_ARROWS, oNPC);
object oBelt = GetItemInSlot(INVENTORY_SLOT_BELT, oNPC);
object oBolts = GetItemInSlot(INVENTORY_SLOT_BOLTS, oNPC);
object oBoots = GetItemInSlot(INVENTORY_SLOT_BOOTS, oNPC);
object oBullets = GetItemInSlot(INVENTORY_SLOT_BULLETS, oNPC);
object oCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK, oNPC);
object oLeftRing = GetItemInSlot(INVENTORY_SLOT_LEFTRING, oNPC);
object oRightRing = GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oNPC);
//:: Give a 3% chance to drop each type of equipment
int bDropArmor = d100() > 97;
int bDropWeapon = d100() > 97;
int bDropShield = d100() > 97;
int bDropHelm = d100() > 97;
int bDropNecklace = d100() > 97;
int bDropArms = d100() > 97;
int bDropArrows = d100() > 97;
int bDropBelt = d100() > 97;
int bDropBolts = d100() > 97;
int bDropBoots = d100() > 97;
int bDropBullets = d100() > 97;
int bDropCloak = d100() > 97;
int bDropLeftRing = d100() > 97;
int bDropRightRing = d100() > 97;
//:: Set Droppable Flag as determined above.
SetDroppableFlag(oArmor, bDropArmor);
SetDroppableFlag(oWeapon, bDropWeapon);
SetDroppableFlag(oShield, bDropShield);
SetDroppableFlag(oHelm, bDropHelm);
SetDroppableFlag(oNecklace, bDropNecklace);
SetDroppableFlag(oArms, bDropArms);
SetDroppableFlag(oArrows, bDropArrows);
SetDroppableFlag(oBelt, bDropBelt);
SetDroppableFlag(oBolts, bDropBolts);
SetDroppableFlag(oBoots, bDropBoots);
SetDroppableFlag(oBullets, bDropBullets);
SetDroppableFlag(oCloak, bDropCloak);
SetDroppableFlag(oLeftRing, bDropLeftRing);
SetDroppableFlag(oRightRing, bDropRightRing);
}
void main()
{
ExecuteScript("sf_xp", OBJECT_SELF);
RndDropGear(OBJECT_SELF);
}