Fixed XP & GP rewards
Fixed XP & GP rewards. Enabled PRC's PnP XP system. Scripted GP reward system. Unplotted several items. Full compile. Updated release archive.
This commit is contained in:
@@ -6,67 +6,122 @@
|
||||
Just hands out XP
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Copyright (c) 2002 Floodgate Entertainment
|
||||
//:: Created By: Naomi Novik
|
||||
//:: Created On: 12/22/2002
|
||||
//:://////////////////////////////////////////////////
|
||||
#include "x0_i0_partywide"
|
||||
#include "prc_inc_racial"
|
||||
|
||||
void RndDropGear(object oNPC);
|
||||
void RndDropGear(object oSelf, object oKiller);
|
||||
|
||||
void RndDropGear(object oNPC)
|
||||
void RndDropGold(object oSelf, object oKiller);
|
||||
|
||||
void RndDropGold(object oSelf, object oKiller)
|
||||
{
|
||||
//:: 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);
|
||||
|
||||
int iHD = GetHitDice(oKiller);
|
||||
int iInt = GetAbilityScore(oKiller, ABILITY_INTELLIGENCE, TRUE);
|
||||
int iIntB = GetAbilityModifier(ABILITY_INTELLIGENCE, oKiller);
|
||||
int iRacial = GetRacialType(oKiller);
|
||||
int iBaseGP = 1;
|
||||
int iRewardGP;
|
||||
int iPartyGP;
|
||||
|
||||
//:: Take one off GetNumberPartyMembers(), see known bugs
|
||||
int nMembers = GetNumberPartyMembers(oKiller) - 1;
|
||||
|
||||
if (iIntB < 0) { iIntB = 0;}
|
||||
|
||||
iRewardGP = (iBaseGP * d4(1)) + (iIntB * d4(1)) + (iHD * 5);
|
||||
|
||||
iPartyGP = iRewardGP * nMembers;
|
||||
|
||||
if (iRacial == RACIAL_TYPE_ANIMAL ||
|
||||
iRacial == RACIAL_TYPE_BEAST ||
|
||||
iRacial == RACIAL_TYPE_MAGICAL_BEAST ||
|
||||
iRacial == RACIAL_TYPE_CONSTRUCT ||
|
||||
iRacial == RACIAL_TYPE_OOZE ||
|
||||
iRacial == RACIAL_TYPE_PLANT ||
|
||||
iRacial == RACIAL_TYPE_VERMIN)
|
||||
{
|
||||
iPartyGP = 0;
|
||||
}
|
||||
|
||||
if (iInt <= 5 &&
|
||||
iRacial == RACIAL_TYPE_UNDEAD ||
|
||||
iRacial == RACIAL_TYPE_ELEMENTAL)
|
||||
{
|
||||
iPartyGP = 0;
|
||||
}
|
||||
|
||||
if (iPartyGP > 1)
|
||||
{
|
||||
GiveGoldToAll(oKiller, iPartyGP);
|
||||
}
|
||||
}
|
||||
|
||||
void RndDropGear(object oSelf, object oKiller)
|
||||
{
|
||||
//:: Declare major variables
|
||||
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oSelf);
|
||||
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oSelf);
|
||||
object oShield = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oSelf);
|
||||
object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, oSelf);
|
||||
object oNecklace = GetItemInSlot(INVENTORY_SLOT_NECK, oSelf);
|
||||
object oArms = GetItemInSlot(INVENTORY_SLOT_ARMS, oSelf);
|
||||
object oArrows = GetItemInSlot(INVENTORY_SLOT_ARROWS, oSelf);
|
||||
object oBelt = GetItemInSlot(INVENTORY_SLOT_BELT, oSelf);
|
||||
object oBolts = GetItemInSlot(INVENTORY_SLOT_BOLTS, oSelf);
|
||||
object oBoots = GetItemInSlot(INVENTORY_SLOT_BOOTS, oSelf);
|
||||
object oBullets = GetItemInSlot(INVENTORY_SLOT_BULLETS, oSelf);
|
||||
object oCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK, oSelf);
|
||||
object oLeftRing = GetItemInSlot(INVENTORY_SLOT_LEFTRING, oSelf);
|
||||
object oRightRing = GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oSelf);
|
||||
|
||||
//:: 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;
|
||||
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);
|
||||
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);
|
||||
|
||||
if (!bDropArmor && !bDropWeapon && !bDropShield && !bDropHelm && !bDropNecklace && !bDropArms &&
|
||||
!bDropArrows && !bDropBelt && !bDropBolts && !bDropBoots && !bDropBullets && !bDropCloak &&
|
||||
!bDropLeftRing && !bDropRightRing)
|
||||
{
|
||||
RndDropGold(oSelf, oKiller);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//:: Declare major variables
|
||||
object oKiller = GetLastKiller();
|
||||
object oSelf = OBJECT_SELF;
|
||||
|
||||
RndDropGear(OBJECT_SELF);
|
||||
RndDropGear(oSelf, oKiller);
|
||||
}
|
Reference in New Issue
Block a user