diff --git a/src/scripts/spells.lua b/src/scripts/spells.lua index 0525c68ab..1197db0eb 100644 --- a/src/scripts/spells.lua +++ b/src/scripts/spells.lua @@ -7,74 +7,50 @@ function creation_message(mage, type) end -- Erschaffe ein Flammenschwert -function create_firesword(r, mage, level, force) - mage:add_item("firesword", 1); - - local msg = creation_message(mage, "firesword") +local function create_item(mage, level, name) + local msg = creation_message(mage, name) msg:send_faction(mage.faction) + mage:add_item(name, 1); return level end +-- Erschaffe ein Flammenschwert +function create_firesword(r, mage, level, force) + return create_item(mage, level, "firesword") +end + -- Erschaffe einen Gürtel der Trollstärke function create_trollbelt(r, mage, level, force) - mage:add_item("trollbelt", 1); - - local msg = creation_message(mage, "trollbelt") - msg:send_faction(mage.faction) - return level + return create_item(mage, level, "trollbelt") end -- Erschaffe einen Ring der Unsichtbarkeit function create_roi(r, mage, level, force) - mage:add_item("roi", 1); - - local msg = creation_message(mage, "roi") - msg:send_faction(mage.faction) - return level + return create_item(mage, level, "roi") end -- Erschaffe einen Ring der flinken Finger function create_roqf(r, mage, level, force) - mage:add_item("roqf", 1); - - local msg = creation_message(mage, "roqf") - msg:send_faction(mage.faction) - return level + return create_item(mage, level, "roqf") end -- Erschaffe ein Amulett des wahren Sehens -function create_roi(r, mage, level, force) - mage:add_item("aots", 1); - - local msg = creation_message(mage, "aots") - msg:send_faction(mage.faction) - return level +function create_aots(r, mage, level, force) + return create_item(mage, level, "aots") end -- Erschaffe einen magischen Kräuterbeutel function create_magicherbbag(r, mage, level, force) - mage:add_item("aots", 1); - - local msg = creation_message(mage, "magicherbbag") - msg:send_faction(mage.faction) - return level + return create_item(mage, level, "magicherbbag") end -- Erschaffe einen Taktikkristal function create_dreameye(r, mage, level, force) - mage:add_item("", 1); - - local msg = creation_message(mage, "dreameye") - msg:send_faction(mage.faction) - return level + return create_item(mage, level, "dreameye") end -- Erschaffe einen Antimagiekristall function create_antimagic(r, mage, level, force) - mage:add_item("", 1); - - local msg = creation_message(mage, "antimagic") - msg:send_faction(mage.faction) - return level + return create_item(mage, level, "antimagic") end