Fixed GP rewards
Fixed GP rewards. Full compile. Updated release archive.
This commit is contained in:
parent
2c45423f42
commit
6c49e71ecc
Binary file not shown.
@ -3,11 +3,12 @@
|
|||||||
/*
|
/*
|
||||||
PRC's OnDeath event handler for NPCs.
|
PRC's OnDeath event handler for NPCs.
|
||||||
|
|
||||||
Just hands out XP
|
Hands out GP & Loot
|
||||||
*/
|
*/
|
||||||
//:://////////////////////////////////////////////////
|
//:://////////////////////////////////////////////////
|
||||||
#include "x0_i0_partywide"
|
#include "x0_i0_partywide"
|
||||||
#include "prc_inc_racial"
|
#include "prc_inc_racial"
|
||||||
|
#include "inc_debug"
|
||||||
|
|
||||||
void RndDropGear(object oSelf, object oKiller);
|
void RndDropGear(object oSelf, object oKiller);
|
||||||
|
|
||||||
@ -17,23 +18,40 @@ void RndDropGold(object oSelf, object oKiller)
|
|||||||
{
|
{
|
||||||
//:: Declare major variables
|
//:: Declare major variables
|
||||||
|
|
||||||
int iHD = GetHitDice(oKiller);
|
int iHD = GetHitDice(oSelf);
|
||||||
int iInt = GetAbilityScore(oKiller, ABILITY_INTELLIGENCE, TRUE);
|
int iInt = GetAbilityScore(oSelf, ABILITY_INTELLIGENCE, TRUE);
|
||||||
int iIntB = GetAbilityModifier(ABILITY_INTELLIGENCE, oKiller);
|
int iIntB = GetAbilityModifier(ABILITY_INTELLIGENCE, oSelf);
|
||||||
int iRacial = GetRacialType(oKiller);
|
int iRacial = GetRacialType(oSelf);
|
||||||
int iBaseGP = 1;
|
int iBaseGP = 1;
|
||||||
int iRewardGP;
|
int iRewardGP;
|
||||||
int iPartyGP;
|
int iPartyGP;
|
||||||
|
|
||||||
//:: Take one off GetNumberPartyMembers(), see known bugs
|
if(DEBUG)
|
||||||
int nMembers = GetNumberPartyMembers(oKiller) - 1;
|
{
|
||||||
|
FloatingTextStringOnCreature("RndDropGold: Dead Mob is "+GetName(oSelf), oKiller, FALSE);
|
||||||
|
FloatingTextStringOnCreature("RndDropGold: oKiller is "+GetName(oKiller), oKiller, FALSE);
|
||||||
|
|
||||||
if (iIntB < 0) { iIntB = 0;}
|
FloatingTextStringOnCreature("RndDropGold: Dead Mob had "+IntToString(iHD)+" Hit Dice.", oKiller, FALSE);
|
||||||
|
FloatingTextStringOnCreature("RndDropGold: Dead Mob had "+IntToString(iInt)+" INT.", oKiller, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//:: Take one off GetNumberPartyMembers(), see known bugs
|
||||||
|
int nMembers = GetNumberPartyMembers(oKiller); //- 1;
|
||||||
|
|
||||||
|
if (iIntB < 0) { iIntB = 1;}
|
||||||
|
|
||||||
iRewardGP = (iBaseGP * d4(1)) + (iIntB * d4(1)) + (iHD * 5);
|
iRewardGP = (iBaseGP * d4(1)) + (iIntB * d4(1)) + (iHD * 5);
|
||||||
|
|
||||||
iPartyGP = iRewardGP * nMembers;
|
iPartyGP = iRewardGP * nMembers;
|
||||||
|
|
||||||
|
if(DEBUG)
|
||||||
|
{
|
||||||
|
FloatingTextStringOnCreature("RndDropGold: Party has "+IntToString(nMembers)+" Members.", oKiller, FALSE);
|
||||||
|
FloatingTextStringOnCreature("RndDropGold: iRewardGP equals "+IntToString(iRewardGP)+" GP.", oKiller, FALSE);
|
||||||
|
FloatingTextStringOnCreature("RndDropGold: iPartyGP equals "+IntToString(iPartyGP)+" GP.", oKiller, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
if (iRacial == RACIAL_TYPE_ANIMAL ||
|
if (iRacial == RACIAL_TYPE_ANIMAL ||
|
||||||
iRacial == RACIAL_TYPE_BEAST ||
|
iRacial == RACIAL_TYPE_BEAST ||
|
||||||
iRacial == RACIAL_TYPE_MAGICAL_BEAST ||
|
iRacial == RACIAL_TYPE_MAGICAL_BEAST ||
|
||||||
@ -42,18 +60,21 @@ void RndDropGold(object oSelf, object oKiller)
|
|||||||
iRacial == RACIAL_TYPE_PLANT ||
|
iRacial == RACIAL_TYPE_PLANT ||
|
||||||
iRacial == RACIAL_TYPE_VERMIN)
|
iRacial == RACIAL_TYPE_VERMIN)
|
||||||
{
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Creature doesn't carry treasure", oKiller, FALSE);}
|
||||||
iPartyGP = 0;
|
iPartyGP = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iInt <= 5 &&
|
if (iInt < 4 &&
|
||||||
iRacial == RACIAL_TYPE_UNDEAD ||
|
iRacial == RACIAL_TYPE_UNDEAD ||
|
||||||
iRacial == RACIAL_TYPE_ELEMENTAL)
|
iRacial == RACIAL_TYPE_ELEMENTAL)
|
||||||
{
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Creature doesn't carry treasure [LOWINT]", oKiller, FALSE);}
|
||||||
iPartyGP = 0;
|
iPartyGP = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iPartyGP > 1)
|
if (iPartyGP > 1)
|
||||||
{
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Reward gold "+IntToString(iPartyGP), oKiller, FALSE);}
|
||||||
GiveGoldToAll(oKiller, iPartyGP);
|
GiveGoldToAll(oKiller, iPartyGP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,6 +113,73 @@ void RndDropGear(object oSelf, object oKiller)
|
|||||||
int bDropLeftRing = d100() > 97;
|
int bDropLeftRing = d100() > 97;
|
||||||
int bDropRightRing = d100() > 97;
|
int bDropRightRing = d100() > 97;
|
||||||
|
|
||||||
|
if (!GetIsObjectValid(oArmor))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping armor", oKiller, FALSE);}
|
||||||
|
bDropArmor = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oWeapon))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping weapon", oKiller, FALSE);}
|
||||||
|
bDropWeapon = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oShield))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping shield", oKiller, FALSE);}
|
||||||
|
bDropShield = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!GetIsObjectValid(oHelm))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping helmet", oKiller, FALSE);}
|
||||||
|
bDropHelm = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oNecklace))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping necklace", oKiller, FALSE);}
|
||||||
|
bDropNecklace = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oArrows))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping arrows", oKiller, FALSE);}
|
||||||
|
bDropArrows = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oBelt))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping belt", oKiller, FALSE);}
|
||||||
|
bDropBelt = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oBolts))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping bolts", oKiller, FALSE);}
|
||||||
|
bDropBolts = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oBoots))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping boots", oKiller, FALSE);}
|
||||||
|
bDropBoots = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oBullets))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping bullets", oKiller, FALSE);}
|
||||||
|
bDropBullets = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oCloak))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping cloak", oKiller, FALSE);}
|
||||||
|
bDropCloak = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oLeftRing))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping left ring", oKiller, FALSE);}
|
||||||
|
bDropLeftRing = 0;
|
||||||
|
}
|
||||||
|
if (!GetIsObjectValid(oRightRing))
|
||||||
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("Not dropping right ring", oKiller, FALSE);}
|
||||||
|
bDropRightRing = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//:: Set Droppable Flag as determined above.
|
//:: Set Droppable Flag as determined above.
|
||||||
SetDroppableFlag(oArmor, bDropArmor);
|
SetDroppableFlag(oArmor, bDropArmor);
|
||||||
SetDroppableFlag(oWeapon, bDropWeapon);
|
SetDroppableFlag(oWeapon, bDropWeapon);
|
||||||
@ -112,16 +200,22 @@ void RndDropGear(object oSelf, object oKiller)
|
|||||||
!bDropArrows && !bDropBelt && !bDropBolts && !bDropBoots && !bDropBullets && !bDropCloak &&
|
!bDropArrows && !bDropBelt && !bDropBolts && !bDropBoots && !bDropBullets && !bDropCloak &&
|
||||||
!bDropLeftRing && !bDropRightRing)
|
!bDropLeftRing && !bDropRightRing)
|
||||||
{
|
{
|
||||||
|
if(DEBUG) {FloatingTextStringOnCreature("No loot, running RndDropGold", oKiller, FALSE);}
|
||||||
RndDropGold(oSelf, oKiller);
|
RndDropGold(oSelf, oKiller);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
//:: Declare major variables
|
//:: Declare major variables
|
||||||
object oKiller = GetLastKiller();
|
object oKiller = GetLastKiller();
|
||||||
object oSelf = OBJECT_SELF;
|
object oSelf = OBJECT_SELF;
|
||||||
|
|
||||||
|
if(DEBUG)
|
||||||
|
{
|
||||||
|
FloatingTextStringOnCreature("RndDropGear: Dead Mob is "+GetName(oSelf), oKiller, FALSE);
|
||||||
|
FloatingTextStringOnCreature("RndDropGear: oKiller is "+GetName(oKiller), oKiller, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
RndDropGear(oSelf, oKiller);
|
RndDropGear(oSelf, oKiller);
|
||||||
}
|
}
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user