summaryrefslogtreecommitdiffstats
path: root/src/game-server/character.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-11-01 19:03:14 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-11-01 19:03:14 +0000
commit7cdecda38dc75dd855a45af6faad14d1c1e4e72f (patch)
tree9fe6a6b31afcc0a710e6c327ad29a5c91db959ef /src/game-server/character.cpp
parentad5efe104cd7639009622393f16bfd93075fcb34 (diff)
Magic implementation roadmap phase 1 and 2 (calling a script function on PGMSG_USE_SPECIAL)
Diffstat (limited to 'src/game-server/character.cpp')
-rw-r--r--src/game-server/character.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game-server/character.cpp b/src/game-server/character.cpp
index bf8355c..61a5e1d 100644
--- a/src/game-server/character.cpp
+++ b/src/game-server/character.cpp
@@ -39,6 +39,7 @@
#include "game-server/mapmanager.hpp"
#include "game-server/state.hpp"
#include "game-server/trade.hpp"
+#include "scripting/script.hpp"
#include "net/messagein.hpp"
#include "net/messageout.hpp"
#include "serialize/characterdata.hpp"
@@ -141,6 +142,20 @@ void Character::respawn()
modifiedAttribute(BASE_ATTR_HP);
}
+void Character::useSpecial(int id)
+{
+ //TODO: look up which of its special attacks the character wants to use
+ //TODO: check if the character is allowed to use it right now
+
+ Script *s = getMap()->getScript();
+ s->prepare("cast");
+ s->push(this);
+ s->push(id);
+ s->execute();
+
+ return;
+}
+
int Character::getMapId() const
{
return getMap()->getID();