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

Compiling Exhaust on up/down stairs

chiitus

Member
Joined
Jun 1, 2009
Messages
206
Reaction score
12
Hey guys, i'm trying to add exhaust on up/down stairs on source because of stairs PVP, but i will not do this to all players (default), this script will only check exhaust for players that have STORAGE X, WITH VALUE Y.
But how i check player storage value in sources?
I'm changing this in sources:
Code:
//game.cpp

ReturnValue Game::internalMoveCreature(Creature* creature, Direction direction, uint32_t flags/* = 0*/)
So, how i check player storage in sources?
Thanks adv.

OBS.: I know it's possible to do this in .LUA, but i want to do in sources (if possible).
 
Code:
uint32_t key = X;
int32_t value;
if(player->getStorageValue(key, value) && value == Y) {
//do something, or not. Whatever floats your boat.
}

this should work in TFS 1.x. If it doesn't work on whatever else you might be using it should be pretty much the same thing, just do a search.
 
Really thanks!
I will test today.
Again, thanks!

EDIT: tested.
In my TFS version, its "GetStorage" and "value" is string
I can block movements in the same floor but when player try up/down it's impossible (its like a forced move).
I will block this in .LUA (i think in sources is better but...)
Thanks @Milice
 
Last edited:
i didn't edit because this will be a @BUMP too :p

So @Milice finally after hours and hours i did the script to work (in sources). But i yet have a question, i'm checking a lots of ID's (stairs ids) and i want to know, is there a way to check if the item is a stairs/ladder? I think GetItemTopOrder (but will not work on when you go a lower floor - because it's a ground item (toporder ZERO)).
Help!
 
I guess it would be helpful if we knew which distro this was for it would be easier to assist you, i did a search in google and the server that comes up is a 7.6 ot but even with that information we still don't know the distro.

http://wedoserver.googlecode.com/svn/trunk/game.cpp
has this in its code
Code:
Game::internalMoveCreature(Creature* creature, Direction direction, uint32_t flags/* = 0*/)
https://otland.net/threads/request-add-stair-hop-exhausted.148252/

Always include the distro version since not everyone is using the same distro version.
 
i didn't edit because this will be a @BUMP too :p

So @Milice finally after hours and hours i did the script to work (in sources). But i yet have a question, i'm checking a lots of ID's (stairs ids) and i want to know, is there a way to check if the item is a stairs/ladder? I think GetItemTopOrder (but will not work on when you go a lower floor - because it's a ground item (toporder ZERO)).
Help!
Look up item.hasFloorChange or something like that
 
I guess it would be helpful if we knew which distro this was for it would be easier to assist you, i did a search in google and the server that comes up is a 7.6 ot but even with that information we still don't know the distro.

http://wedoserver.googlecode.com/svn/trunk/game.cpp
has this in its code
Code:
Game::internalMoveCreature(Creature* creature, Direction direction, uint32_t flags/* = 0*/)
https://otland.net/threads/request-add-stair-hop-exhausted.148252/

Always include the distro version since not everyone is using the same distro version.

Already tried a verification in this function, but not work :/

~~
@Milice, i will try this, thanks!!
 
Last edited:
Your missing the point of my post, you never told us what distro your using as not all code for all distro's is the same.

I got it, but the functions don't change at all. just interface.

~~
@Milice
STAIR DELAY: DONE!
Thanks Milice for helping me!!!
Now i will do a exhaust for actions ladders. (izi script .lua)
 
@BUMP

@Milice i discover that if you click in stair to move by clicking the system will not check.
I discover a way to block this but i have to do this check in script: "getEstimatedDistance" (otherwise player will never goup stair if he have storage - because it's like 2 scripts adding exhaust and 2 checks, got it?)

This is from map.h; "int32_t getEstimatedDistance(uint16_t x, uint16_t y, uint16_t xGoal, uint16_t yGoal);"
This is from map.cpp; "int32_t AStarNodes::getEstimatedDistance(uint16_t x, uint16_t y, uint16_t xGoal, uint16_t yGoal)"

But i can't use with "map->getesti..." because say "is not a member from map"
And when is used direct, eg: "getEstimatedDistance(playerPos.x, playerPos.y, mapToPos.x, mapToPos.y)"
This error appear: "error: ‘getEstimatedDistance’ was not declared in this scope"

Help to use this function in game.cpp please.
Thanks adv!
 
@BUMP

@Milice i discover that if you click in stair to move by clicking the system will not check.
I discover a way to block this but i have to do this check in script: "getEstimatedDistance" (otherwise player will never goup stair if he have storage - because it's like 2 scripts adding exhaust and 2 checks, got it?)

This is from map.h; "int32_t getEstimatedDistance(uint16_t x, uint16_t y, uint16_t xGoal, uint16_t yGoal);"
This is from map.cpp; "int32_t AStarNodes::getEstimatedDistance(uint16_t x, uint16_t y, uint16_t xGoal, uint16_t yGoal)"

But i can't use with "map->getesti..." because say "is not a member from map"
And when is used direct, eg: "getEstimatedDistance(playerPos.x, playerPos.y, mapToPos.x, mapToPos.y)"
This error appear: "error: ‘getEstimatedDistance’ was not declared in this scope"

Help to use this function in game.cpp please.
Thanks adv!
Try map. Instead of map->
 
Have to declare "AStarNodes node;" and use "node."
I did it and works, but i need to know now how this calcule distance.
When i get home i will post the return value, it's a math using diagonal and normal cost movements.
Ok?
Thanks so much @Milice!

EDIT: How i get "topos"? With "toCylinder" or "fromCylinder"? Because i think toCylinder is when you are moving a item and get that different icon from mouse, isn't? Or this doesn't have nothing with mouse pos and i'm getting stupid here?! Thanks!
 
Have to declare "AStarNodes node;" and use "node."
I did it and works, but i need to know now how this calcule distance.
When i get home i will post the return value, it's a math using diagonal and normal cost movements.
Ok?
Thanks so much @Milice!

EDIT: How i get "topos"? With "toCylinder" or "fromCylinder"? Because i think toCylinder is when you are moving a item and get that different icon from mouse, isn't? Or this doesn't have nothing with mouse pos and i'm getting stupid here?! Thanks!
toCylinder is the cylinder on which you are moving something to, example if you put a gold coin in your backpack the backpack will be the toCylinder. To get the position of which it would be toCylinder->getPosition() or fromCylinder->getPosition()
 
Back
Top