Commands/Npc: Add AIName/ScriptName to npc info

Thanks Aokromes for suggestion
This commit is contained in:
kaelima
2011-12-18 22:45:23 +01:00
parent b4df932e71
commit 7a2f7b0e63
3 changed files with 9 additions and 7 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `trinity_string` WHERE `entry`=5031;
INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES
(5031, 'AIName: %s ScriptName: %s');

View File

@@ -946,8 +946,9 @@ enum TrinityStrings
LANG_GOINFO_NAME = 5027,
LANG_GOINFO_LOOTID = 5028,
LANG_COMMAND_LOOKUP_MAX_RESULTS = 5029,
// Room for more Trinity strings 5030-9999
LANG_FLEE = 5030,
LANG_NPCINFO_AIINFO = 5031,
// Room for more Trinity strings 5032-9999
// Level requirement notifications
LANG_SAY_REQ = 6604,

View File

@@ -552,15 +552,13 @@ public:
handler->PSendSysMessage(LANG_NPCINFO_PHASEMASK, target->GetPhaseMask());
handler->PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor());
handler->PSendSysMessage(LANG_NPCINFO_POSITION, float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ()));
handler->PSendSysMessage(LANG_NPCINFO_AIINFO, target->GetAIName().c_str(), target->GetScriptName().c_str());
if ((npcflags & UNIT_NPC_FLAG_VENDOR))
{
if (npcflags & UNIT_NPC_FLAG_VENDOR)
handler->SendSysMessage(LANG_NPCINFO_VENDOR);
}
if ((npcflags & UNIT_NPC_FLAG_TRAINER))
{
if (npcflags & UNIT_NPC_FLAG_TRAINER)
handler->SendSysMessage(LANG_NPCINFO_TRAINER);
}
return true;
}