summaryrefslogtreecommitdiff
path: root/src/npc.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-07-19 15:12:06 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-07-19 15:12:06 +0000
commit4050f8c0bced625a95d542d30647c3f8bbf2267b (patch)
tree420d65a5ed6a2155762b4e13a4c90ab2df9f888e /src/npc.cpp
parentda3a1fd114dd7b8e5e8c880bd987506acc16ac42 (diff)
downloadmana-client-4050f8c0bced625a95d542d30647c3f8bbf2267b.tar.gz
mana-client-4050f8c0bced625a95d542d30647c3f8bbf2267b.tar.bz2
mana-client-4050f8c0bced625a95d542d30647c3f8bbf2267b.tar.xz
mana-client-4050f8c0bced625a95d542d30647c3f8bbf2267b.zip
Merged new_animation branch until r2415 into trunk.
Diffstat (limited to 'src/npc.cpp')
-rw-r--r--src/npc.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/npc.cpp b/src/npc.cpp
index 9712a06d..354322a3 100644
--- a/src/npc.cpp
+++ b/src/npc.cpp
@@ -34,21 +34,17 @@ NPC *current_npc = 0;
NPC::NPC(Uint32 id, Uint16 job, Map *map, Network *network):
Being(id, job, map), mNetwork(network)
{
- mSpriteset = npcset;
- mSpriteFrame = job-100;
+ mSprites[BASE_SPRITE] = new AnimatedSprite("graphics/sprites/npc.xml", job-100);
}
-Being::Type NPC::getType() const
+Being::Type
+NPC::getType() const
{
return Being::NPC;
}
-void NPC::draw(Graphics *graphics, int offsetX, int offsetY)
-{
- Being::draw(graphics, offsetX - 8, offsetY - 52);
-}
-
-void NPC::talk()
+void
+NPC::talk()
{
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_TALK);
@@ -57,14 +53,16 @@ void NPC::talk()
current_npc = this;
}
-void NPC::nextDialog()
+void
+NPC::nextDialog()
{
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_NEXT_REQUEST);
outMsg.writeInt32(mId);
}
-void NPC::dialogChoice(char choice)
+void
+NPC::dialogChoice(char choice)
{
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_LIST_CHOICE);
@@ -76,7 +74,8 @@ void NPC::dialogChoice(char choice)
* TODO Unify the buy() and sell() methods, without sacrificing readability of
* the code calling the method. buy(bool buySell) would be bad...
*/
-void NPC::buy()
+void
+NPC::buy()
{
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_BUY_SELL_REQUEST);
@@ -84,7 +83,8 @@ void NPC::buy()
outMsg.writeInt8(0);
}
-void NPC::sell()
+void
+NPC::sell()
{
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_BUY_SELL_REQUEST);