158 lines
3.9 KiB
Plaintext
158 lines
3.9 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: FileName s_pcl_list
|
|
//:://////////////////////////////////////////////
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Scott Thorne
|
|
//:: Updated On: 08/27/2002
|
|
//:://////////////////////////////////////////////
|
|
|
|
string GetClassLevels(object oPC)
|
|
{
|
|
string sClassLevels = "";
|
|
int iClsIdx;
|
|
int iClsType;
|
|
string sClsName;
|
|
int iClsLvl;
|
|
|
|
for (iClsIdx = 1; iClsIdx <= 8; iClsIdx++)
|
|
{
|
|
iClsType = GetClassByPosition(iClsIdx, oPC);
|
|
|
|
if (iClsType != CLASS_TYPE_INVALID)
|
|
{
|
|
// Retrieve the class abbreviation from class.2da
|
|
sClsName = Get2DAString("classes", "Abbreviation", iClsType);
|
|
|
|
// If the abbreviation is not found, handle it
|
|
if (sClsName == "")
|
|
{
|
|
sClsName = "?" + IntToString(iClsType) + "?";
|
|
}
|
|
|
|
iClsLvl = GetLevelByClass(iClsType, oPC);
|
|
|
|
if (sClassLevels != "")
|
|
{
|
|
sClassLevels = sClassLevels + "/";
|
|
}
|
|
|
|
sClassLevels = sClassLevels + IntToString(iClsLvl) + " " + sClsName;
|
|
}
|
|
}
|
|
|
|
return sClassLevels + " ";
|
|
}
|
|
|
|
|
|
/* string GetClassLevels(object oPC)
|
|
{
|
|
string sClassLevels = "";
|
|
int iClsIdx;
|
|
int iClsType;
|
|
string sClsName;
|
|
int iClsLvl;
|
|
|
|
for (iClsIdx = 1; iClsIdx <= 8; iClsIdx++)
|
|
{
|
|
|
|
iClsType = GetClassByPosition(iClsIdx, oPC);
|
|
|
|
if (iClsType != CLASS_TYPE_INVALID) {
|
|
|
|
switch (iClsType) {
|
|
|
|
case CLASS_TYPE_BARBARIAN: sClsName = "Bbn"; break;
|
|
case CLASS_TYPE_BARD: sClsName = "Brd"; break;
|
|
case CLASS_TYPE_CLERIC: sClsName = "Clr"; break;
|
|
case CLASS_TYPE_DRUID: sClsName = "Drd"; break;
|
|
case CLASS_TYPE_FIGHTER: sClsName = "Ftr"; break;
|
|
case CLASS_TYPE_MONK: sClsName = "Mnk"; break;
|
|
case CLASS_TYPE_PALADIN: sClsName = "Pal"; break;
|
|
case CLASS_TYPE_RANGER: sClsName = "Rgr"; break;
|
|
case CLASS_TYPE_ROGUE: sClsName = "Rog"; break;
|
|
case CLASS_TYPE_SORCERER: sClsName = "Sor"; break;
|
|
case CLASS_TYPE_WIZARD: sClsName = "Wiz"; break;
|
|
default: sClsName = "?" + IntToString(iClsType) + "?";
|
|
}
|
|
|
|
iClsLvl = GetLevelByClass(iClsType, oPC);
|
|
|
|
if (sClassLevels != "") {
|
|
sClassLevels = sClassLevels + "/"; }
|
|
|
|
sClassLevels = sClassLevels + IntToString(iClsLvl) + " " + sClsName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return sClassLevels + " ";
|
|
}
|
|
*/
|
|
|
|
void main()
|
|
{
|
|
|
|
object oUser = GetPCSpeaker();
|
|
|
|
int iPCTot = 0; /* total PC's */
|
|
int iPCVis = 0; /* total non-anon (visible) PC's */
|
|
string sPCName;
|
|
string sPCArea;
|
|
string sPCLevel;
|
|
string sPCClass;
|
|
string sPCLFG;
|
|
string sPCAFK;
|
|
string sDM;
|
|
string sMessage;
|
|
|
|
object oPC = GetFirstPC();
|
|
|
|
while (oPC != OBJECT_INVALID)
|
|
{
|
|
iPCTot++;
|
|
|
|
/* skip anonymous PC's */
|
|
if (GetLocalInt(oPC, "PCL_ANON") != 1) {
|
|
|
|
iPCVis++;
|
|
|
|
sPCName = GetName(oPC) + " ";
|
|
sPCArea = "(" + GetTag(GetArea(oPC)) + ") ";
|
|
sPCLevel = "L" + IntToString(GetHitDice(oPC)) + " ";
|
|
|
|
if (GetLocalInt(oPC, "PCL_HIDE_CLASS") == 1) {
|
|
sPCClass = "";
|
|
} else {
|
|
sPCClass = GetClassLevels(oPC);
|
|
}
|
|
|
|
if (GetLocalInt(oPC,"PCL_LFG") == 1) {
|
|
sPCLFG = "*LFG* ";
|
|
} else {
|
|
sPCLFG = ""; }
|
|
|
|
if (GetLocalInt(oPC,"PCL_AFK") == 1) {
|
|
sPCAFK = "<AFK> ";
|
|
} else {
|
|
sPCAFK = ""; }
|
|
|
|
if (GetIsDM(oPC)) {
|
|
sDM = "[DM] ";
|
|
} else {
|
|
sDM = ""; }
|
|
|
|
sMessage = sPCName + sPCArea + sPCClass + sPCAFK + sPCLevel + sPCLFG + sDM;
|
|
SendMessageToPC(oUser, sMessage);
|
|
|
|
}
|
|
|
|
oPC = GetNextPC();
|
|
}
|
|
|
|
sMessage = "[ " + IntToString(iPCVis) + " out of " + IntToString(iPCTot) + " PC's displayed ]";
|
|
SendMessageToPC(oUser, sMessage);
|
|
|
|
}
|
|
|