• 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!

Hostile Summon?

The Forgotten Server - Version 0.3 (Crying Damson).

behaviour: summon cant be controled after getting summoned & auto attacks every player on sight (summoner too)
Post your animated dead script in spells, I don't feel like looking for your sources.. We can edit that file to build this script your requesting

Or you can do it yourself, the way summon creature works is that you create a new monster and then convince it, if you were to remove the convince aspect then it would be hostile to everyone including the player who summoned it.
 
YES moj!



Code:
local function doTargetCorpse(cid, pos)
    local getPos = pos
    getPos.stackpos = 255
    corpse = getThingfromPos(getPos)
    if(corpse.uid > 0 and isCreature(corpse.uid) == FALSE and isInArray(CORPSES, corpse.itemid) == TRUE) then
        doRemoveItem(corpse.uid)
        doPlayerSummonCreature(cid, "Skeleton", pos)
        doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
        return LUA_NO_ERROR
    end

    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    return LUA_ERROR
end

function onCastSpell(cid, var)
    local pos = variantToPosition(var)
    if(pos.x ~= 0 and pos.y ~= 0 and pos.z ~= 0) then
        return doTargetCorpse(cid, pos)
    end

    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
    return LUA_ERROR
end
 
Try this talkaction, it works like a spell, removes mana etc, but makes monster wild.

Create a file named summonwild.lua(paste code below inside) and place it in talkactions/scripts.
Code:
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, 2 * 1000)

function onSay(player, words, param)

    local orig = player:getPosition()

    if not isInArray({1, 2, 5, 6}, player:getVocation():getId()) then
        player:sendCancelMessage("Your vocation cannot use this spell.")
        orig:sendMagicEffect(CONST_ME_POFF)
        return
    end

    local monsterTyp = MonsterType(param)
    if not monsterTyp then
        player:sendCancelMessage("Sorry, not possible.")
        orig:sendMagicEffect(CONST_ME_POFF)
        return
    end

    if not monsterTyp:isSummonable() then
        player:sendCancelMessage("You cannot summon this creature.")
        orig:sendMagicEffect(CONST_ME_POFF)
        return
    end

    local manaCost = monsterTyp:getManaCost()
    if player:getMana() < manaCost then
        player:sendCancelMessage("You have not enough mana.")
        orig:sendMagicEffect(CONST_ME_POFF)
        return
    end

    if player:getCondition(CONDITION_EXHAUST_HEAL) then
        player:sendCancelMessage("You are exhausted.")
        orig:sendMagicEffect(CONST_ME_POFF)
        return
    end
    
    local creatureId = doSummonCreature(param, orig)
    if creatureId ~= false then
        local monster = Monster(creatureId)
        player:addMana(-manaCost)
        player:addCondition(exhaust)
        monster:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        orig:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    else
        player:sendCancelMessage("There is not enough room.")
        orig:sendMagicEffect(CONST_ME_POFF)
        return
    end
    return true
end


Code:
<talkaction words="utevo res wild" separator=" " script="summonwild.lua"/>

How to use:

Code:
utevo res wild monsterNameHere

Ops, too bad I read it was supposed to be for 0.3 TFS, I don't have that one so if someone can remake it for this version I'd be appreciated. lol me
 
Last edited:
[05/02/2015 15:08:39] Lua Script Error: [TalkAction Interface]
[05/02/2015 15:08:39] data/talkactions/scripts/summonwild.lua

[05/02/2015 15:08:39] data/talkactions/scripts/summonwild.lua:1: attempt to call global 'Condition' (a nil value)
[05/02/2015 15:08:39] Warning: [Event::loadScript] Can not load script. data/talkactions/scripts/summonwild.lua
 
Back
Top