• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Player maximun speed

guiismiti

Well-Known Member
Joined
May 19, 2014
Messages
313
Solutions
3
Reaction score
67
Hi again,

I'm trying to edit boots of waterwalking so the player wearing it walks faster underwater.
What I'm doing is:
- I created a movement for the boots. onEquip - setStorageValue, onDeEquip - set it back to zero;
- Then I set a movement for all underwater tiles. onStepIn - check if player has storage value. If the player has, it increases the speed; onSetOut - sets the speed back to normal.

Everything is working - except that, when the player reaches level 500, it has around the maximun speed allowed by the server, so I can't add more speed, and the speed underwater doesn't change.

So, clearly, what I need is to increase this speed limit. I can't recompile my sources.


Thanks in advance.

Editted: If I manage to make it work, I'll post it on resources. I noticed that there were some people asking for scripts for boots of waterwalking (to walk over water or to walk with the same speed as in the surface).
 
I think a work around would be to make it so when you are underwater, you get a massive decrease in speed unless you are wearing the boots of waterwalking (include the decrease in speed in the movement file).

You can't increase the movement speed the way you want without switching over to the OT client, and even so at that point, making players move faster than what is max on the normal client is absurd.
 
In this case, this is the best I could do:

NOTES:
- I had to delete the "drown" movement from the ocean tiles. Solution to this is to simply merge the drown script with waterwalkingfloor.lua
- Check if you're not using storage value 33638 already

movements.xml
Code:
    <!-- Waterwalking -->
    <movevent type="StepIn" fromid="5405" toid="5410" event="script" value="waterwalkingfloor.lua"/>
    <movevent type="StepIn" fromid="5427" toid="5438" event="script" value="waterwalkingfloor.lua"/>
    <movevent type="StepIn" fromid="9671" toid="9672" event="script" value="waterwalkingfloor.lua"/>
    <movevent type="StepIn" itemid="5743" event="script" value="waterwalkingfloor.lua" />
    <movevent type="StepIn" itemid="5744" event="script" value="waterwalkingfloor.lua" />
    <movevent type="StepIn" itemid="5764" event="script" value="waterwalkingfloor.lua" />
    <movevent type="StepOut" fromid="5405" toid="5410" event="script" value="waterwalkingfloor.lua"/>
    <movevent type="StepOut" fromid="5427" toid="5438" event="script" value="waterwalkingfloor.lua"/>
    <movevent type="StepOut" fromid="9671" toid="9672" event="script" value="waterwalkingfloor.lua"/>
    <movevent type="StepOut" itemid="5743" event="script" value="waterwalkingfloor.lua" />
    <movevent type="StepOut" itemid="5744" event="script" value="waterwalkingfloor.lua" />
    <movevent type="StepOut" itemid="5764" event="script" value="waterwalkingfloor.lua" />

    <!-- Boots -->
    <movevent type="Equip" itemid="2358" slot="feet" event="script" value="waterwalking.lua"/>
    <movevent type="DeEquip" itemid="2358" slot="feet" event="script" value="waterwalking.lua"/>

waterwalking.lua
Code:
function onEquip(cid, item, pos)

    doPlayerSetStorageValue (cid, 33638, 1)

    return 1
end  

function onDeEquip(cid, item, pos)

    doPlayerSetStorageValue (cid, 33638, 0)

    return 1
end

waterwalkingfloor.lua
Code:
local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition, CONDITION_PARAM_SPEED, 4000)

function onStepIn(cid, item, pos)

    if getPlayerStorageValue(cid, 33638) == 1 then
        if(not doAddCondition(cid, condition)) then
            return true
        end
    end

    return true
end  

function onStepOut(cid, item, pos)

    if getPlayerStorageValue(cid, 33638) == 1 then
        if(not doRemoveCondition(cid, CONDITION_HASTE)) then
            return true
        end
    end

    return true
end
 
Back
Top