• 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:
@Zuma i wrote to him a script that 100% works because it check twice
1-if the player cast spell and he doesn't have the paralyze condition it will add it to him if he is in the area
2- if the player have speed more than 1 in the area it will add the paralyze to him
:p
 
No. Your script will not disable the usage of spells inside the specified area. Your script should paralyze a player when he casts a spell. AFAIK, that wasn't what the OP wanted.
 
he wanted to disable the effect of utani gran hur and utani hur with that way he can't use utani gran hur

- - - Updated - - -

or he could use
Lua:
doPlayerUnlearnInstantSpell(cid, name)
 
he wanted to disable the effect of utani gran hur and utani hur with that way he can't use utani gran hur
...
or he could use
Lua:
doPlayerUnlearnInstantSpell(cid, name)



There would be no need to. You should simply make a movement script for the paralyzing part, and a creaturescript for disabling spells inside a certain area. I can do this if the OP desires so. I currently have free time.

*EDIT-1*: There would probably be no need to do a source edit either. (hint: probably).
 
add this part to the stepin in movment that gives experience
Lua:
doPlayerUnlearnInstantSpell(cid, utani gran hur)
        doPlayerUnlearnInstantSpell(cid, utani hur)
 
Then my work is needed. Come back after an hour, I should be done by then.

EDIT:
@tetra20,

That will not work. It should be like this:

doPlayerUnlearnInstantSpell(cid, "Strong Haste") <--- For utani gran hur.

And even then, it will remove the usage of the spell forever.
 
An even better solution would be addEvent. You would not need to use a second event function.

I'm talking about what your script would do. You are offering a faulty script to the OP, and I'm simply dissecting it. I definitely know what can and cannot be done to revert such a fault in your script, but that does not mean your script is complete, and that also doesn't mean that I do not know how to fix it.
 
First of all, remove all the scripts that you have used in this post, read the notes, and then follow the steps.

Notes:
1: When I say "datapack", I'm referring to your "data" folder.
2: Make sure to read the notes that I left for you inside of the scripts.

First step: (the paralyze)

1- Go to datapack/movements/, and open movements.xml, then add this line to it:
XML:
<movevent type="StepIn" actionid="21212" event="script" value="paralyzetile.lua"/>

2- Go to datapack/movements/scripts/, then create a new file here, name it "paralyzetile.lua". (without the quotation marks)
After you create it, add this script to it:
Lua:
    local condition = createConditionObject(CONDITION_PARALYZE)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 2000)
    setConditionFormula(condition, -0.9, 0, -0.9, 0)
    
    function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
        if(not (getCreatureCondition(cid, CONDITION_PARALYZE))) then
    	    doAddCondition(cid, condition)
    	end
        doItemSetAttribute(getTileThingByPos(toPosition).uid, "aid", 21212)
        return true
    end
The nice thing about this script is, you don't have to put an action id on every single tile you want to activate this script... Only the first tile is enough!
It will add it to all the other tiles the player attemps to walk to!
But be sure that the player MUST step on the first tile before he can move on other ones!

Second step: (the spell disable)

1- Go to datapack/creaturescripts/, and open creaturescripts.xml, then add this line to it:
XML:
<event type="cast" name="disablespellsinareas" event="script" value="disablespellsinareas.lua"/>

2- Go to datapack/creaturescripts/scripts/, then create a new file here, name it "disablespellsinareas.lua". (without the quotation marks)
After you create it, add this script to it:
Lua:
    local condition = createConditionObject(CONDITION_PARALYZE)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 2000)
    setConditionFormula(condition, -0.9, 0, -0.9, 0)

    local function getCreaturesInArea(fromPos, toPos, player, monster, summon)
    	local t = {}
    	for z=fromPos.z, toPos.z do
    		for y=fromPos.y, toPos.y do
    			for x=fromPos.x, toPos.x do
    				local v = getTopCreature({x=x,y=y,z=z,stackpos=253})
    				if player == true then
    				    if isPlayer(v.uid) then
    					    table.insert(t, v.uid)
    				    end
    				end
    				if monster == true then
    				    if isMonster(v.uid) and not isSummon(v.uid) then
    				        table.insert(t, v.uid)
    					end
    				end
    				if summon == true then
    				    if isSummon(v.uid) then
    				        table.insert(t, v.uid)
    					end
    				end
    			end
    		end
    	end
    	return t
    end
    
    function onCast(cid, target)
        local count = 1 -- change this to the count of areas you currently have inside the script.
    	local table = { -- in order to add more areas, copy the first line, and add it. Then add +1 to count. Make sure the last line inside of the table DOESN'T end with a comma (,), and that the rest of them DO.
    	    {fromx=1005,fromy=1012,fromz=7,tox=1047,toy=1034,toz=7} -- change those positions to the area you would like spells to be disabled inside of.
    	}
    	local othertable = {}
    	repeat
    	    local postable = table[count]
    	    local fromPos, toPos = {x=postable.fromx,y=postable.fromy,z=postable.fromz}, {x=postable.tox,y=postable.toy,z=postable.toz}
    		for _, n in ipairs(getCreaturesInArea(fromPos, toPos, true, false, false)) do
    		    table.insert(othertable, n)
    		end
    		count = count-1
    	until count == 0
        if((getCreatureCondition(cid, CONDITION_HASTE))) then
    	    	doRemoveCondition(cid, CONDITION_HASTE)
    	end
        doAddCondition(cid, condition)
		return true
    end

3- Go to datapack/creaturescripts/scripts/, and open login.lua, then add this line to it:
Lua:
registerCreatureEvent(cid, "disablespellsinareas")


AND YOUR DONE! CONGRATULATIONS!
Now tell me if it worked or not D:.
 
Last edited:
error on paralayze

Lua:
[17/06/2013 17:56:39] [Error - MoveEvents Interface] 
[17/06/2013 17:56:39] data/movements/scripts/paralyzetile.lua:onStepIn
[17/06/2013 17:56:39] Description: 
[17/06/2013 17:56:39] (luaDoAddCondition) Condition not found

and casting spells still work
 
Lua:
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -0.9, 40, -0.9, 0)
 
    function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
        if(not (getCreatureCondition(cid, CONDITION_PARALYZE))) then
    	    doAddCondition(cid, condition)
    	end
        doItemSetAttribute(getTileThingByPos(toPosition).uid, "aid", 21212)
        return true
    end

this one for paralyze.the spell effects i can do it with a special way but lazy adding the fucking cast system :)
 

Similar threads

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