Aschbourne_PRC8/_module/nss/nw_o0_death_ras.nss

76 lines
2.6 KiB
Plaintext
Raw Normal View History

2024-06-14 10:48:20 -04:00
/**********************************
Script: Drop Items To Corpse
Created By: Jaden Wagener
Created On: 08/29/02
**********************************/
void onDeathApplyPenalty(object oDied)
{
int nXP = GetXP(oDied);
int nPenalty = 50 * GetHitDice(oDied);
int nHD = GetHitDice(oDied);
// * You can not lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
if (nXP != nNewXP)
SetXP(oDied, nNewXP);
int nGoldToTake = FloatToInt(0.10 * GetGold(oDied));
// * a cap of 10 000gp taken from you
if (nGoldToTake > 10000)
nGoldToTake = 10000;
TakeGoldFromCreature(nGoldToTake, oDied, TRUE);
}
2024-06-14 10:48:20 -04:00
//Drops all player's equipment and half of gold onto the corpse.
//Combination of Diablo I and II death styles.
//Script should be placed in module's OnDeath slot
void main()
{
//Set variables
int xCount, xGold;
object xPC, xCorpse, xItem;
location xLoc;
//Get player and find locations
xPC = GetLastPlayerDying();
xLoc = GetLocation(xPC);
/* //Create corpse at player's feet
2024-06-14 10:48:20 -04:00
xCorpse = CreateObject(OBJECT_TYPE_PLACEABLE,"corpse002",xLoc);
//Drop equipment on corpse
for (xCount = 1; xCount < 15; xCount++)
{
switch (xCount)
{
//case 1: xItem = GetItemInSlot(INVENTORY_SLOT_ARMS,xPC); break;
//case 2: xItem = GetItemInSlot(INVENTORY_SLOT_ARROWS,xPC); break;
//case 3: xItem = GetItemInSlot(INVENTORY_SLOT_BELT,xPC); break;
//case 4: xItem = GetItemInSlot(INVENTORY_SLOT_BOLTS,xPC); break;
//case 5: xItem = GetItemInSlot(INVENTORY_SLOT_BOOTS,xPC); break;
//case 6: xItem = GetItemInSlot(INVENTORY_SLOT_BULLETS,xPC); break;
//case 7: xItem = GetItemInSlot(INVENTORY_SLOT_CHEST,xPC); break;
//case 8: xItem = GetItemInSlot(INVENTORY_SLOT_CLOAK,xPC); break;
//case 9: xItem = GetItemInSlot(INVENTORY_SLOT_HEAD,xPC); break;
//case 10: xItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,xPC); break;
//case 11: xItem = GetItemInSlot(INVENTORY_SLOT_LEFTRING,xPC); break;
//case 12: xItem = GetItemInSlot(INVENTORY_SLOT_NECK,xPC); break;
//case 13: xItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,xPC); break;
//case 14: xItem = GetItemInSlot(INVENTORY_SLOT_RIGHTRING,xPC); break;
}
if (GetIsObjectValid(xItem))
{
AssignCommand(xCorpse,ActionTakeItem(xItem,xPC));
}
}
//Now drop half of player's gold.
xGold = (GetGold(xPC)/2);
AssignCommand(xItem,TakeGoldFromCreature(xGold,xPC,FALSE)); */
onDeathApplyPenalty(xPC);
2024-06-14 10:48:20 -04:00
//Now let's pop the death GUI
DelayCommand(2.5, PopUpDeathGUIPanel(xPC,TRUE,TRUE));
}