Criimson
08-12-2011, 07:18 PM
Wasn't really sure which forum to post this, but it is bot code so put it here.
I don't really have much free time atm which is why I haven't been posting. However, my son and I have been messing around in the game and something that has been bugging the hell out of me is raids with many adds. The chanter bot's current AI is spotty IMO so I threw this code together as a band-aid until I can get in there and get dirty. Thought I'd post it, though, as it is handy to have anyway and thought someone might want to use it.
It adds the #bot aoemez command
// AoE Mez
if(!strcasecmp(sep->arg[1], "aoemez")) {
Mob *mezzer = NULL;
Mob *target = c->GetTarget();
bool hasmezzer = false;
if(c->IsGrouped())
{
Group *g = c->GetGroup();
if(g) {
for(int i=0; i<MAX_GROUP_MEMBERS; i++)
{
if(g->members[i] && g->members[i]->IsBot() && (g->members[i]->GetClass() == ENCHANTER))
{
hasmezzer = true;
mezzer = g->members[i];
}
}
if(!hasmezzer) {
c->Message(15, "You must have an Enchanter in your group.");
}
}
}
if(hasmezzer) {
if (c->GetLevel() <= 15) {
mezzer->Say("I need to be level 16 or higher for this...");
}
else if ((c->GetLevel() >= 16) && (c->GetLevel() <= 51)) {
mezzer->Say("Casting Mesmerization...");
mezzer->CastSpell(307, target->GetID(), 1, -1, -1);
}
else if ((c->GetLevel() >= 52) && (c->GetLevel() <= 64)) {
mezzer->Say("Casting Fascination...");
mezzer->CastSpell(1690, target->GetID(), 1, -1, -1);
}
else if ((c->GetLevel() >= 65) && (c->GetLevel() <= 68)) {
mezzer->Say("Casting Bliss of the Nihil...");
mezzer->CastSpell(4878, target->GetID(), 1, -1, -1);
}
else if ((c->GetLevel() >= 69) && (c->GetLevel() <= 70)) {
mezzer->Say("Casting Wake of Felicity...");
mezzer->CastSpell(5511, target->GetID(), 1, -1, -1);
}
}
return;
}
Edit:
be careful with this code :)
there are no checks in it. unsure how it will work if cast on players or in an area with friendly npcs.
I don't really have much free time atm which is why I haven't been posting. However, my son and I have been messing around in the game and something that has been bugging the hell out of me is raids with many adds. The chanter bot's current AI is spotty IMO so I threw this code together as a band-aid until I can get in there and get dirty. Thought I'd post it, though, as it is handy to have anyway and thought someone might want to use it.
It adds the #bot aoemez command
// AoE Mez
if(!strcasecmp(sep->arg[1], "aoemez")) {
Mob *mezzer = NULL;
Mob *target = c->GetTarget();
bool hasmezzer = false;
if(c->IsGrouped())
{
Group *g = c->GetGroup();
if(g) {
for(int i=0; i<MAX_GROUP_MEMBERS; i++)
{
if(g->members[i] && g->members[i]->IsBot() && (g->members[i]->GetClass() == ENCHANTER))
{
hasmezzer = true;
mezzer = g->members[i];
}
}
if(!hasmezzer) {
c->Message(15, "You must have an Enchanter in your group.");
}
}
}
if(hasmezzer) {
if (c->GetLevel() <= 15) {
mezzer->Say("I need to be level 16 or higher for this...");
}
else if ((c->GetLevel() >= 16) && (c->GetLevel() <= 51)) {
mezzer->Say("Casting Mesmerization...");
mezzer->CastSpell(307, target->GetID(), 1, -1, -1);
}
else if ((c->GetLevel() >= 52) && (c->GetLevel() <= 64)) {
mezzer->Say("Casting Fascination...");
mezzer->CastSpell(1690, target->GetID(), 1, -1, -1);
}
else if ((c->GetLevel() >= 65) && (c->GetLevel() <= 68)) {
mezzer->Say("Casting Bliss of the Nihil...");
mezzer->CastSpell(4878, target->GetID(), 1, -1, -1);
}
else if ((c->GetLevel() >= 69) && (c->GetLevel() <= 70)) {
mezzer->Say("Casting Wake of Felicity...");
mezzer->CastSpell(5511, target->GetID(), 1, -1, -1);
}
}
return;
}
Edit:
be careful with this code :)
there are no checks in it. unsure how it will work if cast on players or in an area with friendly npcs.