HoS_PRC8/_mod/_module/nss/mg_alc_makepotio.nss

21 lines
559 B
Plaintext
Raw Normal View History

2024-11-25 19:36:07 -05:00
// Make potion
void main()
{
object oItem;
string sRes=GetLocalString(OBJECT_SELF,"sALCRes");
string sCom=GetLocalString(OBJECT_SELF,"sALCCom");
int nGP=GetLocalInt(OBJECT_SELF,"nALCCost");
int nXP=GetLocalInt(OBJECT_SELF,"nALCXP");
int nN;
oItem=CreateItemOnObject(sRes,GetPCSpeaker(),1);
if (sCom!="NA")
{
oItem=GetItemPossessedBy(GetPCSpeaker(),sCom);
DestroyObject(oItem);
}
TakeGoldFromCreature(nGP,GetPCSpeaker(),TRUE);
nN=GetXP(GetPCSpeaker());
nN=nN-nXP;
SetXP(GetPCSpeaker(),nN);
}