Initial Commit
Initial Commit [v1.32PRC8]
This commit is contained in:
118
_module/nss/qst_pris_2.nss
Normal file
118
_module/nss/qst_pris_2.nss
Normal file
@@ -0,0 +1,118 @@
|
||||
#include "nw_i0_tool"
|
||||
#include "rd_treasure"
|
||||
|
||||
void GivePartyMagicItem(object oPC);
|
||||
void GivePartyQuestPoints(object oPC, int iQuestPoints);
|
||||
|
||||
void main()
|
||||
{
|
||||
object oHench;
|
||||
object oPC;
|
||||
int iReward;
|
||||
int iGold;
|
||||
int iXP;
|
||||
int iChance;
|
||||
int iMod;
|
||||
int iLevel;
|
||||
int iRandom;
|
||||
int iPrisoners;
|
||||
|
||||
oPC=GetPCSpeaker();
|
||||
iReward = 0;
|
||||
|
||||
//Go in opposite order because of removal
|
||||
oHench = GetHenchman(oPC,4);
|
||||
if (GetLocalInt(oHench,"Freed") == 1)
|
||||
{
|
||||
SetLocalInt(oHench,"Freed",2);
|
||||
RemoveHenchman(oPC,oHench);
|
||||
AssignCommand(oHench,ClearAllActions());
|
||||
iReward++;
|
||||
}
|
||||
|
||||
oHench = GetHenchman(oPC,3);
|
||||
if (GetLocalInt(oHench,"Freed") == 1)
|
||||
{
|
||||
SetLocalInt(oHench,"Freed",2);
|
||||
RemoveHenchman(oPC,oHench);
|
||||
AssignCommand(oHench,ClearAllActions());
|
||||
iReward++;
|
||||
}
|
||||
|
||||
oHench = GetHenchman(oPC,2);
|
||||
if (GetLocalInt(oHench,"Freed") == 1)
|
||||
{
|
||||
SetLocalInt(oHench,"Freed",2);
|
||||
RemoveHenchman(oPC,oHench);
|
||||
AssignCommand(oHench,ClearAllActions());
|
||||
iReward++;
|
||||
}
|
||||
|
||||
oHench = GetHenchman(oPC,1);
|
||||
if (GetLocalInt(oHench,"Freed") == 1)
|
||||
{
|
||||
SetLocalInt(oHench,"Freed",2);
|
||||
RemoveHenchman(oPC,oHench);
|
||||
AssignCommand(oHench,ClearAllActions());
|
||||
iReward++;
|
||||
}
|
||||
|
||||
|
||||
iLevel = GetHitDice(oPC);
|
||||
if (iLevel < 20)
|
||||
iMod = iLevel/5 + 1;
|
||||
else
|
||||
iMod = (iLevel-20)/8 + 5;
|
||||
|
||||
iGold = 50 * iReward * iMod;
|
||||
iXP = 100 * iReward * iMod;
|
||||
iChance = iLevel/4 + iReward;
|
||||
|
||||
RewardPartyXP(iXP, GetPCSpeaker());
|
||||
RewardPartyGP(iGold, GetPCSpeaker());
|
||||
|
||||
iRandom = Random(100);
|
||||
|
||||
iPrisoners = GetLocalInt(oPC,"Prisoners");
|
||||
iPrisoners = iPrisoners + iReward;
|
||||
SetLocalInt(oPC,"Prisoners",iReward);
|
||||
|
||||
if (iRandom < iChance)
|
||||
GivePartyMagicItem(GetPCSpeaker());
|
||||
|
||||
GivePartyQuestPoints(oPC,iReward);
|
||||
|
||||
}
|
||||
|
||||
void GivePartyMagicItem(object oPC)
|
||||
{
|
||||
|
||||
object oPartyMember = GetFirstFactionMember(oPC, TRUE);
|
||||
while (GetIsObjectValid(oPartyMember) == TRUE)
|
||||
{
|
||||
GetMagicItem(oPartyMember,TRUE,TRUE);
|
||||
oPartyMember = GetNextFactionMember(oPC, TRUE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GivePartyQuestPoints(object oPC, int iQuestPoints)
|
||||
{
|
||||
int iQuest;
|
||||
object oGood;
|
||||
|
||||
object oPartyMember = GetFirstFactionMember(oPC, TRUE);
|
||||
while (GetIsObjectValid(oPartyMember) == TRUE)
|
||||
{
|
||||
iQuest = GetLocalInt(oPartyMember,"QuestPoints");
|
||||
iQuest = iQuest + iQuestPoints;
|
||||
AdjustAlignment(oPartyMember,ALIGNMENT_GOOD,iQuestPoints);
|
||||
SetLocalInt(oPartyMember,"QuestPoints",iQuest);
|
||||
oGood = GetObjectByTag("en3_good");
|
||||
AdjustReputation(oPC,oGood,iQuestPoints);
|
||||
SendMessageToPC(oPartyMember,"You have been given " + IntToString(iQuestPoints) + " quest points. You now have " + IntToString(iQuest) + ".");
|
||||
oPartyMember = GetNextFactionMember(oPC, TRUE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user