57 lines
2.0 KiB
Plaintext
57 lines
2.0 KiB
Plaintext
// RTS Header - By Deva Bryson Winblood
|
|
// More than 4 player support functions
|
|
|
|
// Get the team mana
|
|
int fnGetTeamMana(object oPC);
|
|
|
|
// Set the team mana
|
|
void fnSetTeamMana(object oPC,int nAmount);
|
|
|
|
// Get the team souls
|
|
int fnGetTeamSouls(object oPC);
|
|
|
|
// Set team souls
|
|
void fnSetTeamSouls(object oPC,int nAmount);
|
|
|
|
int fnGetTeamMana(object oPC)
|
|
{ // get amount of mana team has
|
|
int nRet=0;
|
|
object oMod=GetModule();
|
|
string sID=GetLocalString(oPC,"sTeamID");
|
|
object oLead=GetLocalObject(oMod,"oTeamLead"+sID);
|
|
nRet=GetLocalInt(oLead,"nManaStore");
|
|
return nRet;
|
|
} // fnGetTeamMana()
|
|
|
|
void fnSetTeamMana(object oPC,int nAmount)
|
|
{ // set how much mana the team has
|
|
object oMod=GetModule();
|
|
string sID=GetLocalString(oPC,"sTeamID");
|
|
object oLead=GetLocalObject(oMod,"oTeamLead"+sID);
|
|
int nBefore=GetLocalInt(oLead,"nManaStore");
|
|
SetLocalInt(oLead,"nManaStore",nAmount);
|
|
if (nBefore<nAmount&&oPC!=oLead) SendMessageToPC(oLead,GetName(oPC)+" put "+IntToString(nAmount-nBefore)+" mana into your pool.");
|
|
else if (oPC!=oLead) SendMessageToPC(oLead,GetName(oPC)+" used "+IntToString(nBefore-nAmount)+" of your team's mana.");
|
|
} // fnSetTeamMana()
|
|
|
|
int fnGetTeamSouls(object oPC)
|
|
{ // get amount of souls team has
|
|
int nRet=0;
|
|
object oMod=GetModule();
|
|
string sID=GetLocalString(oPC,"sTeamID");
|
|
object oLead=GetLocalObject(oMod,"oTeamLead"+sID);
|
|
nRet=GetLocalInt(oLead,"nSoulStore");
|
|
return nRet;
|
|
} // fnGetTeamSouls()
|
|
|
|
void fnSetTeamSouls(object oPC,int nAmount)
|
|
{ // set how much mana the team has
|
|
object oMod=GetModule();
|
|
string sID=GetLocalString(oPC,"sTeamID");
|
|
object oLead=GetLocalObject(oMod,"oTeamLead"+sID);
|
|
int nBefore=GetLocalInt(oLead,"nSoulStore");
|
|
SetLocalInt(oLead,"nSoulStore",nAmount);
|
|
if (nBefore<nAmount&&oPC!=oLead) SendMessageToPC(oLead,GetName(oPC)+" put "+IntToString(nAmount-nBefore)+" souls into your receptacle.");
|
|
else if (oPC!=oLead) SendMessageToPC(oLead,GetName(oPC)+" used "+IntToString(nBefore-nAmount)+" of your team's souls.");
|
|
} // fnSetTeamSouls()
|