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

Solved [C++ - TFS 1.0] Health/Mana Change

Aleada

Unknown Member
Joined
Mar 14, 2013
Messages
231
Reaction score
7
I'm sorry if this sounds very noobish to some but I honestly can not figure out how to add "+" and "-" to damage/healing effects. For example, if you get hit for 24 hitpoints it will say "-24"... Here's what I've written so far but it doesn't work :/

game.cpp
Code:
...
TextMessagemessage;
message.position=targetPos;
message.primary.value=realHealthChange;
message.primary.color=TEXTCOLOR_MAYABLUE;
message.sign="+";
...
message.primary.value=manaDamage;
message.primary.color=TEXTCOLOR_BLUE;
message.sign="-";
...
message.primary.value=damage;
message.sign="-";
addMagicEffect(list,targetPos,hitEffect);
...

protocolgame.cpp
Code:
voidProtocolGame::sendTextMessage(constTextMessage&message)
{
NetworkMessagemsg;
msg.AddByte(0xB4);
msg.AddByte(message.type);
switch(message.type){
caseMESSAGE_DAMAGE_DEALT:
caseMESSAGE_DAMAGE_RECEIVED:
caseMESSAGE_DAMAGE_OTHERS:{
msg.AddPosition(message.position);
msg.add<uint32_t>(message.primary.value);
msg.AddByte(message.primary.color);
msg.add<uint32_t>(message.secondary.value);
msg.AddByte(message.secondary.color);
break;
}
caseMESSAGE_HEALED:
caseMESSAGE_HEALED_OTHERS:
caseMESSAGE_EXPERIENCE:
caseMESSAGE_EXPERIENCE_OTHERS:{
msg.AddPosition(message.position);
msg.add<uint32_t>(message.primary.value);
msg.AddByte(message.primary.color);
break;
}
default:{
break;
}
}
msg.AddString(message.text);
msg.AddString(message.sign);
writeToOutputBuffer(msg);
}

protocolgame.h
Code:
structTextMessage
{
MessageClassestype;
std::stringtext;
std::stringsign;
Positionposition;
struct{
int32_tvalue;
TextColor_tcolor;
}primary,secondary;
TextMessage()
{
primary.value=0;
secondary.value=0;
}
};
 
Just started learning C++ this week so I definitely don't have the right knowledge :'/ haha

Could you give me some hints though? :]
 
well it pretty much depends if the client just picks it up if it's an int or if he picks it up if it's a string aswell.
 
It is always possible. Just with right knowledge :)
so you are telling that the dosendanimatedtext was removed because tfs developers didn't wanted to remade the code with the "right knowledge" so they just removed it? o_O

@Aleada
which client are you using? and what you are trying to do is similar to what the old sendanimatedtext used to do?
 
The text has to be a negative value(-400) or a balanced value (400), you can not add a positive value(+400) without either using otclient(forcing all the players) or downgrading your client to something lower.
The thing is that since doSendAnimatedText was removed it was also removed from the cipsoft client, so no its not posible without using a lower version of client or otclient.
 
You do not need all players to use OTClient, but only the players with OTClient could see the '+' then.
Older clients before 9.1 I think support strings as doSendAnimatedText.

@Evil Puncker
I assume he means that if you have the knowledge you can just modify the client to support it.
 
so you are telling that the dosendanimatedtext was removed because tfs developers didn't wanted to remade the code with the "right knowledge" so they just removed it? o_O

No, you say it is not possible to send animated text above client 9.1. That is not correct, of course it is possible. If you think something else you really need to learn a bit :p

EDIT: As @Summ said.
 
Last edited:
You do not need all players to use OTClient, but only the players with OTClient could see the '+' then.
Older clients before 9.1 I think support strings as doSendAnimatedText.

@Evil Puncker
I assume he means that if you have the knowledge you can just modify the client to support it.

You are right but I understood it as he wanted all players to get that message and in that case he will have to force all the players to use otclient.

No, you say it is not possible to send animated text below client 9.1. That is not correct, of course it is possible. If you think something else you really need to learn a bit :p

EDIT: As @Summ said.

I hope you ment above and not below :p
 
You are right but I understood it as he wanted all players to get that message and in that case he will have to force all the players to use otclient.



I hope you ment above and not below :p

Oh, of course I ment above! ;)
 
what is the soluction to the problem? I want put "-" in damages too
HEHEHEHE
tell me in what code.cpp and the lies to be added
 
what is the soluction to the problem? I want put "-" in damages too
HEHEHEHE
tell me in what code.cpp and the lies to be added

You add the code in notposible.cpp and inthisversion.h.
Read the thread again and in the future try to avoid bumping threads.
 
what is the soluction to the problem? I want put "-" in damages too
HEHEHEHE
tell me in what code.cpp and the lies to be added

read thread

tl;dr only possible with custom clients unless ur using lower version than 9.1 because thats when cipsoft changed some stuff in their client
 
hum, you say to read the thread again I do, but in title are "solved" ...
not means that they find the soluction?
 
Back
Top