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

[C++] Changing Skill advance message.

[cpp]sprintf(advMsg, "You advanced from %s %d to %s %d.", getSkillName(skill).c_str(), skills[skill][SKILL_LEVEL]-1, getSkillName(skill).c_str(), skills[skill][SKILL_LEVEL]);[/cpp]
nonlegit though:p
 
Yup, it crashes my server on skill advance. :(
Maybe bigger part?
Code:
	{
		count -= vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL] + 1) - skills[skill][SKILL_TRIES];
		skills[skill][SKILL_LEVEL]++;
		skills[skill][SKILL_TRIES] = 0;
		skills[skill][SKILL_PERCENT] = 0;
		char advMsg[50];
		sprintf(advMsg, "You advanced in %s.", getSkillName(skill).c_str());
		sendTextMessage(MSG_EVENT_ADVANCE, advMsg);

		g_creatureEvents->playerAdvance(this, skill, (skills[skill][SKILL_LEVEL] - 1), skills[skill][SKILL_LEVEL]);
		advance = true;

		if(vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL]) > vocation->getReqSkillTries(skill, skills[skill][SKILL_LEVEL] + 1))
		{
			count = 0;
			break;
		}
	}
 
Last edited:
I dont know what does it change, becouse I can only edit C++, i want to learn it but have to find a good tutorial. Anyway it works! THANKS!
 
I dont know what does it change, becouse I can only edit C++, i want to learn it but have to find a good tutorial. Anyway it works! THANKS!
It allows you to store longer message since it creates table with 25 more char variables. Solution provided by Cykotitan works. Just change
Code:
char advMsg[50];
to
Code:
char advMsg[75];
and you could use it in your OT.
 
Last edited:
Back
Top