Hello everyone
So last night I was tinkering with an idea Ive had for several days.
Basically I run one character and wanted to mess with JC. So the idea came to look into having my chanter bot be able to enchant my silver. The idea was to hold a single bar of silver on my cursor and type #bot enchant silver. After I had that working add the other chants.
Here is the code and it works as it is supposed to (sort of)
Code:
//Enchant Metals
if(!strcasecmp(sep->arg[1], "enchant")) {
if(c->IsGrouped()){
bool hasenchanter = false;
Group *g = c->GetGroup();
for(int i=0; i<MAX_GROUP_MEMBERS; i++){
if(g && g->members[i] && g->members[i]->IsBot()) {
uint8 casterlevel = g->members[i]->GetLevel();
uint8 casterclass = g->members[i]->GetClass();
if (casterclass == ENCHANTER){
if(!strcasecmp(sep->arg[2], "silver")){
if (casterlevel >= 7){
g->members[i]->Say("Enchanting your silver bar");
g->members[i]->CastSpell(30015, c->GetID(), SLOT_CURSOR);
}
else {g->members[i]->Say("I must be at least level 7 to enchant silver.");}
}
}
}
}
}
else {
c->Message(15, "You need to be grouped with an enchanter.");
}
return;
}
The problem I realized is Enchant <Metal> is a self spell. So I went into the DB and copied the spell and renamed it Bot Enchant Silver at # 500000. Made it have a range of 100. No luck.
Used Nulls editor and it really didn't do anything different except number it at 30k and allow for easy changing of the spells_us.txt
So my question:
Would you:
1) Simply create a merchant that sold enchanted metals (this is my least preferable idea)
2) Create a spell (which isn't as portable to people who can't work in the DB or spells file)
3) Write code where a player can hand the silver bar to the bot and it casts the spell and hands it back (more like live I guess anyway)
Criimson