summaryrefslogtreecommitdiff
path: root/src/npc.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-01-07 15:22:44 +0000
committerIra Rice <irarice@gmail.com>2009-01-18 14:10:43 -0700
commit8c79a56c0f3710e20888d1031f179dc98f37e0a4 (patch)
tree7051569ba28b217941cf39cf4776d1343b2c173f /src/npc.cpp
parent8446b826926ebbdb584cdfcd3dc5e4eb5bd142f1 (diff)
downloadmana-client-8c79a56c0f3710e20888d1031f179dc98f37e0a4.tar.gz
mana-client-8c79a56c0f3710e20888d1031f179dc98f37e0a4.tar.bz2
mana-client-8c79a56c0f3710e20888d1031f179dc98f37e0a4.tar.xz
mana-client-8c79a56c0f3710e20888d1031f179dc98f37e0a4.zip
Add dialogs to input text and numbers for scripts
Diffstat (limited to 'src/npc.cpp')
-rw-r--r--src/npc.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/npc.cpp b/src/npc.cpp
index a9aa216c..ae5ca476 100644
--- a/src/npc.cpp
+++ b/src/npc.cpp
@@ -134,6 +134,24 @@ void NPC::dialogChoice(char choice)
outMsg.writeInt8(choice);
}
+void NPC::integerInput(int value)
+{
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_NPC_INT_RESPONSE);
+ outMsg.writeInt32(mId);
+ outMsg.writeInt32(value);
+}
+
+void NPC::stringInput(const std::string &value)
+{
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_NPC_STR_RESPONSE);
+ outMsg.writeInt16(value.length() + 8);
+ outMsg.writeInt32(mId);
+ outMsg.writeString(value, value.length());
+ outMsg.writeInt8(0); // Just to be safe
+}
+
/*
* TODO Unify the buy() and sell() methods, without sacrificing readability of
* the code calling the method. buy(bool buySell) would be bad...