From e26586ce6efaceb31ec534d488dace4d73702f56 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 9 Apr 2015 12:05:10 +0300 Subject: Add skill attributes with effect id what will play on caster and target while casting skill. New skill attributes: skillCastingSrcEffectId - will play this effect on caster while casting skill skillCastingDstEffectId - will play this effect on target while casting skill. This effects for casting skill, not for skill attack. --- src/net/eathena/beinghandler.cpp | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'src/net/eathena/beinghandler.cpp') diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 7667edcbb..3f0ecf4ac 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -34,8 +34,8 @@ #include "input/keyboardconfig.h" +#include "gui/windows/skilldialog.h" #include "gui/windows/socialwindow.h" - #include "gui/windows/outfitwindow.h" #include "net/serverfeatures.h" @@ -1137,15 +1137,36 @@ void BeingHandler::processMapType(Net::MessageIn &msg) void BeingHandler::processSkillCasting(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - msg.readInt32("src id"); - msg.readInt32("dst id"); - msg.readInt16("dst x"); - msg.readInt16("dst y"); - msg.readInt16("skill id"); + // +++ need use other parameters + + const int srcId = msg.readInt32("src id"); + const int dstId = msg.readInt32("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 msg.readInt32("cast time"); msg.readInt8("dispossable"); + + if (!effectManager) + return; + + if (srcId == 0) + { + UNIMPLIMENTEDPACKET; + return; + } + else if (dstId != 0) + { // being to being + Being *const srcBeing = actorManager->findBeing(srcId); + Being *const dstBeing = actorManager->findBeing(dstId); + skillDialog->playCastingSrcEffect(skillId, srcBeing); + skillDialog->playCastingDstEffect(skillId, dstBeing); + } + else if (dstX != 0 || dstY != 0) + { // being to position + UNIMPLIMENTEDPACKET; + } } void BeingHandler::processBeingStatusChange(Net::MessageIn &msg) -- cgit v1.2.3-70-g09d2