From 4fdcf604f28377acdda32c94e0c0116c0b739083 Mon Sep 17 00:00:00 2001 From: Michael Cook Date: Tue, 3 Dec 2013 15:57:50 -0500 Subject: [PATCH] Added #showspellslist command to show us a mob's spells --- changelog.txt | 3 +++ zone/MobAI.cpp | 12 ++++++++++++ zone/command.cpp | 20 ++++++++++++++++++++ zone/command.h | 1 + zone/npc.h | 1 + 5 files changed, 37 insertions(+) diff --git a/changelog.txt b/changelog.txt index 74e25d3e5..ee7dbb992 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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. diff --git a/zone/MobAI.cpp b/zone/MobAI.cpp index 689854a17..f1f0e08f4 100644 --- a/zone/MobAI.cpp +++ b/zone/MobAI.cpp @@ -2410,6 +2410,18 @@ void NPC::RemoveSpellFromNPCList(int16 spell_id) } } +void NPC::AISpellsList(Client *c) +{ + if (!c) + return; + + for (std::vector::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; diff --git a/zone/command.cpp b/zone/command.cpp index 9d0a25a8a..c149768b6 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -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. diff --git a/zone/command.h b/zone/command.h index c8860b8a9..116ac4fe5 100644 --- a/zone/command.h +++ b/zone/command.h @@ -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); diff --git a/zone/npc.h b/zone/npc.h index 25730543b..5e568d5df 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -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: