diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-19 19:33:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-19 19:45:23 +0300 |
commit | 479e8a53ec90c19890dfb4b3746c4453769d806a (patch) | |
tree | 1d6499dd44145107e0d28dc4e3fbd96a214d4d7c /src/spellmanager.cpp | |
parent | 5583ed6cb475a3fbc717f717971f0887ecc0226a (diff) | |
download | manaverse-479e8a53ec90c19890dfb4b3746c4453769d806a.tar.gz manaverse-479e8a53ec90c19890dfb4b3746c4453769d806a.tar.bz2 manaverse-479e8a53ec90c19890dfb4b3746c4453769d806a.tar.xz manaverse-479e8a53ec90c19890dfb4b3746c4453769d806a.zip |
Add comment field to spells/commands.
Diffstat (limited to 'src/spellmanager.cpp')
-rw-r--r-- | src/spellmanager.cpp | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index 895ac94f2..4f7d038f2 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -68,31 +68,31 @@ void SpellManager::fillSpells() { //id, std::string name, std::string symbol, ST type, int basicLvl, MagicSchool school, int schoolLvl, int mana) - addSpell(new TextCommand(0, "lum", "#lum", ALLOWTARGET, + addSpell(new TextCommand(0, "lum", "#lum", "heal with lifestones", ALLOWTARGET, "", 1, SKILL_MAGIC_LIFE, 0, 6)); - addSpell(new TextCommand(1, "inm", "#inma", NEEDTARGET, + addSpell(new TextCommand(1, "inm", "#inma", "heal", NEEDTARGET, "", 2, SKILL_MAGIC_LIFE, 2, 10)); - addSpell(new TextCommand(2, "fla", "#flar", NOTARGET, + addSpell(new TextCommand(2, "fla", "#flar", "", NOTARGET, "", 1, SKILL_MAGIC_WAR, 0, 10)); - addSpell(new TextCommand(3, "chi", "#chiza", NOTARGET, + addSpell(new TextCommand(3, "chi", "#chiza", "", NOTARGET, "", 1, SKILL_MAGIC_WAR, 0, 9)); - addSpell(new TextCommand(4, "ing", "#ingrav", NOTARGET, + addSpell(new TextCommand(4, "ing", "#ingrav", "", NOTARGET, "", 2, SKILL_MAGIC_WAR, 2, 20)); - addSpell(new TextCommand(5, "fri", "#frillyar", NOTARGET, + addSpell(new TextCommand(5, "fri", "#frillyar", "", NOTARGET, "", 2, SKILL_MAGIC_WAR, 2, 25)); - addSpell(new TextCommand(6, "upm", "#upmarmu", NOTARGET, + addSpell(new TextCommand(6, "upm", "#upmarmu", "", NOTARGET, "", 2, SKILL_MAGIC_WAR, 2, 20)); - addSpell(new TextCommand(7, "ite", "#itenplz", NOTARGET, + addSpell(new TextCommand(7, "ite", "#itenplz", "", NOTARGET, "", 1, SKILL_MAGIC_NATURE, 0, 3)); - addSpell(new TextCommand(8, "bet", "#betsanc", ALLOWTARGET, + addSpell(new TextCommand(8, "bet", "#betsanc", "", ALLOWTARGET, "", 2, SKILL_MAGIC_NATURE, 2, 14)); - addSpell(new TextCommand(9, "abi", "#abizit", NOTARGET, + addSpell(new TextCommand(9, "abi", "#abizit", "", NOTARGET, "", 1, SKILL_MAGIC, 0, 1)); - addSpell(new TextCommand(10, "inw", "#inwilt", NOTARGET, + addSpell(new TextCommand(10, "inw", "#inwilt", "", NOTARGET, "", 2, SKILL_MAGIC, 2, 7)); - addSpell(new TextCommand(11, "hi", "hi", NOTARGET, "")); - addSpell(new TextCommand(12, "hea", "heal", NOTARGET, "")); - addSpell(new TextCommand(13, "@sp", "@spawn maggot 10", NOTARGET, "")); + addSpell(new TextCommand(11, "hi", "hi", "", NOTARGET, "")); + addSpell(new TextCommand(12, "hea", "heal", "", NOTARGET, "")); + addSpell(new TextCommand(13, "@sp", "@spawn maggot 10", "", NOTARGET, "")); for (int f = 12; f < SPELL_SHORTCUT_ITEMS * SPELL_SHORTCUT_TABS; f++) addSpell(new TextCommand(f)); } @@ -269,6 +269,8 @@ void SpellManager::load(bool oldConfig) std::string cmd = cfg->getValue("commandShortcutCmd" + toString(i), ""); + std::string comment = cfg->getValue("commandShortcutComment" + + toString(i), ""); std::string symbol = cfg->getValue("commandShortcutSymbol" + toString(i), ""); std::string icon = cfg->getValue("commandShortcutIcon" @@ -276,13 +278,13 @@ void SpellManager::load(bool oldConfig) if (static_cast<TextCommandType>(commandType) == TEXT_COMMAND_MAGIC) { - addSpell(new TextCommand(i, symbol, cmd, + addSpell(new TextCommand(i, symbol, cmd, comment, static_cast<SpellTarget>(targetType), icon, basicLvl, static_cast<MagicSchool>(school), schoolLvl, mana)); } else { - addSpell(new TextCommand(i, symbol, cmd, + addSpell(new TextCommand(i, symbol, cmd, comment, static_cast<SpellTarget>(targetType), icon)); } } @@ -304,6 +306,15 @@ void SpellManager::save() { serverConfig.deleteKey("commandShortcutCmd" + toString(i)); } + if (spell->getComment() != "") + { + serverConfig.setValue("commandShortcutComment" + toString(i), + spell->getComment()); + } + else + { + serverConfig.deleteKey("commandShortcutComment" + toString(i)); + } if (spell->getSymbol() != "") { serverConfig.setValue("commandShortcutSymbol" + toString(i), |