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

Custom potion doesn't work with hotkeys

Dasyel

New Member
Joined
Jul 23, 2011
Messages
3
Reaction score
0
I added ultimate mana potion to my server, it works great, except for the use with hotkeys. When I hotkey the UMP I does nothing and I get the small white msg: 'Sorry, not possible'. It can't be the script because it follows the same script as all other potions, and I don't think it's because I made them stackable because, again, that's the same as all other potions.

Also when I use '/i ultimate mana potion' it doesn't work, it only works with the item id, but when you look at the UMP it says:
'You see 100 ultimate mana potions.
They weigh 220.00 oz.
This potion can only be consumed by mages of level 130 or higher.'

I hope anyone of you can help me out with this.

btw, I use The Forgotten Server Version 0.3.6 Crying Damson, so it's 8.54
 
use a mana rune instead
or a mana rune based on lvl or ml
or check the items.xml
and search for the ump item id and remove its charges if there
i hope that can help u
 
I added the UMP as a new item, with a new sprite, through the dat editor and itemeditor. There is nothing about charges in the items.xml. I just copied the entry of ultimate health potion and changed the id, name and description, so the ultimate mana potion is defined exactly the same as the ultimate life potion in the items.xml. UMP and UHP are also defined the same in items.otb and the dat file.
 
The Ultimate Mana Potion is the same way defined in items.xml as the Ultimate Health Potion.
Item is added with a new sprite, used a dat editor and item editor.
Also nothing wrong in potions.lua script, because it works perfectly "using" the item. It only doesn't work with hotkey(use on yourself/crosshairs.. both won't work).
 
just checked the settings in the dat editor, everything is exactly the same with UMP and UHP. only the itemtype number is different.
 
try to debug it, in order to see which part is failing?

get the source code, add the line below to game.cpp and compile
Code:
bool Game::playerUseItemEx(uint32_t playerId, const Position& fromPos, int16_t fromStackpos, uint16_t fromSpriteId,
	const Position& toPos, int16_t toStackpos, uint16_t toSpriteId, bool isHotkey)
{
	Player* player = getPlayerByID(playerId);
	if(!player || player->isRemoved())
		return false;

	if(isHotkey && !g_config.getBool(ConfigManager::AIMBOT_HOTKEY_ENABLED))
		return false;

	Thing* thing = internalGetThing(player, fromPos, fromStackpos, fromSpriteId, STACKPOS_USEITEM);
	if(!thing)
	{
		[COLOR="#FF0000"]std::cout << "h" << std::endl;[/COLOR]
		player->sendCancelMessage(RET_NOTPOSSIBLE);
		return false;
	}
you'll know this serversided part is to blame if h is printed in server console
 
So you are suggesting to download the source code, compile it with that changed line.
Then run the server (can test it local ofcourse), and use the item with hotkey?
When there is a problem on server it should print that line?
 
Oke, I compiled it. Ran the server local, tested the potion.
It worked immediatly! Nice :)

So, can I now just use the newly created .exe for the "real" server(not local) or do I have to copy more things??
 
it's weird how that fixed your problem, you can remove the std::cout line

and ye :p you can use it instead of the old app
 
Back
Top