Amon_PRC8/_module/nss/packox_handin.nss

50 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2025-04-03 19:00:46 -04:00
#include "pcinclude"
#include "nw_i0_henchman"
void main()
{
object oEnter = GetEnteringObject();
if(GetTag(oEnter) == "PackOx1" || GetTag(oEnter) == "PackOx2"|| GetTag(oEnter) == "PackOx3")
{
AssignCommand (oEnter, PlaySound ("as_cv_ta-da1"));
object oHench = oEnter;
object oPC = GetMaster(oHench);
// Remove items from the player's inventory
int nPelts1 = DestroyItemsInInventory(oHench, "Freight1", 9999);
// Give the speaker some gold
GiveGoldToCreature(oPC, 100 * nPelts1 + 50);
// Give the speaker some XP
GiveXPToCreature(oPC, 20 * nPelts1 + 100);
if(nPelts1 <= 1)
{
ExecuteScript("lootgems", oPC);
ExecuteScript("lootgems", oPC);
}
else if(nPelts1 <= 5)
{
ExecuteScript("lootgems", oPC);
ExecuteScript("lootgems", oPC);
}
else if(nPelts1 <= 20)
{
ExecuteScript("lootgems", oPC);
ExecuteScript("lootgems", oPC);
ExecuteScript("lootgems", oPC);
}
// Remove items from the player's inventory
int nPelts2 = DestroyItemsInInventory(oHench, "Freight2", 9999);
// Give the speaker some gold
GiveGoldToCreature(oPC, 400 * nPelts2);
// Give the speaker some XP
GiveXPToCreature(oPC, 40 * nPelts2);
// Remove items from the player's inventory
int nPelts3 = DestroyItemsInInventory(oHench, "Freight3", 9999);
// Give the speaker some gold
GiveGoldToCreature(oPC, 1000 * nPelts3);
// Give the speaker some XP
GiveXPToCreature(oPC, 80 * nPelts3);
ExecuteScript("kill_ox", oHench);
}
}