Jump to content

[PATCH] "Custom Command" .modify mirror


Recommended Posts

[PATCH] "Custom Command" .modify mirror

This can be done with the full help of Slurm thanks budy ;)

What this patch do?

-You can select a creature and mirror the dislpayid of this creature on your character.

This is good if your realms are full of little kids and want be all they see inside.

[idea]: Taby (My bb of 5 years old)

: Slurm
[Patch Autor]: Yim
[Revision Work]: [10199 and beyond]
[%WORK?]: Tested - Work

[url="http://getmangos.eu/community/viewtopic.php?id=14608"]Original Post[/url]

[code]
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 8dc9148..8ceaa09 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -350,6 +350,7 @@ ChatCommand * ChatHandler::getCommandTable()
        { "morph",          SEC_GAMEMASTER,     false, &ChatHandler::HandleModifyMorphCommand,         "", NULL },
        { "phase",          SEC_ADMINISTRATOR,  false, &ChatHandler::HandleModifyPhaseCommand,         "", NULL },
        { "gender",         SEC_GAMEMASTER,     false, &ChatHandler::HandleModifyGenderCommand,        "", NULL },
+        { "mirror",         SEC_GAMEMASTER,     false, &ChatHandler::HandleModifyMirrorCommand,        "", NULL }, ///// yim mirror
        { NULL,             0,                  false, NULL,                                           "", NULL }
    };

diff --git a/src/game/Chat.h b/src/game/Chat.h
index b82899e..f6d9ef6 100644
--- a/src/game/Chat.h
+++ b/src/game/Chat.h
@@ -275,6 +275,7 @@ class ChatHandler
        bool HandleModifyArenaCommand(const char* args);
        bool HandleModifyPhaseCommand(const char* args);
        bool HandleModifyGenderCommand(const char* args);
+        bool HandleModifyMirrorCommand(const char* args);

        //-----------------------Npc Commands-----------------------
        bool HandleNpcAddCommand(const char* args);
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 03a8c8a..dce483d 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -4694,3 +4694,22 @@ bool ChatHandler::HandleTitlesCurrentCommand(const char* args)

    return true;
}
+
+//mirror
+bool ChatHandler::HandleModifyMirrorCommand(const char* args)
+{
+    Creature *pCreature = getSelectedCreature();
+ 
+    if (!pCreature)
+    {
+        SendSysMessage("Please select a creature.");
+        SetSentErrorMessage(true);
+        return false;
+    }
+    CreatureInfo const* cInfo = pCreature->GetCreatureInfo();
+ 
+    m_session->GetPlayer()->SetDisplayId(cInfo->DisplayID_A[0]);
+    //To my knowledge in most scenarios DisplayID_A[0..1] and DisplayID_H[0..1] should be the same.
+ 
+    return true;
+}

Link to comment
Share on other sites

  • 40 years later...

This is indeed a great idea for a command. It is much easier than using .npc info and .morph, especially for Taby I bet ^_^

I hope she has fun with this!

Edit:

   CreatureInfo const* cInfo = pCreature->GetCreatureInfo();

   m_session->GetPlayer()->SetDisplayId(cInfo->DisplayID_A[0]);
   //To my knowledge in most scenarios DisplayID_A[0..1] and DisplayID_H[0..1] should be the same.

may not work for all creatures, you could get something that looks different DisplayID_A and H and the alt ids are not the same for quite a few creatures (mostly humanoids). The best way to do it is

m_session->GetPlayer()->SetDisplayId(pCreature->GetDisplayId());

You learn something new every day.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use