HoS_PRC8/_mod/_module/nss/uc_t_unok4.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

32 lines
842 B
Plaintext

// uc_t_unok4 - Unit Creation Version 2 - Okay to create X amount
// By Deva Bryson Winblood. 04/10/2005
#include "uc_h"
int StartingConditional()
{
object oPC=GetPCSpeaker();
int nNum=GetLocalInt(oPC,"nUCNumber");
string sID=GetLocalString(oPC,"sTeamID");
int nQty=4;
int nToken=4;
int nMana=fnGetTeamMana(oPC);
int nGold=GetGold(oPC);
int nSouls=fnGetTeamSouls(oPC);
string sCost;
int nV;
nV=GetManaCost(sID,nNum);
nV=nV*nQty;
sCost="M:"+IntToString(nV)+",";
if (nMana<nV) return FALSE;
nV=GetGoldCost(sID,nNum);
nV=nV*nQty;
sCost=sCost+"G:"+IntToString(nV)+",";
if (nGold<nV) return FALSE;
nV=GetSoulCost(sID,nNum);
nV=nV*nQty;
sCost=sCost+"S:"+IntToString(nV);
if (nSouls<nV) return FALSE;
SetCustomToken(1010+nToken,sCost);
return TRUE;
}