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

Shinra Tensei (area)

the spell works for me but no words appear.
there is no return true at the end of the script. im adding it there now, ill let u guys know if it makes the words show up.

yup add return true and it works

2 things
idea:
it should be made to work on monsters too

bug abuse: you can push ppl outta pz
 
@up
humm true, i'vent thought on it :p
as I said, it was a first version of script, I did it fast so I forgot some things like return true :p, sry xD
 
@up
humm true, i'vent thought on it :p
as I said, it was a first version of script, I did it fast so I forgot some things like return true :p, sry xD

there is another abuse.

you can push ppl with skulls into PZ. i would attempt to fix it but i suck at making spells
 
there is another abuse.

you can push ppl with skulls into PZ. i would attempt to fix it but i suck at making spells
asd that Nord's function seems to not be working :p
Lua:
if isWalkable (tp, true) and not getTileInfo(tp).protection then
 
cyber I should substitute the fuction you posted?
mine is like this:
Lua:
function isWalkable(pos, creature, proj, pz)-- by Nord
        if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
        if getTopCreature(pos).uid > 0 and creature then return false end
        if getTileInfo(pos).protection and pz then return false, true end
        local n = not proj and 3 or 2
        for i = 0, 255 do
                pos.stackpos = i
                local tile = getTileThingByPos(pos)
                if tile.itemid ~= 0 and not isCreature(tile.uid) then
                        if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                                return false
                        end
                end
        end
        return true
end

I should replace all for the one you posted?
 
no, in the script, change all the
Lua:
if isWalkable (tp, true) then
for
Lua:
if isWalkable (tp, true) and not getTileInfo(tp).protection then
 
now he spell works, thx cyber rep+ you :D
1 question, how can I do to teleport more them only 1 sqm?
 
now he spell works, thx cyber rep+ you :D
1 question, how can I do to teleport more them only 1 sqm?
change
Lua:
if getPlayerLevel(cid) < 25 then
dist = 1
elseif getPlayerLevel(cid) < 50 then
dist = 2
elseif getPlayerLevel(cid) < 70 then
dist = 3
else
dist = 4
end
to
Lua:
local dist = 1
 
you said only 1 sqm or more than 1sqm? o.o
 
more than 1 sqm per skill, because if I'm lvl 70 I have t say the spell 3 times, each time the other palayer is repeled 1 sqm, I want to make it so he will be teleported 3 sqm per spell ( sorry, i'm not good at english)
 
Well, I updated it a bit

