• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Protocol colors & login

muphet

New Member
Joined
Apr 27, 2008
Messages
233
Reaction score
2
Hi there,

I'm currently working on few additions to my project and I can't find any clues how to solve my problems. Firstly, I want to know, where to find or how change colors of text string in game protocol, for example: "you see a thing." in white color instead green.
Secondly, how to prevent login scripts? i mean, i want to prevent loggin off from the server by pressing logout button or command. I want to disable this function by manual action and enable for logout ONLY by going to bed etc.
I know it's bad thing but I need them for this serious project. Should i edit code or do it just by lua?
 
Where? sources, How? compiling, there are so many tutorials to how do it here, use the search function next time :D
 
Where? sources, How? compiling, there are so many tutorials to how do it here, use the search function next time :D
Gtfo troll..


Change this function in tools.cpp for different colors.
[cpp]void getCombatDetails(CombatType_t combatType, MagicEffect_t& magicEffect, Color_t& textColor)
{
switch(combatType)
{
case COMBAT_PHYSICALDAMAGE:
{
textColor = COLOR_RED;
magicEffect = MAGIC_EFFECT_DRAW_BLOOD;
break;
}

case COMBAT_ENERGYDAMAGE:
{
textColor = COLOR_PURPLE;
magicEffect = MAGIC_EFFECT_ENERGY_DAMAGE;
break;
}

case COMBAT_EARTHDAMAGE:
{
textColor = COLOR_LIGHTGREEN;
magicEffect = MAGIC_EFFECT_POISON_RINGS;
break;
}

case COMBAT_DROWNDAMAGE:
{
textColor = COLOR_LIGHTBLUE;
magicEffect = MAGIC_EFFECT_LOSE_ENERGY;
break;
}

case COMBAT_FIREDAMAGE:
{
textColor = COLOR_ORANGE;
magicEffect = MAGIC_EFFECT_HITBY_FIRE;
break;
}

case COMBAT_ICEDAMAGE:
{
textColor = COLOR_TEAL;
magicEffect = MAGIC_EFFECT_ICEATTACK;
break;
}

case COMBAT_HOLYDAMAGE:
{
textColor = COLOR_YELLOW;
magicEffect = MAGIC_EFFECT_HOLYDAMAGE;
break;
}

case COMBAT_DEATHDAMAGE:
{
textColor = COLOR_DARKRED;
magicEffect = MAGIC_EFFECT_SMALLCLOUDS;
break;
}

case COMBAT_LIFEDRAIN:
{
textColor = COLOR_RED;
magicEffect = MAGIC_EFFECT_WRAPS_RED;
break;
}

case COMBAT_MANADRAIN:
{
textColor = COLOR_BLUE;
magicEffect = MAGIC_EFFECT_LOSE_ENERGY;
}

default:
break;
}
}
[/cpp]
 
Therefore you gotta change:

player->sendTextMessage(MSG_INFO_DESCR, ss.str()); (in bool Game::playerLookInTrade, bool Game::playerLookInShop and bool Game::playerLookAt)

To:
MSG_EVENT_ADVANCE
I guess
 
oh well, better then nothin. BTW, is there possibility to color one message with two diffrent colors? for example like NPC saying to you with private blue color and some words are bold with darker one.
 
Back
Top