I was hoping to get some help with a script I have been working on.
Basically I’m trying to award exp and gold based on the number of kills a PC has.
So how it would work is the PC would talk to an NPC then the NPC would check how many kills the PC has then gives them the reward.
So let’s say each kill is worth 10 exp points, NPC checks PC. PC has killed five creatures the PC would get 50 exp points.
Here is the script I'm using.
#include "nw_i0_tool"
void main()
{
object oPC = GetPCSpeaker();
int K = GetLocalInt(oPC, "TotalRatsKilled");
if (K == 1)
{
RewardPartyXP(10, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
if (K == 2)
{
RewardPartyXP(20, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
if (K == 3)
{
RewardPartyXP(30, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
if (K == 4)
{
RewardPartyXP(40, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
if (K == 5)
{
RewardPartyXP(60, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
if (K == 6)
{
RewardPartyXP(80, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
if (K == 7)
{
RewardPartyXP(100, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
if (K ==
{
RewardPartyXP(110, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
if (K == 9)
{
RewardPartyXP(120, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
if (K == 10)
{
RewardPartyXP(130, oPC, FALSE);
SetLocalInt(oPC, "TotalRatsKilled", 0);
}
}
Is their an easy'ier or better way of doing this. basicly to get the count then multiply it by 10.
I’m not sure if this even possible but any help on this would be great.