/flymode changes
Posted: Mon Nov 05, 2012 6:19 pm
I just changed the way flymode works, it now uses the server control flag for a flying mount. This will cause fly mode to work diffrently as if you don't have a mount you can no longer look up or down to fly up or down, you will have to use the keys (default space for up x for down). If you have a mount it will behave like a flying mount (almost the exact same way as fly mode originally did with small changes). If you have a mount, and it is not a flying mount, you will stand up on its back and do a walk animation, this is due to the mount not being designed for flight (client stuff we can't fix).
This change was made thanks to xinux who got me looking at the ghost control flag packets, and helping to identify that our current struct was wrong. Updating the struct, as well as the code /speed will now also control air speed, this is why the changes had to be made to /flymode as the air speed will only effect the mount fly mode and not the original.
We can also make script for flying mounts as all the lua functions are already in, just do a SetMount() followed by a SetServerControlFlag(), untested mod to the betamount.lua but should work.
FYI: SetSpeed() will not currently effect air speed.
This change was made thanks to xinux who got me looking at the ghost control flag packets, and helping to identify that our current struct was wrong. Updating the struct, as well as the code /speed will now also control air speed, this is why the changes had to be made to /flymode as the air speed will only effect the mount fly mode and not the original.
We can also make script for flying mounts as all the lua functions are already in, just do a SetMount() followed by a SetServerControlFlag(), untested mod to the betamount.lua but should work.
Code: Select all
function cast(Caster, Target, MountID, MountRed, MountGreen, MountBlue, SaddleRed, SaddleGreen, SaddleBlue, MountSpeed)
if MountID ~= nil then
SetMount(Caster, MountID)
SetServerControlFlag(Caster, 5, 32, 1);
if MountRed ~= nil then
SetMountColor(Caster, MountRed, MountGreen, MountBlue, SaddleRed, SaddleGreen, SaddleBlue)
end
if MountSpeed ~= nil then
SetSpeed(Caster, MountSpeed)
end
end -- missing me
end
function remove(Caster, Target)
SetMount(Caster, 0)
SetServerControlFlag(Caster, 5, 32, 0);
SetSpeed(Caster, 0)
end