enriel
Big L
Is there a way to reduce basespeed of players? Because now it's not as real tibia, abit too fast. How can I reduce the speed of players?
You can either change the speed of the Player in the vocations.xml file, or correct it through the function "doChangeSpeed(cid, delta)"
For the second you would have to write your own formula.
kind regards, Evil Hero.
function onLogin(cid)
local storage = 65000 -- storage which is used to store if the player got his speed decreased already or not.
local ammount = 50 -- ammount which the speed is getting decreased with.
if getPlayerStorageValue(cid, storage) ~= 1 then
doChangeSpeed(cid, (getCreatureSpeed(cid) - ammount))
setPlayerStorageValue(cid, storage, 1)
end
return TRUE
end
<vocation id="0" name="None" description="none" needpremium="0" gaincap="5" basespeed="10" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
void updateBaseSpeed()
{
if(!hasFlag(PlayerFlag_SetMaxSpeed))
baseSpeed = vocation->getBaseSpeed() + (2 * (level - 1));
else
baseSpeed = SPEED_MAX;
}