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

Leveling by walking

Landera

Veteran OT User
Joined
Nov 24, 2011
Messages
905
Solutions
1
Reaction score
318
Hello I'd like too request this.

when I'm walking on this special island you are getting 50 exp every step but you walk very slow.
island start from
x: 1005
y: 1012
z:7
too
x:1047
y:1034
z:7

hope some people could help me out im using
the forgotten server 0.3.6

Greetings
 
Last edited:
Translate it:

http://otland.net/f502/jak-zablokowaae-ua-ywanie-run-spelli-na-danym-obszarze-182948/

Just find in spells.cpp:

Code:
bool Spell::checkSpell(Player* player) const

Add:

Code:
const Position& pos = player->getPosition();
	if (pos.x >= POSFROMX && pos.x <= POSTOX && pos.y >= POSFROMY && pos.y <= POSTOY && pos.z == POSZ)
	{
		player->sendCancelMessage(RET_NOTPOSSIBLE);
		g_game.addMagicEffect(pos, MAGIC_EFFECT_POFF);
		return false;
	}
 
Lua:
function onCast(cid, target)
local from,to = {x=462, y=216, z=3},{x=563, y=282, z=3}
	if isPlayer(cid) then
	return not isInRange(getThingPosition(cid), from, to)
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid,"You Can't Use Any Spells Here")
	end
	end
 
Lua:
function onCast(cid, target)
local from,to = {x=462, y=216, z=3},{x=563, y=282, z=3}
	if isPlayer(cid) then
	return not isInRange(getThingPosition(cid), from, to)
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid,"You Can't Use Any Spells Here")
	end
	end

I get this message

Lua:
[08/06/2013 13:11:46] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/nospellonisland.lua:5: 'end' expected (to close 'if' at line 3) near 'doSendMagicEffect'
[08/06/2013 13:11:46] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/nospellonisland.lua)
[08/06/2013 13:11:46] data/creaturescripts/scripts/nospellonisland.lua:5: 'end' expected (to close 'if' at line 3) near 'doSendMagicEffect'
 
Code:
function onCast(cid, target)
local from,to = {x=462, y=216, z=3},{x=563, y=282, z=3}
	if isPlayer(cid) then
	return not isInRange(getThingPosition(cid), from, to)
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid,"You Can't Use Any Spells Here")
	end
        return true
end
	end
 
Lua:
[11/06/2013 21:36:34] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/nospellonisland.lua:5: 'end' expected (to close 'if' at line 3) near 'doSendMagicEffect'
[11/06/2013 21:36:34] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/nospellonisland.lua)
[11/06/2013 21:36:34] data/creaturescripts/scripts/nospellonisland.lua:5: 'end' expected (to close 'if' at line 3) near 'doSendMagicEffect'

still a bug
 
Lua:
function onCast(cid, target)
    local from,to = {x=462, y=216, z=3},{x=563, y=282, z=3}
    if isPlayer(cid) then
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid,"You are not allowed to use spells in this area.")
        return not isInRange(getThingPosition(cid), from, to)
    end
    return true
end
PLEASE TAB YOUR SCRIPTS. DAMN IT. And never put your return so far away from your end.
Note : This is a fix to Tetra20's script.
 
i can still cast spells in this area i have this is creaturescript

<event type="cast" name="antispell" event="script" value="nospellonisland.lua"/>

with the script of zuma master

ps no errors in the log

- - - Updated - - -

Upppp
 
Lua:
[16/06/2013 14:48:31] [Error - CreatureEvent::configureEvent] No valid type for creature event.oncast
[16/06/2013 14:48:31] [Warning - BaseEvents::loadFromXml] Cannot configure an event
 
Well... There is another way...
You'd have to edit every single spell script though x_x.

Or you can just dive into the sources. It's your choice, to be honest, your the one who will be doing the work, not me.
 
lol i made a fail bug
Lua:
function onCast(cid, target)
    local from,to = {x=462, y=216, z=3},{x=563, y=282, z=3}
    if isPlayer(cid) then
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid,"You are not allowed to use spells in this area.")
        return not isInRange(getThingPosition(cid), from, to)
    end
    return false
end
Lua:
<event type="Cast" name="antispell" event="script" value="nospellonisland.lua"/>
if it worked give me 50% credits and 50% to limos. :p 99% to work

- - - Updated - - -

200 post :D
 
kk this one will work 100%
Lua:
function onCast(cid, target)
	local condition = createConditionObject(CONDITION_PARALYZE)
	setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
	setConditionFormula(condition, -0.9, 40, -0.9, 0)
    local from,to = {x=462, y=216, z=3},{x=563, y=282, z=3}
    if isPlayer(cid) and getCreatureSpeed(cid) ~= 1 then
    if  (getCreatureCondition(cid, CONDITION_PARALYZE) == false) then
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid,"You are not allowed to use spells in this area.")
        doAddCondition(cid, condition)
        isInRange(getThingPosition(cid), from, to)
    end
    return true
	end
end

this should work

- - - Updated - - -

don't forget to put it in login

- - - Updated - - -

i don't mean the script to put it in login.
 
Last edited:
In case tetra20's script does not work, I can rewrite a new script for you. I need you to tell me what you want the script to do.

AFAIK, you just want spells to not be usable in a specific area, correct?
 

Similar threads

  • Question
RevScripts step on x/y/z
Replies
0
Views
110
Back
Top