Initial Commit
Initial Commit [v1.32PRC8]
This commit is contained in:
56
_module/nss/qst_host1rwd5.nss
Normal file
56
_module/nss/qst_host1rwd5.nss
Normal file
@@ -0,0 +1,56 @@
|
||||
#include "rd_treasure"
|
||||
|
||||
void GivePartyReward(object oPC);
|
||||
string GetRace(object oPC);
|
||||
|
||||
void main()
|
||||
{
|
||||
location lMove;
|
||||
|
||||
GivePartyReward(GetPCSpeaker());
|
||||
ExecuteScript("qst_done",OBJECT_SELF);
|
||||
lMove = GetLocation(GetObjectByTag("en3_move"));
|
||||
DelayCommand(3.0f,AssignCommand(OBJECT_SELF,JumpToLocation(lMove)));
|
||||
}
|
||||
|
||||
void GivePartyReward(object oPC)
|
||||
{
|
||||
int iItemPosition;
|
||||
int iRandom;
|
||||
int iX;
|
||||
int iY;
|
||||
object oItem;
|
||||
itemproperty ip;
|
||||
|
||||
object oPartyMember = GetFirstFactionMember(oPC, TRUE);
|
||||
while (GetIsObjectValid(oPartyMember) == TRUE)
|
||||
{
|
||||
|
||||
iItemPosition = INVENTORY_SLOT_RIGHTHAND;
|
||||
iRandom = Random(4)+1;
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iX = IP_CONST_DAMAGETYPE_ACID; break;
|
||||
case 2: iX = IP_CONST_DAMAGETYPE_COLD; break;
|
||||
case 3: iX = IP_CONST_DAMAGETYPE_ELECTRICAL; break;
|
||||
case 4: iX = IP_CONST_DAMAGETYPE_FIRE; break;
|
||||
}
|
||||
iRandom = Random(3)+1;
|
||||
switch (iRandom)
|
||||
{
|
||||
case 1: iY = IP_CONST_DAMAGEBONUS_1d4; break;
|
||||
case 2: iY = IP_CONST_DAMAGEBONUS_1d6; break;
|
||||
case 3: iY = IP_CONST_DAMAGEBONUS_1d8; break;
|
||||
}
|
||||
ip = ItemPropertyDamageBonus(iX,iY);
|
||||
oItem = GetItemInSlot(iItemPosition,oPartyMember);
|
||||
if (!GetIsObjectValid(oItem) && GetLevelByClass(CLASS_TYPE_MONK, oPartyMember) >= 1)
|
||||
oItem = GetItemInSlot(INVENTORY_SLOT_ARMS,oPartyMember);
|
||||
|
||||
IPSafeAddItemProperty(oItem,ip);
|
||||
|
||||
oPartyMember = GetNextFactionMember(oPC, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user