now, target players take damage (random between 10 and 10+playerLvl)
effect on players' tiles
return true at the end of the script (for seeing the spell name when casted)
It repels more than 1 sql (depending on lvl, I put it that sql's repelled are equal to repelling area)
 
Well, I updated it a bit

now, target players take damage (random between 10 and 10+playerLvl)
effect on players' tiles
return true at the end of the script (for seeing the spell name when casted)
It repels more than 1 sql (depending on lvl, I put it that sql's repelled are equal to repelling area)
it's not really advisable to use doCreatureAddHealth for combat attacker-to-target attacks

this it It, improved a bit with combat damage and a better formula to get distance
Lua:
function getDistance(cid)
    local tile = {{20, 1},{40, 2},{60, 3},{80, 4},{100, 5}}
    table.sort(tile, function(a, b) return a[1] > b[1] end)
    for _, t in ipairs(tile) do    
        if(getPlayerLevel(cid) >= t[1]) then
            return t[2]
        end
    end
    return tile[1][2]
end

function onCastSpell(cid, var)
    local dist = getDistance(cid)
    local areaPosition = {
        {x=getCreaturePosition(cid).x-dist, y=getCreaturePosition(cid).y-dist, z=getCreaturePosition(cid).z, stackpos = 255},
        {x=getCreaturePosition(cid).x+dist, y=getCreaturePosition(cid).y+dist, z=getCreaturePosition(cid).z, stackpos = 255}
    }
    local players = getPlayersOnline()
    local dmg = math.random(10, getPlayerLevel(cid)+10)
 
    for i= 1, dist do
        for _, pid in ipairs(players) do
            if isInRange(getCreaturePosition(pid), areaPosition[1], areaPosition[2]) then
                local tp = getCreaturePosition(pid)
                    if (tp.x < getCreaturePosition(cid).x) and (tp.y < getCreaturePosition(cid).y) then
                        tp.x = tp.x-1
                        tp.y = tp.y-1
                        if isWalkable(tp, true) and not getTileInfo(tp).protection then
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                            doTeleportThing(pid, tp, true)
                            doTargetCombatHealth(cid, pid, COMBAT_PHYSICALDAMAGE, -dmg, -dmg, CONST_ME_BLOCKHIT)
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                        else    
                            doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF)
                        end
                    elseif (tp.x < getCreaturePosition(cid).x) and (tp.y > getCreaturePosition(cid).y) then
                        tp.x = tp.x-1
                        tp.y = tp.y+1
                        if isWalkable(tp, true) and not getTileInfo(tp).protection then
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                            doTeleportThing(pid, tp, true)
                            doTargetCombatHealth(cid, pid, COMBAT_PHYSICALDAMAGE, -dmg, -dmg, CONST_ME_BLOCKHIT)
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                        else
                            doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF)
                        end
                    elseif (tp.x < getCreaturePosition(cid).x) and (tp.y == getCreaturePosition(cid).y) then
                        tp.x = tp.x-1
                        if isWalkable(tp, true) and not getTileInfo(tp).protection then
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                            doTeleportThing(pid, tp, true)
                            doTargetCombatHealth(cid, pid, COMBAT_PHYSICALDAMAGE, -dmg, -dmg, CONST_ME_BLOCKHIT)
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                        else
                            doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF)
                        end
                    elseif (tp.x > getCreaturePosition(cid).x) and (tp.y < getCreaturePosition(cid).y) then
                        tp.x = tp.x+1 
                        tp.y = tp.y-1
                        if isWalkable(tp, true) and not getTileInfo(tp).protection then
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                            doTeleportThing(pid, tp, true)
                            doTargetCombatHealth(cid, pid, COMBAT_PHYSICALDAMAGE, -dmg, -dmg, CONST_ME_BLOCKHIT)
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                        else    
                            doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF)
                        end    
                    elseif (tp.x > getCreaturePosition(cid).x) and (tp.y > getCreaturePosition(cid).y) then
                        tp.x = tp.x+1
                        tp.y = tp.y+1
                        if isWalkable(tp, true) and not getTileInfo(tp).protection then
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                            doTeleportThing(pid, tp, true)
                            doTargetCombatHealth(cid, pid, COMBAT_PHYSICALDAMAGE, -dmg, -dmg, CONST_ME_BLOCKHIT)
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                        else
                            doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF)
                        end
                    elseif (tp.x > getCreaturePosition(cid).x) and (tp.y == getCreaturePosition(cid).y) then
                        tp.x = tp.x+1
                        if isWalkable(tp, true) and not getTileInfo(tp).protection then
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                            doTeleportThing(pid, tp, true)
                            doTargetCombatHealth(cid, pid, COMBAT_PHYSICALDAMAGE, -dmg, -dmg, CONST_ME_BLOCKHIT)
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                        else
                            doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF)
                        end
                    elseif (tp.x == getCreaturePosition(cid).x) and (tp.y < getCreaturePosition(cid).y) then
                        tp.y = tp.y-1
                        if isWalkable(tp, true) and not getTileInfo(tp).protection then
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                            doTeleportThing(pid, tp, true)
                            doTargetCombatHealth(cid, pid, COMBAT_PHYSICALDAMAGE, -dmg, -dmg, CONST_ME_BLOCKHIT)
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                        else
                            doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF)
                        end
                    elseif (tp.x == getCreaturePosition(cid).x) and (tp.y > getCreaturePosition(cid).y) then
                        tp.y = tp.y+1
                        if isWalkable(tp, true) and not getTileInfo(tp).protection then
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                            doTeleportThing(pid, tp, true)
                            doTargetCombatHealth(cid, pid, COMBAT_PHYSICALDAMAGE, -dmg, -dmg, CONST_ME_BLOCKHIT)
                            doSendMagicEffect(getCreaturePosition(pid), 34)
                        else
                            doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF)
                        end
                    end
                end
            end
        end
    return true
end
 
ok cyber thanks, i'm still learning :p,
you did it a bit easier configurable (and the combat formula), but still having near same script lines, but it's usefull for me to know more ways to do the things ;)
 
when you use it, players near you get repelled (moved/teleported) away from ur next, the more lvl you are, more distance they are repelled and more 'repelling' area you have, repelling area is the area afected by your spell
 
i didnt test it yet but the spell should completely ignore any1 in PZ and also any1 with access above 4.
 
that's easy, you only need to change lines like this:
Lua:
if (tp.x < getCreaturePosition(cid).x) and (tp.y < getCreaturePosition(cid).y) then

and add this:
Lua:
 and not getTileInfo(tp).protection and getPlayerAccess(cid) < 4
 
Back
Top