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

19 lines
608 B
Plaintext

#include "powres_h"
void main()
{
object oPC=GetPCSpeaker();
object oMod=GetModule();
int nParm=GetLocalInt(oPC,"nParm");
string sID=GetLocalString(oPC,"sTeamID");
int nPow=GetLocalInt(oMod,"n"+sID+"Power");
int nCost=fnUnitCost(sID,nParm);
string sRes=fnUnitRes(sID,nParm);
object oCr;
nPow=nPow-nCost;
SetLocalInt(oMod,"n"+sID+"Power",nPow);
SendMessageToPC(oPC,"The Power Reservoir is creating unit with ResRef '"+sRes+"' with team ID:"+sID+".");
oCr=CreateObject(OBJECT_TYPE_CREATURE,sRes,GetLocation(oPC),FALSE);
SetLocalString(oCr,"sTeamID",sID);
}