diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-17 20:23:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-17 20:23:55 +0300 |
commit | 2814eb1240ad6fc2da0e6c617c8fc5b7c4380f1e (patch) | |
tree | 0a439115353036583da6cd9372bd9ca5a6bdd7a1 /src/net/eathena/beingrecv.cpp | |
parent | e9aed7e0fc8f75940448b0a46671aea9cdfa4d2d (diff) | |
download | manaverse-2814eb1240ad6fc2da0e6c617c8fc5b7c4380f1e.tar.gz manaverse-2814eb1240ad6fc2da0e6c617c8fc5b7c4380f1e.tar.bz2 manaverse-2814eb1240ad6fc2da0e6c617c8fc5b7c4380f1e.tar.xz manaverse-2814eb1240ad6fc2da0e6c617c8fc5b7c4380f1e.zip |
Add packet SMSG_SKILL_CASTING2.
Change net packet version to 18.
Diffstat (limited to 'src/net/eathena/beingrecv.cpp')
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index 3a1bcfb06..db3a61b4c 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -947,6 +947,46 @@ void BeingRecv::processSkillCasting(Net::MessageIn &msg) } } +void BeingRecv::processSkillCasting2(Net::MessageIn &msg) +{ + msg.readInt16("len"); // for now unused + const BeingId srcId = msg.readBeingId("src id"); + const BeingId dstId = msg.readBeingId("dst id"); + const int dstX = msg.readInt16("dst x"); + const int dstY = msg.readInt16("dst y"); + const int skillId = msg.readInt16("skill id"); + msg.readInt32("property"); // can be used to trigger effect + const int castTime = msg.readInt32("cast time"); + msg.readInt32("skill range"); + + if (!effectManager) + return; + + if (srcId == BeingId_zero) + { + UNIMPLIMENTEDPACKETFIELD(0); + return; + } + else if (dstId != BeingId_zero) + { // being to being + Being *const srcBeing = actorManager->findBeing(srcId); + Being *const dstBeing = actorManager->findBeing(dstId); + if (srcBeing) + srcBeing->setAction(BeingAction::CAST, skillId); + skillDialog->playCastingSrcEffect(skillId, srcBeing); + skillDialog->playCastingDstEffect(skillId, dstBeing); + } + else if (dstX != 0 || dstY != 0) + { // being to position + Being *const srcBeing = actorManager->findBeing(srcId); + if (srcBeing) + srcBeing->setAction(BeingAction::CAST, skillId); + skillDialog->playCastingDstTileEffect(skillId, + dstX, dstY, + castTime); + } +} + void BeingRecv::processBeingStatusChange(Net::MessageIn &msg) { BLOCK_START("BeingRecv::processBeingStatusChange") |