• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Unique spell that summons a demon

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
well i need a spell that summons a demon without using utevo res. just a spell that summons a demon point.

Thanks
 
@wafuboe
Tested on TFS 0.4 - 3777

giphy.gif


HTML:
<instant name="demon summon" words="utevo demon" exhaustion="2000" selftarget="1" enabled="0" needlearn="0" script="monster/demon.lua"/>
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_NONE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)

local maxsumons = 2

function onCastSpell(cid, var)
        local summoncount = getCreatureSummons(cid)
        if #summoncount < 2 then
                for i = 1, maxsumons - #summoncount do
                        doSummonMonster(cid, "Demon")
                end
        end
        return doCombat(cid, combat, var)
end
 
he uses 1.2 but didnt say
XML:
<instant group="1" spellid="141" name="summon demon" words="utevo demon" lvl="1" mana="0" prem="0" exhaustion="1000" needlearn="0" script="summon demon.lua"/>
LUA:
function onCastSpell(creature, variant)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    if #player:getSummons() >= 1 then
        player:sendCancelMessage("You have too many summons.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end
    local demon = Game.createMonster("Demon", player:getPosition(), true)
    player:getPosition():sendDistanceEffect(demon:getPosition(), CONST_ANI_FIRE)
    demon:getPosition():sendMagicEffect(CONST_ME_FIREAREA)
    demon:setMaster(player)
    return true
end
 
he uses 1.2 but didnt say
XML:
<instant group="1" spellid="141" name="summon demon" words="utevo demon" lvl="1" mana="0" prem="0" exhaustion="1000" needlearn="0" script="summon demon.lua"/>
LUA:
function onCastSpell(creature, variant)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    if #player:getSummons() >= 1 then
        player:sendCancelMessage("You have too many summons.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end
    local demon = Game.createMonster("Demon", player:getPosition(), true)
    player:getPosition():sendDistanceEffect(demon:getPosition(), CONST_ANI_FIRE)
    demon:getPosition():sendMagicEffect(CONST_ME_FIREAREA)
    demon:setMaster(player)
    return true
end

sorry if i not explained myself,
but it summons a monster heheh almost killed me, the demon will be a summon from the player o.o
is that possible?
 
LUA:
function onCastSpell(creature, variant)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    if #player:getSummons() >= 1 then
        player:sendCancelMessage("You have too many summons.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end
    local demon = Game.createMonster("Demon", player:getPosition(), true)
    player:getPosition():sendDistanceEffect(demon:getPosition(), CONST_ANI_FIRE)
    demon:getPosition():sendMagicEffect(CONST_ME_FIREAREA)
    demon:setMaster(player)
    demon:addFriend(player)
    return true
end
try this out instead, added demon:addFriend(player)
should work
 
LUA:
function onCastSpell(creature, variant)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    if #player:getSummons() >= 1 then
        player:sendCancelMessage("You have too many summons.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end
    local demon = Game.createMonster("Demon", player:getPosition(), true)
    player:getPosition():sendDistanceEffect(demon:getPosition(), CONST_ANI_FIRE)
    demon:getPosition():sendMagicEffect(CONST_ME_FIREAREA)
    demon:setMaster(player)
    demon:addFriend(player)
    return true
end
try this out instead, added demon:addFriend(player)
should work

still the same :s
 
Back
Top