From 31d37104c775b691c950807a6add074eb73cdd14 Mon Sep 17 00:00:00 2001 From: Fate Date: Sun, 13 Dec 2009 03:10:18 +0000 Subject: Send skill updates to the status window, e.g. to update the job experience for eAthena --- src/localplayer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/localplayer.cpp b/src/localplayer.cpp index d670b3b6..260a5542 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -887,6 +887,9 @@ void LocalPlayer::setExperience(int skill, int current, int next) { addMessageToQueue(strprintf("%d %s xp", diff, name.c_str())); } + + if (statusWindow) + statusWindow->update(skill); } std::pair LocalPlayer::getExperience(int skill) -- cgit v1.2.3-70-g09d2 From 43b21002699c9c9707c742c3b30454487f4329a7 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Mon, 14 Dec 2009 07:19:44 +0100 Subject: Fixing a crash when pressing escape in charselectdialog The old code gave an exception fault, because when escape was pressed then event.getSource() was a null pointer. This resolves http://mantis.themanaworld.org/view.php?id=685 --- src/gui/charselectdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index 4f3619ae..8dc292ab 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -226,7 +226,7 @@ void CharSelectDialog::keyPressed(gcn::KeyEvent &keyEvent) if (key.getValue() == Key::ESCAPE) { - action(gcn::ActionEvent(NULL, mSwitchLoginButton->getActionEventId())); + action(gcn::ActionEvent(mSwitchLoginButton, mSwitchLoginButton->getActionEventId())); } } -- cgit v1.2.3-70-g09d2 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(+) 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