Rune_PRC8/_module/nss/opa_chk_buyt8.nss

39 lines
903 B
Plaintext
Raw Permalink Normal View History

2024-09-13 09:10:39 -04:00
////////////////////////////////////////////////////////////////////////////////
//
// Olander's Pack Animals
// opa_chk_buyt8
// By Don Anderson
// dandersonru@msn.com
//
// This script is called from the Pack Animal Salesman Convo.
//
// Checks for Enough Gold.
//
////////////////////////////////////////////////////////////////////////////////
int StartingConditional()
{
object oPC = GetPCSpeaker();
object oNPC = OBJECT_SELF;
object oMod = GetModule();
int nType8 = GetLocalInt(oMod,"T8PRICE");
//Get the Animal Waypoint
object oWP = GetNearestObjectByTag("OPA_TYPE08",oNPC,1);
//Check for Enough Gold and Maximum Animals
int nGP = GetGold(oPC);
int nSTotal = GetLocalInt(oPC,"OPA_ANIMALTOTAL");
if(nSTotal > 0) return FALSE;
//All Checks
if(nGP >= nType8
&& nSTotal == 0
&& GetIsObjectValid(oWP) == TRUE)
{
return TRUE;
}
else return FALSE;
}