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

Spell Jutsu Shadow Clones

-.- it worked 1 time and then i killed the clones and when i tried again it says "you already have clones"
 
Cause there's no attachment which checks when clones dying.
 
then this spell sucks?
 
maybe its because i made a monster called undead clone instead of clone?


Code:
local removeTime = 60 --time to remove the clones
local HAVE_CLONE = 65533 --storage to know if you have clones or not
local arr = {
    {
        {1},
        {2}
    },
 
    {
        {1, 0, 1},
        {0, 2, 0}
    },
     
    {
        {1, 0, 1},
        {0, 2, 0},
        {1, 0, 1}
    },
     
    {
        {1, 0, 1},
        {1, 2, 1},
        {1, 0, 1}
    },
     
    {
        {1, 1, 1},
        {1, 2, 1},
        {1, 1, 1}
    },
     
    {
        {1, 1, 0, 1, 1},
        {1, 0, 1, 0, 1},
        {0, 1, 2, 1, 0},
        {1, 0, 1, 0, 1},
        {1, 1, 0, 1, 1}
    }
}

local function removeCreatures(cid, creature)
        setPlayerStorageValue(cid, HAVE_CLONE, 0)
        if isCreature(creature) == TRUE then
                doRemoveCreature(creature)
        end
end

function onTargetTile(cid, pos)
local creature = doSummonCreature("Undead Clone", pos)
        doConvinceCreature(cid, creature)
        setCreatureMaxHealth(creature, getCreatureMaxHealth(cid))
        doCreatureAddHealth(creature, getCreatureMaxHealth(cid))
        setCreatureMaxMana(creature, getCreatureMaxMana(cid))
        doCreatureAddMana(creature, getCreatureMaxMana(cid))
        doChangeSpeed(creature, getCreatureBaseSpeed(cid))
        doSetCreatureOutfit(creature, getCreatureOutfit(cid), -1)
        addEvent(removeCreatures, removeTime * 1000, cid, creature)
        return TRUE
end

local combat = {}
for i = 1, 6 do
        combat[i] = createCombatObject()
        setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_POFF)
        setCombatArea(combat[i], createCombatArea(arr[i]))
        _G["onTargetTile" .. i] = onTargetTile
        setCombatCallback(combat[i], CALLBACK_PARAM_TARGETTILE, "onTargetTile" .. i)
end
 
function onCastSpell(cid, var)
local level = getPlayerLevel(cid)
        if getPlayerStorageValue(cid, HAVE_CLONE) < 1 then
                if level < 30 then
                        doCombat(cid, combat[1], var)
                elseif level < 60 then
                        doCombat(cid, combat[2], var)
                elseif level < 80 then
                        doCombat(cid, combat[3], var)
                elseif level < 95 then
                        doCombat(cid, combat[4], var)
                elseif level < 120 then
                        doCombat(cid, combat[5], var)
                else
                        doCombat(cid, combat[6], var)
                end
                setPlayerStorageValue(cid, HAVE_CLONE, 1)
        else
                doPlayerSendCancel(cid, "You already have clones.")
        end
end

should i change something?
 
what if the player is forced to disconect by closeserver or kick commands while the storage value is active? - the storage saves un player the you cant summon your clones again 'cause you already have that storage value
 
@up: use your mind

just add a function to login.lua
setPlayerStorageValue and that's fixed
 
Sorry for this off-topic post, but this reminds me of when I used to teleport into doors and then teleport 1sqm out.

Illusionary double!
o_O!
 
Is it possible to "clone" the person's attack, such as a normal hit? Without source edditing that is.
 
idit this script ...
I already liked the most vo edits to see how it goes is
 
how to let the monster name match the name of player that summon?
 
Last edited:
[01/02/2011 03:07:35] Lua Script Error: [Spell Interface]
[01/02/2011 03:07:35] in callback: data/spells/scripts/support/clone.lua:eek:nTargetTile2
[01/02/2011 03:07:35] (Unknown scriptfile)
[01/02/2011 03:07:35] data/spells/scripts/support/clone.lua:51: attempt to call global 'setCreatureMaxHealth' (a nil value)
[01/02/2011 03:07:35] stack traceback:
[01/02/2011 03:07:35] [C]: in function 'setCreatureMaxHealth'
[01/02/2011 03:07:36] data/spells/scripts/support/clone.lua:51: in function <data/spells/scripts/support/clone.lua:48>
[01/02/2011 03:07:36] [C]: in function 'doCombat'
[01/02/2011 03:07:36] data/spells/scripts/support/clone.lua:76: in function <data/spells/scripts/support/clone.lua:70>
 
Back
Top