• 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 [Tfs-1.x+] Infection_Spell.

slavi

#define SLAVI32 _WIN32
Senator
Joined
Sep 9, 2015
Messages
681
Solutions
11
Reaction score
560
GitHub
slavidodo
This spell is based on.

[ Side-Note ] This is my first gif image :D
Q2moYjI.gif



Freez System*
: https://otland.net/threads/tfs-1-x-freez-system-freezing-rune.238338/

but it's better to do that.

1-- make a custom monster with a name different than show-able name then make it summonable.


2-- create a file on spells/scripts/attack/advSummon.lua
http://pastebin.com/UHLxNZPc
and edit the config to fit yours.

2-- Add it to spells.xml -- I
Code:
<instant group="attack" spellid="9" name="GreatSummon" words="slavic summon" lvl="60" mana="490" prem="0" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="1000" groupcooldown="1000" needlearn="0" script="attack/advSummon.lua">
        <vocation name="Sorcerer"/>
        <vocation name="Druid"/>
    </instant>
 
When I use the spell on another player it works perfectly, but he gets freezed forever xD.

I dont know if it is because of this error:

Lua Script Error: [Spell Interface]
data/spells/scripts/customspells/advSummon.lua:eek:nCastSpell
data/spells/scripts/customspells/advSummon.lua:83: attempt to index global 'player' (a nil value)
stack traceback:
[C]: in function '__index'
data/spells/scripts/customspells/advSummon.lua:83: in function 'doSetFreezed'
data/spells/scripts/customspells/advSummon.lua:74: in function 'activeFreez'
data/spells/scripts/customspells/advSummon.lua:57: in function <data/spells/scripts/customspells/advSummon.lua:35>

Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
LuaScriptInterface::luaGetCreatureCondition(). Creature not found
stack traceback:
[C]: in function 'getCreatureCondition'
data/spells/scripts/customspells/advSummon.lua:107: in function <data/spells/scripts/customspells/advSummon.lua:86>


Here is the script:

Code:
--[[
        As I said you should have freez system to prevent player from moving L:D when you summon this :D
#Slavi
]]
local config = {
        onlyPlayer = false, -- only works on player?
        monsterName = "evil nomad", -- example monster ...
        monsterCount = 4, -- how much monsters should be made?
        waves = 1, -- not done yet.
      
        effect = 50, -- effect on target
        effect2 = 40, -- effect on each pet you summon.
      
        dEffect = 28, --CONST_ANI_TARSALARROW -- you must have seen gif image :D
      
        interval = 5, -- interval to remove pets in seconds
      
        extraDamage = true,
        safePercent = 20, -- in extra hit damage it low the damage if player's mana or health percent(depend on Magicshield active..) lower than this damage become half
        storageSummon = 1988455, -- Don't wanna use of storage? use spell time in spells.xml
        minDmg = 70,
        maxDmg = 120,
}
--[[
I already provided every configurable thing up.
so don't go down.
]]
function onCastSpell(cid, var)
        local player = Player(cid)
        local c = config
                if player:getTarget() then
                        if player:getStorageValue(c.storageSummon) > 0 then player:say("You can't summon now..", TALKTYPE_MONSTER_SAY); return false end
                        local target = player:getTarget()
                        if(not isPlayer(target))and(c.onlyPlayer)then
                                player:say("You can only summon on players", TALKTYPE_MONSTER_SAY)
                                return false
                        end
                        local pos = target:getPosition()
                        for i = 1, c.waves do
                                for s = 1, c.monsterCount do
                                        local creatureId = Game.createMonster(c.monsterName, pos)
                                        local monster = Monster(creatureId) or creatureId
                                        monster:setMaster(player)
                                        monster:getPosition():sendMagicEffect(c.effect)
                                        addEvent(removeSummon, config.interval * 1000, target.uid, creatureId.uid, c.extraDamage)
                                        player:getPosition():sendDistanceEffect(target:getPosition(), config.dEffect)
                                end
                        end
                        if target:isPlayer() then
                                activeFreez(target.uid, c.interval)
                        end
                        player:setStorageValue(c.storageSummon, 1)
                        addEvent(backStorage, (c.interval+10) * 1000, player.uid)
                        return true
                else
                        player:getPosition():sendMagicEffect(3)
                        player:say("No Target.", TALKTYPE_MONSTER_SAY) -- no target
                end   
end
function backStorage(cid)
        if not Player(cid) then return false end
        Player(cid):setStorageValue(config.storageSummon, 0)
        return true
end
function activeFreez(cid, interval)
        if Player(cid) then
                doSetFreezed(cid, true)
                Player(cid):say("Freezed", TALKTYPE_MONSTER_SAY)
                addEvent(doSetFreezed, interval*1000, cid, false)
        end
        return true
end
function doSetFreezed(cid, bool)
        if not Player(cid) then return false end
        Player(cid):setFreezed(bool)
        player:say("Melted", TALKTYPE_MONSTER_SAY)
        return true
end
function removeSummon(pid, tid, boolExtraAtk)
        if Creature(pid) then 
                if Creature(tid) then
                        tid = Creature(tid)
                        pid = Creature(pid)
                        local c = tid:getPosition()
                        if tid:remove() then
                                local p = pid:getPosition()
                                p:sendMagicEffect(config.effect2)
                                c:sendMagicEffect(config.effect)                      
                                if Creature(pid):isPlayer() then
                                        c:sendDistanceEffect(p, config.dEffect, Player(pid))
                                else
                                        c:sendDistanceEffect(p, config.dEffect)
                                end   
                                if boolExtraAtk then
                                        if not pid then return true end
                                        local hp, maxHp, mp, maxMp = pid:getHealth(), pid:getMaxHealth(), pid:getMana(), pid:getMaxMana()
                                        local pHp, pMp = (hp/maxHp)*100, (mp/maxMp)*100
                                        local sF, max, min = config.safePercent, config.maxDmg, config.minDmg
                                        if pid:isPlayer() then
                                                if getCreatureCondition(creature, CONDITION_MANASHIELD) == true then
                                                        if pMp > sF then
                                                                doTargetCombatMana(0, pid, -min, -max, 1)
                                                        else
                                                                doTargetCombatMana(0, pid, -(min/2), -(max/2), 1)
                                                        end
                                                else
                                                        if pHp > sF then
                                                        doTargetCombatHealth(0, pid, COMBAT_PHYSICALDAMAGE, min, max, 1)
                                                        else
                                                                doTargetCombatHealth(0, pid, COMBAT_PHYSICALDAMAGE, (min/2), (max/2), 1)
                                                        end
                                                end
                                        else
                                                if pHp > sF then
                                                        doTargetCombatHealth(0, pid, COMBAT_PHYSICALDAMAGE, min, max, 1)
                                                else
                                                        doTargetCombatHealth(0, pid, COMBAT_PHYSICALDAMAGE, (min/2), (max/2), 1)
                                                end
                                        end
                                end
                        end
                end
        end
end


I would really appreciate if someone could help me. Thank you!
 
Back
Top