diff options
| author | Shauren <shauren.trinity@gmail.com> | 2015-07-19 00:31:11 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-07-19 00:31:11 +0200 |
| commit | 1273c0b5376c158d3009397071fa2dde5b1f384b (patch) | |
| tree | f1624b6e58db9c56213d7c586b7d2bb3e9c88f14 /src/server/scripts/Commands | |
| parent | f4536f38123c536d90733d047e1072b4dd88e910 (diff) | |
Core/PacketIO: Updated and enabled spell packets
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 18 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_modify.cpp | 18 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index aa0f1993621..b9a22162e2e 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -34,6 +34,7 @@ EndScriptData */ #include "Transport.h" #include "Language.h" #include "MovementPackets.h" +#include "SpellPackets.h" #include "ScenePackets.h" #include <fstream> @@ -213,16 +214,13 @@ public: char* fail2 = strtok(NULL, " "); uint8 failArg2 = fail2 ? (uint8)atoi(fail2) : 0; - WorldPacket data(SMSG_CAST_FAILED, 5); - data << uint8(0); - data << uint32(133); - data << uint8(failNum); - if (fail1 || fail2) - data << uint32(failArg1); - if (fail2) - data << uint32(failArg2); - - handler->GetSession()->SendPacket(&data); + WorldPackets::Spells::CastFailed castFailed(SMSG_CAST_FAILED); + castFailed.CastID = 0; + castFailed.SpellID = 133; + castFailed.Reason = failNum; + castFailed.FailedArg1 = failArg1; + castFailed.FailedArg2 = failArg2; + handler->GetSession()->SendPacket(castFailed.Write()); return true; } diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 3bcb6862b7f..9b4f78722c3 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -23,14 +23,13 @@ Category: commandscripts EndScriptData */ #include "Chat.h" -#include <stdlib.h> #include "ObjectMgr.h" #include "Opcodes.h" #include "Pet.h" #include "Player.h" #include "ReputationMgr.h" #include "ScriptMgr.h" - +#include "SpellPackets.h" class modify_commandscript : public CommandScript { @@ -407,12 +406,15 @@ public: if (handler->needReportToTarget(target)) ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, handler->GetNameLink().c_str(), spellflatid, val, mark); - WorldPacket data(SMSG_SET_FLAT_SPELL_MODIFIER, (1+1+2+2)); - data << uint8(spellflatid); - data << uint8(op); - data << uint16(val); - data << uint16(mark); - target->GetSession()->SendPacket(&data); + WorldPackets::Spells::SetSpellModifier packet(SMSG_SET_FLAT_SPELL_MODIFIER); + WorldPackets::Spells::SpellModifier spellMod; + spellMod.ModIndex = op; + WorldPackets::Spells::SpellModifierData modData; + modData.ClassIndex = spellflatid; + modData.ModifierValue = float(val); + spellMod.ModifierData.push_back(modData); + packet.Modifiers.push_back(spellMod); + target->GetSession()->SendPacket(packet.Write()); return true; } |
