• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

pz on cast spell problem

Amanek

New Member
Joined
May 15, 2013
Messages
11
Reaction score
0
Hello!

I have a little problem with that spell. Dragon Breath.xml
How I can add to pz(can't enter to non pvp zone) for a player who is casting that spell?
 
if getTilePzInfo(pos) == false
then..

my code:
Code:
function DoBreathLoop(cid, combat, ticks)
    if isCreature(cid) then
        local newpos = getPosFromDir(getCreaturePosition(cid), getCreatureLookDirection(cid), 1)
        ticks = ticks - 250
        if isWalkable(cid, newpos) then doCombat(cid, combat, positionToVariant(newpos)) end
        if ticks > 0 then
            addEvent(DoBreathLoop, 250, cid, combat, ticks)
        end
    end
end

how I can connect it? Just add function param pos to DoBreathLoop(cid, combat, ticks)?
 
Last edited:
Lua:
function DoBreathLoop(cid, combat, ticks)
        if getTilePzInfo(pos) == false then
            local newpos = getPosFromDir(getCreaturePosition(cid), getCreatureLookDirection(cid), 1)
            ticks = ticks - 250
            if isWalkable(cid, newpos) then doCombat(cid, combat, positionToVariant(newpos)) end
            if ticks > 0 then
                addEvent(DoBreathLoop, 250, cid, combat, ticks)
            end
        end
end

Dont think you need if is creature..
 
Back
Top