From 2fb618f226a5cc0c3fd7238bdc3391de24f3ec1d Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Wed, 16 Dec 2009 17:56:34 +1300 Subject: Handle skill_damage (eathena) --- src/net/ea/beinghandler.cpp | 18 ++++++++++++++++++ src/net/ea/protocol.h | 1 + 2 files changed, 19 insertions(+) (limited to 'src') diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index 1ede1b8d..cba1c984 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -50,6 +50,7 @@ BeingHandler::BeingHandler(bool enableSync): SMSG_BEING_MOVE, SMSG_BEING_MOVE2, SMSG_BEING_REMOVE, + SMSG_SKILL_DAMAGE, SMSG_BEING_ACTION, SMSG_BEING_SELFEFFECT, SMSG_BEING_EMOTION, @@ -290,6 +291,23 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) break; + case SMSG_SKILL_DAMAGE: + msg.readInt16(); // Skill Id + srcBeing = beingManager->findBeing(msg.readInt32()); + dstBeing = beingManager->findBeing(msg.readInt32()); + msg.readInt32(); // Server tick + msg.readInt32(); // src speed + msg.readInt32(); // dst speed + param1 = msg.readInt32(); // Damage + msg.readInt16(); // Skill level + msg.readInt16(); // Div + msg.readInt8(); // Skill hit/type (?) + if (dstBeing) + dstBeing->takeDamage(srcBeing, param1, Being::HIT); // Perhaps a new skill attack type should be created and used? + if (srcBeing) + srcBeing->handleAttack(dstBeing, param1, Being::HIT); + break; + case SMSG_BEING_ACTION: srcBeing = beingManager->findBeing(msg.readInt32()); dstBeing = beingManager->findBeing(msg.readInt32()); diff --git a/src/net/ea/protocol.h b/src/net/ea/protocol.h index 75d0d30e..f17ded61 100644 --- a/src/net/ea/protocol.h +++ b/src/net/ea/protocol.h @@ -95,6 +95,7 @@ static const int STORAGE_OFFSET = 1; #define SMSG_PLAYER_SKILLS 0x010f #define SMSG_PLAYER_SKILL_UP 0x010e #define SMSG_SKILL_FAILED 0x0110 +#define SMSG_SKILL_DAMAGE 0x01de #define SMSG_ITEM_USE_RESPONSE 0x00a8 #define SMSG_ITEM_VISIBLE 0x009d /**< An item is on the floor */ #define SMSG_ITEM_DROPPED 0x009e /**< An item is dropped */ -- cgit v1.2.3-70-g09d2