diff options
| author | Rat <gmstreetrat@gmail.com> | 2012-01-23 22:40:38 -0800 |
|---|---|---|
| committer | Rat <gmstreetrat@gmail.com> | 2012-01-23 22:40:38 -0800 |
| commit | dad75019d46efa46237ea466385ee127922814a6 (patch) | |
| tree | 36aa8f364c6770178e2f3cf5648ea3485f99ce66 /src/server/scripts | |
| parent | 47909d916a3d15c22a50d53b06a321e675e63d25 (diff) | |
| parent | b56d9c5e96c9526643045eeaef59366549dffca5 (diff) | |
Merge pull request #4934 from DrakeFish/4x_2
4.x - Added most spline speed changes. (and others)
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_modify.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 9fc220e600a..00832aa4d59 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -60,6 +60,7 @@ public: { "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "", NULL }, { "phase", SEC_ADMINISTRATOR, false, &HandleModifyPhaseCommand, "", NULL }, { "gender", SEC_GAMEMASTER, false, &HandleModifyGenderCommand, "", NULL }, + { "collision", SEC_GAMEMASTER, false, &HandleModifyCollisionCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = @@ -1374,6 +1375,88 @@ public: return true; } + + static bool HandleModifyCollisionCommand(ChatHandler* handler, const char* args) + { + if (!*args) + return false; + + Player* target = handler->getSelectedPlayer(); + + if (!target) + { + handler->PSendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + + std::string param = (char*)args; + + if (param == "on") + { + // enable collision + WorldPacket data; + uint64 guid = target->GetGUID(); + uint8* bytes = (uint8*)&guid; + + data.Initialize(SMSG_MOVE_SPLINE_ENABLE_COLLISION, 1 + 8); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[3]); + + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[0]); + + target->SendMessageToSet(&data, true); + handler->SendSysMessage("Enabled Collision"); + return true; + } + + if (param == "off") + { + // disable collision + WorldPacket data; + uint64 guid = target->GetGUID(); + uint8* bytes = (uint8*)&guid; + + data.Initialize(SMSG_MOVE_SPLINE_DISABLE_COLLISION, 1 + 8); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[0]); + + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[2]); + + target->SendMessageToSet(&data, true); + handler->SendSysMessage("Disabled Collision"); + return true; + } + + return false; + } + }; void AddSC_modify_commandscript() |
