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

TFS 0.3 (8.20) "magicDamage"

Drooms

New Member
Joined
Feb 24, 2009
Messages
4
Reaction score
0
Hello, please if someone can improve on the script (It would be asked to increase the damage of the magic, set separately for each profession in vocations.xml) took the script from another source but does not work on TFS 0.3 and 0.2 (

I do this:
in vocation.cpp
under:
Code:
if(readXMLInteger(p,"fromvoc", intVal))
voc->fromVocation = intVal;

add:
Code:
if(readXMLInteger(p, "magicDamage", intVal))
voc->magicDamage = intVal;

under:
Code:
fromVocation = 0;

add:
Code:
magicDamage = 100;



in vocation.h
under:
Code:
uint32_t getFromVocation() const {return fromVocation;}

add:
Code:
uint32_t getMagicDamage() const {return magicDamage;}


in combat.cpp
Code:
case FORMULA_LEVELMAGIC:
{
max = (int32_t)((player->getLevel() * 1.5 + player->getMagicLevel() * 4) * 1. * mina + minb);
min = (int32_t)((player->getLevel() * 1.5 + player->getMagicLevel() * 4) * 1. * maxa + maxb);
	return true;
break;
}


change to:

Code:
case FORMULA_LEVELMAGIC:
	{
max = (int32_t)((player->getLevel() * 1.5 + player->getMagicLevel() * 4) * player->vocation->getMagicDamage() * 0.01 * 1. * mina + minb);
min = (int32_t)((player->getLevel() * 1.5 + player->getMagicLevel() * 4) * player->vocation->getMagicDamage() * 0.01 * 1. * maxa + maxb);
break;
}


compiles and when the error in the console:
Code:
 C:\Dev-Cpp\0.3\source\combat.cpp In member function `bool Combat::getMinMaxValues(Creature*, Creature*, int32_t&, int32_t&) const': 
698 C:\Dev-Cpp\0.3\source\player.h `Vocation*Player::vocation' is protected 
80 C:\Dev-Cpp\0.3\source\combat.cpp within this context 
698 C:\Dev-Cpp\0.3\source\player.h `Vocation*Player::vocation' is protected 
81 C:\Dev-Cpp\0.3\source\combat.cpp within this context 
C:\Dev-Cpp\0.3\source\dev-cpp\Makefile.win [Build Error]  [obj//combat.o] Error 1

please help me ...
 
Back
Top