Here is my work so far:
New bot command "stats" is implemented. You get a popup with all of your bot's vitals.
Includes revised "inventory list" as well as revised "list".
So now we would have bot inspection for inventory purposes, a listing via popup for slot reference, a stat listing. The only problem you might have with the diff is that I pulled out all of the chat messages being sent to the client for inventory lists. This kinda kills the item links as they do not work with the popups (yet? dunno if it is even possible. Bogus data is being sent to highlight the item in the popup).
Plus, yea, the popups are kinda no-frills.
Anyway, here it is:
Code:
@@ -8479,7 +8479,7 @@
if(!strcasecmp(sep->arg[1], "list")) {
bool listAll = true;
- int iClass = atoi(sep->arg[2]);
+ uint16 iClass = (uint16) atoi(sep->arg[2]);
if(iClass > 0 && iClass < 17)
listAll = false;
@@ -8492,15 +8492,19 @@
}
if(!AvailableBots.empty()) {
+ std::stringstream botListStringStream;
for(std::list<BotsAvailableList>::iterator TempAvailable
BotsList = AvailableBots.begin(); TempAvailableBotsList != AvailableBots.end();
TempAvailableBotsList++) {
if(listAll) {
- c->Message(0, "ID: %u -- Class: %s -- Na
me: %s -- Race: %s", TempAvailableBotsList->BotID, ClassIdToString(TempAvailable
BotsList->BotClass).c_str(), TempAvailableBotsList->BotName, RaceIdToString(Temp
AvailableBotsList->BotRace).c_str());
+ botListStringStream <<"ID: " << TempAvai
lableBotsList->BotID << " " << TempAvailableBotsList->BotName << " " << RaceIdTo
String(TempAvailableBotsList->BotRace) << " " << ClassIdToString(TempAvailableBo
tsList->BotClass) << "<br>";
+ //c->Message(0, "ID: %u -- Class: %s --
Name: %s -- Race: %s", TempAvailableBotsList->BotID, ClassIdToString(TempAvailab
leBotsList->BotClass).c_str(), TempAvailableBotsList->BotName, RaceIdToString(Te
mpAvailableBotsList->BotRace).c_str());
}
else {
if(TempAvailableBotsList->BotClass == iC
lass)
- c->Message(0, "ID: %u -- Class:
%s -- Name: %s -- Race: %s", TempAvailableBotsList->BotID, ClassIdToString(TempA
vailableBotsList->BotClass).c_str(), TempAvailableBotsList->BotName, RaceIdToStr
ing(TempAvailableBotsList->BotRace).c_str());
+ botListStringStream <<"ID: " <<
TempAvailableBotsList->BotID << " " << TempAvailableBotsList->BotName << " " <<
RaceIdToString(TempAvailableBotsList->BotRace) << " " << ClassIdToString(TempAva
ilableBotsList->BotClass) << "<br>";
+ //c->Message(0, "ID: %u -- Class
: %s -- Name: %s -- Race: %s", TempAvailableBotsList->BotID, ClassIdToString(Tem
pAvailableBotsList->BotClass).c_str(), TempAvailableBotsList->BotName, RaceIdToS
tring(TempAvailableBotsList->BotRace).c_str());
}
}
+ c->SendPopupToClient("Available Bots", botListStringStre
am.str().c_str());
}
else {
c->Message(0, "You have no bots created. Use the #bot cr
eate command to create a bot.");
@@ -9105,7 +9109,47 @@
return;
}
-
+ if(!strcasecmp(sep->arg[1], "stats"))
+ {
+ if(c->GetTarget() != NULL)
+ {
+ if(c->GetTarget()->IsBot() && c->GetTarget()->CastToBot(
)->GetBotOwnerCharacterID() == c->CharacterID())
+ {
+ std::stringstream botStatStream;
+ Bot *b = c->GetTarget()->CastToBot();
+ botStatStream
+ << b->GetName() << "<BR>"
+ << ClassIdToString(b->CastToBot()->GetClass()) <
< "<BR><BR>"
+ << "Hp: " << b->GetHP() << "/" << b->GetMaxHP()
<< "<BR>"
+ << "Mana: " << b->GetMana() << "/" << b->GetMaxM
ana() << "<BR>"
+ << "AC: " << b->GetAC() << "<BR>"
+ << "ATK: " << b->GetATK() << "<BR>"
+ << "STR: " << b->GetSTR() << "<BR>"
+ << "STA: " << b->GetSTA() << "<BR>"
+ << "AGI: " << b->GetAGI() << "<BR>"
+ << "DEX: " << b->GetDEX() << "<BR>"
+ << "INT: " << b->GetINT() << "<BR>"
+ << "WIS: " << b->GetWIS() << "<BR>"
+ << "CHA: " << b->GetCHA() << "<BR>"
+ << "<BR>"
+ << "Resists" << "<BR>"
+ << "Magic: " << b->GetMR() << "<BR>"
+ << "Fire: " << b->GetFR() << "<BR>"
+ << "Cold: " << b->GetCR() << "<BR>"
+ << "Poison: " << b->GetPR() << "<BR>"
+ << "Disease: " << b->GetDR() << "<BR>";
+ c->SendPopupToClient("Bot Statistics", botStatSt
ream.str().c_str());
+ }
+ else //bot does not belong to client
+ {
+ c->Message(15, "This bot does not belong to you.
");
+ }
+ }
+ else //no client target
+ {
+ c->Message(15, "You must target a bot first.");
+ }
+ }
if(!strcasecmp(sep->arg[1], "inventory") && !strcasecmp(sep->arg[2], "li
st"))
{
if(c->GetTarget() != NULL)
@@ -9125,6 +9169,7 @@
"Left Finger", "Right Finger", "Chest",
"Legs", "Feet", "Waist", "Ammo" };
const Item_Struct* item2 = NULL;
bool is2Hweapon = false;
+ std::stringstream botInventoryPopupString;
for(int i=0; i<22 ; i++)
{
if((i == 14) && is2Hweapon) {
@@ -9138,7 +9183,8 @@
return;
}
if(item2 == 0) {
- c->Message(15, "I need something
for my %s (Item %i)", equipped[i], i);
+ botInventoryPopupString << equip
ped[i] << "[SlotID: " << i << "]->empty<BR>";
+ //c->Message(15, "I need somethi
ng for my %s (Item %i)", equipped[i], i);
continue;
}
if((i == 13) && ((item2->ItemType == Ite
mType2HS) || (item2->ItemType == ItemType2HB) || (item2->ItemType == ItemType2HP
ierce))) {
@@ -9147,24 +9193,26 @@
if((i == 0) || (i == 11) || (i == 13) ||
(i == 14) || (i == 21)) {
if (c->GetClientVersion() == EQC
lientSoF)
{
- c->Message(15, "Using %c
%06X00000000000000000000000000000000000000000000%s%c in my %s (Item %i)", 0x12,
item2->ID, item2->Name, 0x12, equipped[i], i);
+ botInventoryPopupString
<< equipped[i] << "[SlotID: " << i << "]-><a WndNotify=" << '"' << "27,00" << '"
' << ">" << item2->Name << "</a><br>";
}
else
{
- c->Message(15, "Using %c
%06X000000000000000000000000000000000000000%s%c in my %s (Item %i)", 0x12, item2
->ID, item2->Name, 0x12, equipped[i], i);
+ botInventoryPopupString
<< equipped[i] << "[SlotID: " << i << "]-><a WndNotify=" << '"' << "27,00" << '"
' << ">" << item2->Name << "</a><br>";
}
}
else {
if (c->GetClientVersion() == EQC
lientSoF)
{
- c->Message(15, "Using %c
%06X00000000000000000000000000000000000000000000%s%c on my %s (Item %i)", 0x12,
item2->ID, item2->Name, 0x12, equipped[i], i);
+ botInventoryPopupString
<< equipped[i] << "[SlotID: " << i << "]-><a WndNotify=" << '"' << "27,00" << '"
' << ">" << item2->Name << "</a><br>";
+
}
else
{
- c->Message(15, "Using %c
%06X000000000000000000000000000000000000000%s%c on my %s (Item %i)", 0x12, item2
->ID, item2->Name, 0x12, equipped[i], i);
+ botInventoryPopupString
<< equipped[i] << "[SlotID: " << i << "]-><a WndNotify=" << '"' << "27,00" << '"
' << ">" << item2->Name << "</a><br>";
}
- }
- }
+ }
+ }
+ c->SendPopupToClient(b->CastToBot()->GetName(),
botInventoryPopupString.str().c_str());
}
else {
c->Message(15, "You must group your bot first.")
;
|