summaryrefslogtreecommitdiff
path: root/src/net/ea/beinghandler.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-25 22:50:59 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-25 22:50:59 +0100
commitcc79f0fe21e1a2ef73cbe987d54e848b9a47142d (patch)
treeedd316eb6094f0c02d6d014385865dcd88a2bc56 /src/net/ea/beinghandler.cpp
parentb0df784f1be44a657ca8092069488602270629b7 (diff)
parent99e8a3fd77b63a029fe02dcf771b6af1aad252ed (diff)
downloadmana-cc79f0fe21e1a2ef73cbe987d54e848b9a47142d.tar.gz
mana-cc79f0fe21e1a2ef73cbe987d54e848b9a47142d.tar.bz2
mana-cc79f0fe21e1a2ef73cbe987d54e848b9a47142d.tar.xz
mana-cc79f0fe21e1a2ef73cbe987d54e848b9a47142d.zip
Merge branch 'eathena/master'
Conflicts: A lot of files.
Diffstat (limited to 'src/net/ea/beinghandler.cpp')
-rw-r--r--src/net/ea/beinghandler.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 1edc6079..3629b075 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -35,6 +35,10 @@
#include "../../npc.h"
#include "../../player_relations.h"
+#include "../../gui/npc_text.h"
+
+extern NpcTextDialog *npcTextDialog;
+
const int EMOTION_TIME = 150; /**< Duration of emotion icon */
BeingHandler::BeingHandler(bool enableSync):
@@ -65,16 +69,16 @@ BeingHandler::BeingHandler(bool enableSync):
void BeingHandler::handleMessage(MessageIn &msg)
{
- Uint32 id;
+ int id;
Uint16 job, speed;
Uint16 headTop, headMid, headBottom;
Uint16 shoes, gloves;
Uint16 weapon, shield;
Uint16 gmstatus;
- Sint16 param1;
+ int param1;
int stunMode;
Uint32 statusEffects;
- Sint8 type;
+ int type;
Uint16 status;
Being *srcBeing, *dstBeing;
int hairStyle, hairColor, flag;
@@ -204,7 +208,12 @@ void BeingHandler::handleMessage(MessageIn &msg)
case SMSG_BEING_REMOVE:
// A being should be removed or has died
- dstBeing = beingManager->findBeing(msg.readInt32());
+ id = msg.readInt32();
+
+ if (id == current_npc)
+ npcTextDialog->showCloseButton();
+
+ dstBeing = beingManager->findBeing(id);
if (!dstBeing)
break;
@@ -213,9 +222,6 @@ void BeingHandler::handleMessage(MessageIn &msg)
if (dstBeing == player_node->getTarget())
player_node->stopAttack();
- if (dstBeing == current_npc)
- current_npc->handleDeath();
-
if (msg.readInt8() == 1)
dstBeing->setAction(Being::DEAD);
else
@@ -236,14 +242,17 @@ void BeingHandler::handleMessage(MessageIn &msg)
switch (type)
{
- case 0x0a: // Critical Damage
- if (dstBeing)
- dstBeing->showCrit();
- case 0x00: // Damage
+ case Being::HIT: // Damage
+ case Being::CRITICAL: // Critical Damage
+ case Being::MULTI: // Critical Damage
+ case Being::REFLECT: // Reflected Damage
+ case Being::FLEE: // Lucky Dodge
if (dstBeing)
- dstBeing->takeDamage(param1);
+ dstBeing->takeDamage(srcBeing, param1,
+ (Being::AttackType)type);
if (srcBeing)
- srcBeing->handleAttack(dstBeing, param1);
+ srcBeing->handleAttack(dstBeing, param1,
+ (Being::AttackType)type);
break;
case 0x02: // Sit
@@ -450,11 +459,6 @@ void BeingHandler::handleMessage(MessageIn &msg)
{
switch (msg.readInt8())
{
- case 1:
- if (dstBeing->getType() != Being::NPC)
- dstBeing->setAction(Being::DEAD);
- break;
-
case 2:
dstBeing->setAction(Being::SIT);
break;