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

Tibia Client crash after using mana potion or health or eating something, PLEASE HELP

kaspertje100

Member
Joined
May 8, 2008
Messages
236
Reaction score
7
Hi guys,

Like the title says my tibiaclient crashes after using a mana potion;s. There is no console error or something and when I login again my character used the mana potion. Im using Realserver 3.7 (client 8.60). (is the same like crying damson) but then upgraded to 8.60.

The tibia client gives this error:
(see image1)error.jpg

Please help me fix this:)
 
You need to give some more information. Is it (only) on your server or do you have this on every server? Are you using hotkeys? When its with normal use, do you have this with other actions (things you "use") too?
When its with using hotkeys, do you use costum client or did you use a costum client in the past?
If its only on your server, did you try to use other potion scripts? or other server. Some information is necesarry to know where the problem is.
 
Thanks for the answer Limos,

Well im not using hotkeys, i only have this problem on my server. My potion script should be perfect since it's exactly the same as crying damson 8.54 which works great for me on that server.Like I said no errors in my console, but the tibia client seems to crash after the player says 'Munch' or Aaaah.. so the talkaction. But I think i got an problem in the source of my server. But I don't know how to fix it. Since the server doesn't crash but only the tibia client;s
 
At first, its not possible to use a 8.54 potions script for a 8.6 server. The 8.6 client has stackable potions (this is made in the client), so the 8.54 potions script doesn't work because its made for non stackable potions. For the rest, it looks like you're using more files in your 8.6 server that are based on the 8.54 client. So its probable the differences in the clients that makes your client crash.
I would advice to download a 8.6 server, then only change the things that where unique on your server. There are some things you can always change without messing up the server. Like your map, some actions, npcs and spell lua scripts (better keep the 8.6 XML's and only edit them). Some other scripts should be possible to add too, as long as you keep the basics and structure of the 8.6 client in your server.
 
Last edited:
Hmm are you sure you didnt do something on the lua file which bugged the pots :S
Anyway here take a new one:
Code:
local config = {
	removeOnUse = "yes",
	usableOnTarget = "yes", -- can be used on target? (fe. healing friend)
	splashable = "no",
	realAnimation = "no", -- make text effect visible only for players in range 1x1
	healthMultiplier = 1.0,
	manaMultiplier = 1.0
}

config.removeOnUse = getBooleanFromString(config.removeOnUse)
config.usableOnTarget = getBooleanFromString(config.usableOnTarget)
config.splashable = getBooleanFromString(config.splashable)
config.realAnimation = getBooleanFromString(config.realAnimation)

local POTIONS = {
	[8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion
	[7618] = {empty = 7636, splash = 2, health = {100, 200}}, -- health potion
	[7588] = {empty = 7634, splash = 2, health = {200, 400}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion
	[7591] = {empty = 7635, splash = 2, health = {500, 700}, level = 50, vocations = {4, 8}, vocStr = "knights"}, -- great health potion
	[8473] = {empty = 7635, splash = 2, health = {800, 1000}, level = 50, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion

	[7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion
	[7589] = {empty = 7634, splash = 7, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion
	[7590] = {empty = 7635, splash = 7, mana = {200, 300}, level = 50, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion

	[8472] = {empty = 7635, splash = 3, health = {200, 400}, mana = {110, 190}, level = 50, vocations = {3, 7}, vocStr = "paladins"} -- great spirit potion
}

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local potion = POTIONS[item.itemid]
	if(not potion) then
		return false
	end

	if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then
		if(not config.splashable) then
			return false
		end

		if(toPosition.x == CONTAINER_POSITION) then
			toPosition = getThingPos(item.uid)
		end

		doDecayItem(doCreateItem(2016, potion.splash, toPosition))
		doTransformItem(item.uid, potion.empty)
		return true
	end

	if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return true
	end

	if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and
		not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES))
	then
		doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1)
		return true
	end

	local health = potion.health
	if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then
		return false
	end

	local mana = potion.mana
	if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then
		return false
	end

	if isInArray({8704, 7618, 7588, 7591, 8473}, item.itemid) then
		doSendAnimatedText(getPlayerPosition(cid), "Ahhhh...", 180)
	elseif isInArray({7620, 7589, 7590, 8472}, item.itemid) then
		doSendAnimatedText(getPlayerPosition(cid), "Ahhhh...", 17)
	end
	doSendMagicEffect(getThingPos(itemEx.uid), 30)
	if realAnimation then
		for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do
			if(isPlayer(tid)) then
			end
		end
	end

	doAddCondition(cid, exhaust)
	if(not potion.empty or config.removeOnUse) then
		doRemoveItem(item.uid, 1)
		return true
	end
	doRemoveItem(item.uid, 1)
     doPlayerAddItem(cid, potion.empty, 1)
	return true
end
 
Back
Top