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

see the mana from mana potions in purple text

Ahilphino

Excellent OT User
Joined
Jun 5, 2013
Messages
1,667
Solutions
1
Reaction score
727
is this possible with TFS 1.0?

I know I can make it in orange text but how would i make it in purple text or some other color?

Code:
amount = {
-- [vocation] = {minmp, maxmp, minhp, maxhp}, (it will be multiplied by player level)
    [1] = {3, 3.5, 4, 4}, 
    [2] = {3, 3.5, 0, 0},
    [3] = {1,1.2, 2, 2.2},
    [4] = {0, 0, 5, 7},
    [5] = {3, 3.5, 0, 0},
    [6] = {3, 3.5, 0, 0},
    [7] = {1,1.2, 2, 2.2},
    [8] = {0, 0, 5, 7}
}

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
local lv = getPlayerLevel(player)
local conf = {
    v = amount[getPlayerVocation(player)],
    voc = getPlayerVocation(player),
    level = 180 -- min level
}

    if getPlayerLevel(player) >= conf.level then
            local hps = math.random((lv*conf.v[3]),(lv*conf.v[4]))
            local manas = math.random((lv*conf.v[1]),(lv*conf.v[2]))
            doCreatureAddHealth(player, hps)
            doPlayerAddMana(player, manas)
            player:say("+" ..manas.."", TALKTYPE_MONSTER_SAY)
            doSendMagicEffect(getPlayerPosition(player), CONST_ME_MAGIC_BLUE)
    else
        doPlayerSendTextMessage(player, 22, "Only players above " .. conf.level .. " level can drink this potion.")
    end
end
this is my current script potion script, i can source edit if necessary!
 
Yes! Mate this is defnitely better but still it would be best without any message at all in server log but I suppose that isn't possible?

I removed "show status messages in console" in the tibia client's options and now it looks like it should but still really would like it to not send any msg at all in console if possible! :E
I just shutdown my test server... your timing is impeccable..

I'm busy with something at the moment so you'll have to wait til later or for someone else to resolve this issue
 
Yes! Mate this is defnitely better but still it would be best without any message at all in server log but I suppose that isn't possible?

I removed "show status messages in console" in the tibia client's options and now it looks like it should but still really would like it to not send any msg at all in console if possible! :E


Try using the same script, but trading
MESSAGE_EXPERIENCE
for
MESSAGE_INFO_DESCR

I think this should work, not quite sure though...
 
Did you read the first page? The OP already said he did what you just suggested him to do. I would like to get rid of the server log message too like he explained in his last post.
 
Did you read the first page? The OP already said he did what you just suggested him to do. I would like to get rid of the server log message too like he explained in his last post.

You are an idiot. Yes he said

fter MESSAGE_EXPERIENCE. I tried changing MESSAGE_EXPERIENCE to all other types of messages there is but all types had this same issue!

well before he said

Yes! Mate this is defnitely better but still it would be best without any message at all in server log but I suppose that isn't possible?

So if you pay close attention, the scripts he used are completely different, and the problem was narrowed down to the only problem left being that it shows up in the console, if you have ever used that value before you would know that it doesn't show a DAMN thing in the console... So now that being said, you are still an idiot, because it could be that the problem remains with the change I suggested, or it could be that it fixes the problem.

Did you try to fix the problem? Nope, all you did was come onto someone else's thread saying


I would be interested in this too!
 
I'm deeply sorry for offending you.

Now let's get back to the actual thread, MESSAGE_INFO_DESCR will still give a message to the server log.
 
Last edited:
why do you do this? Why not just leave it like this

player:addHealth(health)
player:addMana(mana)

?
Did you read the first page? The OP already said he did what you just suggested him to do. I would like to get rid of the server log message too like he explained in his last post.
I didn't write the initial script all I did was rename the variables so they made sense.. do I need to re-write everyone's code?
If you 2 guys are that anal about it how come you didn't re-write it yourselves?
 
Last edited:
why do you do this? Why not just leave it like this

player:addHealth(health)
player:addMana(mana)

?
Because if you notice player is a table, and you can't add userdata to a table and then add more elements and expect to reference that value later on in the script.

You wanna re-write it be my guest
 
Last edited:
Because if you notice player is a table, and you can't add userdata to a table and then add more elements and expect to reference that value later on in the script.

You wanna re-write it be my guest

Now I'm feeling like @Grisig :D

Seriously wasn't trying to offend. I didn't even know it could work like that, and was curious as to why you did it that way... I know that player is a table because it's a metatable, and now thinking about it, whenever you declare a function as a variable it executes the function, so I can see why and how it works now, I just didn't realize at the time. I was merely trying to learn from your example, not critique it!
 
idk why noone understands, i don't want ANY text at all in the server log. for example a normal mana potion only makes you ´say "Aaaah" and it doesn't tell you that you gain mana in the server log.

I just want to replace Aaaah with how much mana the mana pot heals in a purple text, I don' t want any server log message. I tried what u said codinablock but it's still msg in server log.
 
idk why noone understands, i don't want ANY text at all in the server log. for example a normal mana potion only makes you ´say "Aaaah" and it doesn't tell you that you gain mana in the server log.

I just want to replace Aaaah with how much mana the mana pot heals in a purple text, I don' t want any server log message. I tried what u said codinablock but it's still msg in server log.

Yeah, I spent about an hour last night trying to figure it out, can't come up with a way around it, it's hardcoded in the source for that method, and there isn't another method we can use...
 
yes that's what I thought, guess I'll have to stick with mana in server log if, I got absolutely no clue what to edit in the source but if someone finds out i'll be glad!
 
rip breed u will always be remembered for the retard that couldn't read my threads and instead fixed other stuff i didnt ask for
 
Back
Top