diff options
-rw-r--r-- | example/scripts/main.lua | 3 | ||||
-rw-r--r-- | example/scripts/maps/desert.lua | 1 | ||||
-rw-r--r-- | example/status-effects.xml | 2 | ||||
-rw-r--r-- | src/game-server/statusmanager.cpp | 18 |
4 files changed, 5 insertions, 19 deletions
diff --git a/example/scripts/main.lua b/example/scripts/main.lua index 3418385..b43dd42 100644 --- a/example/scripts/main.lua +++ b/example/scripts/main.lua @@ -13,3 +13,6 @@ require "scripts/attributes" require "scripts/items/candy" require "scripts/monster/testmonster" + +require "scripts/status/jump" +require "scripts/status/plague" diff --git a/example/scripts/maps/desert.lua b/example/scripts/maps/desert.lua index 96518ac..782dd2b 100644 --- a/example/scripts/maps/desert.lua +++ b/example/scripts/maps/desert.lua @@ -71,6 +71,7 @@ end -- Global variable used to know whether Harmony talked to someone. harmony_have_talked_to_someone = false function Harmony(npc, ch, list) + being_apply_status(ch, 1, 99999) -- Say all the messages in the messages list. for i = 1, #list do npc_message(npc, ch, list[i]) diff --git a/example/status-effects.xml b/example/status-effects.xml index fda9083..0dd2b69 100644 --- a/example/status-effects.xml +++ b/example/status-effects.xml @@ -4,14 +4,12 @@ icon="icons/icon-poison.xml" persistent-particle-effect="true" start-particle="graphics/particles/green-bubbles.particle.xml" - script="plague.lua" tick-function="tick_plague" /> <status-effect name="Jumping Status" id="2" icon="icons/icon-feather.xml" persistent-particle-effect="true" start-particle="graphics/particles/magic.white.xml" - script="jump.lua" tick-function="tick_jump" /> </status-effects> diff --git a/src/game-server/statusmanager.cpp b/src/game-server/statusmanager.cpp index 7769ef0..389c4cc 100644 --- a/src/game-server/statusmanager.cpp +++ b/src/game-server/statusmanager.cpp @@ -22,8 +22,6 @@ #include "common/resourcemanager.h" #include "game-server/statuseffect.h" -#include "scripting/script.h" -#include "scripting/scriptmanager.h" #include "utils/logger.h" #include "utils/xml.h" @@ -86,7 +84,6 @@ void StatusManager::reload() } } - std::string scriptFile = XML::getProperty(node, "script", std::string()); //TODO: Get these modifiers /* modifiers.setAttributeValue(BASE_ATTR_PHY_ATK_MIN, XML::getProperty(node, "attack-min", 0)); @@ -100,20 +97,7 @@ void StatusManager::reload() modifiers.setAttributeValue(CHAR_ATTR_INTELLIGENCE, XML::getProperty(node, "intelligence", 0)); modifiers.setAttributeValue(CHAR_ATTR_WILLPOWER, XML::getProperty(node, "willpower", 0)); */ - if (!scriptFile.empty()) - { - std::stringstream filename; - filename << "scripts/status/" << scriptFile; - if (ResourceManager::exists(filename.str())) // file exists! - { - LOG_INFO("Loading status script: " << filename.str()); - Script *s = ScriptManager::currentState(); - s->loadFile(filename.str()); - } else { - LOG_WARN("Could not find script file \"" << filename.str() - << "\" for status #"<<id); - } - } + statusEffects[id] = statusEffect; } } |