summaryrefslogtreecommitdiff
path: root/src/game-server/item.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-01-03 20:54:03 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-01-03 20:54:03 +0000
commit282ca19e33b79f4468ce6402406ddb1397f2d115 (patch)
tree8e9e3845353183c9838f7cce9eefcdbf566a9bd1 /src/game-server/item.cpp
parenta372dc5340a1d5653ef5a60c65c5a1501a333c6b (diff)
downloadmanaserv-282ca19e33b79f4468ce6402406ddb1397f2d115.tar.gz
manaserv-282ca19e33b79f4468ce6402406ddb1397f2d115.tar.bz2
manaserv-282ca19e33b79f4468ce6402406ddb1397f2d115.tar.xz
manaserv-282ca19e33b79f4468ce6402406ddb1397f2d115.zip
Starting to work on adding items to the map. Nothing concrete for now, just a few simplifications. Fixed file end-of-lines along the way.
Diffstat (limited to 'src/game-server/item.cpp')
-rw-r--r--src/game-server/item.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/game-server/item.cpp b/src/game-server/item.cpp
new file mode 100644
index 00000000..7eb9afb6
--- /dev/null
+++ b/src/game-server/item.cpp
@@ -0,0 +1,48 @@
+/*
+ * The Mana World Server
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+
+#include "game-server/item.hpp"
+
+bool ItemClass::use(Being *itemUser)
+{
+ bool usedSuccessfully = true;
+ // Applying Modifiers for a given lifetime
+ // TODO
+
+ // Calling a script if scriptName != ""
+ if (!mScriptName.empty())
+ {
+ if (runScript(itemUser) && usedSuccessfully)
+ return true;
+ else
+ return false;
+ }
+ else
+ return usedSuccessfully;
+}
+
+bool ItemClass::runScript(Being *itemUser)
+{
+ //TODO
+ return true;
+}