Added #showspellslist command to show us a mob's spells

This commit is contained in:
Michael Cook 2013-12-03 15:57:50 -05:00
parent 02c9007765
commit 4fdcf604f2
5 changed files with 37 additions and 0 deletions

View File

@ -1,5 +1,8 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 12/03/2013 ==
demonstar55: Added #showspellslist to view a mobs spell list
== 12/02/2013 ==
JJ: Bandaid fix to CopyCharacter function.

View File

@ -2410,6 +2410,18 @@ void NPC::RemoveSpellFromNPCList(int16 spell_id)
}
}
void NPC::AISpellsList(Client *c)
{
if (!c)
return;
for (std::vector<AISpells_Struct>::iterator it = AIspells.begin(); it != AIspells.end(); ++it)
c->Message(0, "%s (%d): Type %d, Priority %d",
spells[it->spellid].name, it->spellid, it->type, it->priority);
return;
}
DBnpcspells_Struct* ZoneDatabase::GetNPCSpells(uint32 iDBSpellsID) {
if (iDBSpellsID == 0)
return 0;

View File

@ -220,6 +220,7 @@ int command_init(void) {
command_add("itemtest","- merth's test function",250,command_itemtest) ||
command_add("gassign","[id] - Assign targetted NPC to predefined wandering grid id",100,command_gassign) ||
command_add("ai","[factionid/spellslist/con/guard/roambox/stop/start] - Modify AI on NPC target",100,command_ai) ||
command_add("showspellslist","Shows spell list of targeted NPC",100,command_showspellslist) ||
command_add("worldshutdown","- Shut down world and all zones",200,command_worldshutdown) ||
command_add("sendzonespawns","- Refresh spawn list for all clients in zone",150,command_sendzonespawns) ||
command_add("dbspawn2","[spawngroup] [respawn] [variance] - Spawn an NPC from a predefined row in the spawn2 table",100,command_dbspawn2) ||
@ -10772,6 +10773,25 @@ void command_object(Client *c, const Seperator *sep)
}
}
void command_showspellslist(Client *c, const Seperator *sep)
{
Mob *target = c->GetTarget();
if (!target) {
c->Message(0, "Must target an NPC.");
return;
}
if (!target->IsNPC()) {
c->Message(0, "%s is not an NPC.", target->GetName());
return;
}
target->CastToNPC()->AISpellsList(c);
return;
}
// All new code added to command.cpp ought to be BEFORE this comment line. Do no append code to this file below the BOTS code block.
#ifdef BOTS
// Function delegate to support the command interface for Bots with the client.

View File

@ -322,6 +322,7 @@ void command_augmentitem(Client *c, const Seperator *sep);
void command_questerrors(Client *c, const Seperator *sep);
void command_enablerecipe(Client *c, const Seperator *sep);
void command_disablerecipe(Client *c, const Seperator *sep);
void command_showspellslist(Client *c, const Seperator *sep);
#ifdef EQPROFILE
void command_profiledump(Client *c, const Seperator *sep);

View File

@ -355,6 +355,7 @@ public:
int mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const Item_Struct* weapon, Mob* other);
void mod_npc_killed_merit(Mob* c);
void mod_npc_killed(Mob* oos);
void AISpellsList(Client *c);
protected: