19 lines
608 B
Plaintext
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);
|
|
}
|