summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/beinghandler.cpp66
-rw-r--r--src/net/ea/charserverhandler.cpp37
-rw-r--r--src/net/ea/charserverhandler.h6
-rw-r--r--src/net/ea/gamehandler.h2
-rw-r--r--src/net/ea/protocol.h17
5 files changed, 85 insertions, 43 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index dbe108a0..b80410ff 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -192,14 +192,14 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
player->setGender((gender == 0)
? GENDER_FEMALE : GENDER_MALE);
// Set these after the gender, as the sprites may be gender-specific
- player->setSprite(Player::HAIR_SPRITE, hairStyle * -1, ColorDB::get(hairColor));
- player->setSprite(Player::BOTTOMCLOTHES_SPRITE, headBottom);
- player->setSprite(Player::TOPCLOTHES_SPRITE, headMid);
- player->setSprite(Player::HAT_SPRITE, headTop);
- player->setSprite(Player::SHOE_SPRITE, shoes);
- player->setSprite(Player::GLOVES_SPRITE, gloves);
- player->setSprite(Player::WEAPON_SPRITE, weapon);
- player->setSprite(Player::SHIELD_SPRITE, shield);
+ player->setSprite(SPRITE_HAIR, hairStyle * -1, ColorDB::get(hairColor));
+ player->setSprite(SPRITE_BOTTOMCLOTHES, headBottom);
+ player->setSprite(SPRITE_TOPCLOTHES, headMid);
+ player->setSprite(SPRITE_HAT, headTop);
+ player->setSprite(SPRITE_SHOE, shoes);
+ player->setSprite(SPRITE_GLOVES, gloves);
+ player->setSprite(SPRITE_WEAPON, weapon, "", true);
+ player->setSprite(SPRITE_SHIELD, shield);
}
if (msg.getId() == SMSG_BEING_MOVE)
@@ -431,41 +431,41 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
switch (type)
{
case 1: // eAthena LOOK_HAIR
- player->setSpriteID(Player::HAIR_SPRITE, id *-1);
+ player->setSpriteID(SPRITE_HAIR, id *-1);
break;
case 2: // Weapon ID in id, Shield ID in id2
- player->setSprite(Player::WEAPON_SPRITE, id);
- player->setSprite(Player::SHIELD_SPRITE, id2);
+ player->setSprite(SPRITE_WEAPON, id, "", true);
+ player->setSprite(SPRITE_SHIELD, id2);
break;
case 3: // Change lower headgear for eAthena, pants for us
- player->setSprite(Player::BOTTOMCLOTHES_SPRITE, id);
+ player->setSprite(SPRITE_BOTTOMCLOTHES, id);
break;
case 4: // Change upper headgear for eAthena, hat for us
- player->setSprite(Player::HAT_SPRITE, id);
+ player->setSprite(SPRITE_HAT, id);
break;
case 5: // Change middle headgear for eathena, armor for us
- player->setSprite(Player::TOPCLOTHES_SPRITE, id);
+ player->setSprite(SPRITE_TOPCLOTHES, id);
break;
case 6: // eAthena LOOK_HAIR_COLOR
- player->setSpriteColor(Player::HAIR_SPRITE, ColorDB::get(id));
+ player->setSpriteColor(SPRITE_HAIR, ColorDB::get(id));
break;
case 8: // eAthena LOOK_SHIELD
- player->setSprite(Player::SHIELD_SPRITE, id);
+ player->setSprite(SPRITE_SHIELD, id);
break;
case 9: // eAthena LOOK_SHOES
- player->setSprite(Player::SHOE_SPRITE, id);
+ player->setSprite(SPRITE_SHOE, id);
break;
case 10: // LOOK_GLOVES
- player->setSprite(Player::GLOVES_SPRITE, id);
+ player->setSprite(SPRITE_GLOVES, id);
break;
case 11: // LOOK_CAPE
- player->setSprite(Player::CAPE_SPRITE, id);
+ player->setSprite(SPRITE_CAPE, id);
break;
case 12:
- player->setSprite(Player::MISC1_SPRITE, id);
+ player->setSprite(SPRITE_MISC1, id);
break;
case 13:
- player->setSprite(Player::MISC2_SPRITE, id);
+ player->setSprite(SPRITE_MISC2, id);
break;
default:
logger->log("SMSG_BEING_CHANGE_LOOKS: unsupported type: "
@@ -538,8 +538,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
headTop = msg.readInt16();
headMid = msg.readInt16();
hairColor = msg.readInt16();
- msg.readInt16(); // clothes color - Aethyra-"abused" as shoes, we ignore it
- msg.readInt16(); // head dir - Aethyra-"abused" as gloves, we ignore it
+ shoes = msg.readInt16();
+ gloves = msg.readInt16();
msg.readInt32(); // guild
msg.readInt16(); // emblem
msg.readInt16(); // manner
@@ -549,15 +549,17 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
? GENDER_FEMALE : GENDER_MALE);
// Set these after the gender, as the sprites may be gender-specific
- player->setSprite(Player::WEAPON_SPRITE, weapon);
- player->setSprite(Player::SHIELD_SPRITE, shield);
- player->setSprite(Player::BOTTOMCLOTHES_SPRITE, headBottom);
- player->setSprite(Player::TOPCLOTHES_SPRITE, headMid);
- player->setSprite(Player::HAT_SPRITE, headTop);
- //player->setSprite(Player::CAPE_SPRITE, cape);
- //player->setSprite(Player::MISC1_SPRITE, misc1);
- //player->setSprite(Player::MISC2_SPRITE, misc2);
- player->setSprite(Player::HAIR_SPRITE, hairStyle * -1, ColorDB::get(hairColor));
+ player->setSprite(SPRITE_WEAPON, weapon, "", true);
+ player->setSprite(SPRITE_SHIELD, shield);
+ player->setSprite(SPRITE_SHOE, shoes);
+ player->setSprite(SPRITE_BOTTOMCLOTHES, headBottom);
+ player->setSprite(SPRITE_TOPCLOTHES, headMid);
+ player->setSprite(SPRITE_HAT, headTop);
+ player->setSprite(SPRITE_GLOVES, gloves);
+ //player->setSprite(SPRITE_CAPE, cape);
+ //player->setSprite(SPRITE_MISC1, misc1);
+ //player->setSprite(SPRITE_MISC2, misc2);
+ player->setSprite(SPRITE_HAIR, hairStyle * -1, ColorDB::get(hairColor));
if (msg.getId() == SMSG_PLAYER_MOVE)
{
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp
index a8a5260f..4e3f3c37 100644
--- a/src/net/ea/charserverhandler.cpp
+++ b/src/net/ea/charserverhandler.cpp
@@ -191,10 +191,10 @@ LocalPlayer *CharServerHandler::readPlayerData(Net::MessageIn &msg, int &slot)
int temp = msg.readInt32();
tempPlayer->setAttributeBase(JOB, temp, false);
tempPlayer->setAttributeEffective(JOB, temp);
- tempPlayer->setSprite(Player::SHOE_SPRITE, msg.readInt16());
- tempPlayer->setSprite(Player::GLOVES_SPRITE, msg.readInt16());
- tempPlayer->setSprite(Player::CAPE_SPRITE, msg.readInt16());
- tempPlayer->setSprite(Player::MISC1_SPRITE, msg.readInt16());
+ tempPlayer->setSprite(SPRITE_SHOE, msg.readInt16());
+ tempPlayer->setSprite(SPRITE_GLOVES, msg.readInt16());
+ tempPlayer->setSprite(SPRITE_CAPE, msg.readInt16());
+ tempPlayer->setSprite(SPRITE_MISC1, msg.readInt16());
msg.readInt32(); // option
msg.readInt32(); // karma
msg.readInt32(); // manner
@@ -207,15 +207,15 @@ LocalPlayer *CharServerHandler::readPlayerData(Net::MessageIn &msg, int &slot)
msg.readInt16(); // class
int hairStyle = msg.readInt16();
Uint16 weapon = msg.readInt16();
- tempPlayer->setSprite(Player::WEAPON_SPRITE, weapon);
+ tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", true);
tempPlayer->setLevel(msg.readInt16());
msg.readInt16(); // skill point
- tempPlayer->setSprite(Player::BOTTOMCLOTHES_SPRITE, msg.readInt16()); // head bottom
- tempPlayer->setSprite(Player::SHIELD_SPRITE, msg.readInt16());
- tempPlayer->setSprite(Player::HAT_SPRITE, msg.readInt16()); // head option top
- tempPlayer->setSprite(Player::TOPCLOTHES_SPRITE, msg.readInt16()); // head option mid
- tempPlayer->setSprite(Player::HAIR_SPRITE, hairStyle * -1, ColorDB::get(msg.readInt16()));
- tempPlayer->setSprite(Player::MISC2_SPRITE, msg.readInt16());
+ tempPlayer->setSprite(SPRITE_BOTTOMCLOTHES, msg.readInt16()); // head bottom
+ tempPlayer->setSprite(SPRITE_SHIELD, msg.readInt16());
+ tempPlayer->setSprite(SPRITE_HAT, msg.readInt16()); // head option top
+ tempPlayer->setSprite(SPRITE_TOPCLOTHES, msg.readInt16()); // head option mid
+ tempPlayer->setSprite(SPRITE_HAIR, hairStyle * -1, ColorDB::get(msg.readInt16()));
+ tempPlayer->setSprite(SPRITE_MISC2, msg.readInt16());
tempPlayer->setName(msg.readString(24));
for (int i = 0; i < 6; i++)
tempPlayer->setAttributeBase(i + STR, msg.readInt8(), false);
@@ -291,6 +291,21 @@ void CharServerHandler::switchCharacter()
outMsg.writeInt8(1);
}
+unsigned int CharServerHandler::baseSprite() const
+{
+ return SPRITE_BASE;
+}
+
+unsigned int CharServerHandler::hairSprite() const
+{
+ return SPRITE_HAIR;
+}
+
+unsigned int CharServerHandler::maxSprite() const
+{
+ return SPRITE_VECTOREND;
+}
+
void CharServerHandler::connect()
{
const Token &token =
diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h
index b1e2b797..b29e9518 100644
--- a/src/net/ea/charserverhandler.h
+++ b/src/net/ea/charserverhandler.h
@@ -65,6 +65,12 @@ class CharServerHandler : public MessageHandler, public Net::CharHandler
void switchCharacter();
+ unsigned int baseSprite() const;
+
+ unsigned int hairSprite() const;
+
+ unsigned int maxSprite() const;
+
void connect();
protected:
diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h
index 0095ada3..39abbbd1 100644
--- a/src/net/ea/gamehandler.h
+++ b/src/net/ea/gamehandler.h
@@ -54,6 +54,8 @@ class GameHandler : public MessageHandler, public Net::GameHandler
void ping(int tick);
+ bool removeDeadBeings() const { return true; }
+
void clear();
};
diff --git a/src/net/ea/protocol.h b/src/net/ea/protocol.h
index f17ded61..767e7f82 100644
--- a/src/net/ea/protocol.h
+++ b/src/net/ea/protocol.h
@@ -41,6 +41,23 @@ enum {
CRIT
};
+enum
+{
+ SPRITE_BASE = 0,
+ SPRITE_SHOE,
+ SPRITE_BOTTOMCLOTHES,
+ SPRITE_TOPCLOTHES,
+ SPRITE_MISC1,
+ SPRITE_MISC2,
+ SPRITE_HAIR,
+ SPRITE_HAT,
+ SPRITE_CAPE,
+ SPRITE_GLOVES,
+ SPRITE_WEAPON,
+ SPRITE_SHIELD,
+ SPRITE_VECTOREND
+};
+
static const int INVENTORY_OFFSET = 2;
static const int STORAGE_OFFSET = 1;