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

The problem with the declaration

vvafel

New Member
Joined
Mar 5, 2010
Messages
22
Reaction score
0
Location
Poland.
Hello, I have a small problem


In combat.ccp:
Code:
void Combat::getMinMaxValues(Creature* creature, Creature* target, int32_t& min, int32_t& max) const
{
	if(!creature){
		return;
	}

	if(Player* player = creature->getPlayer()){
		if(params.valueCallback){
			params.valueCallback->getMinMaxValues(player, min, max);
		}
		else{
			switch(formulaType){
				case FORMULA_LEVELMAGIC:
				{
					max = (int32_t)((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * mina + minb);
					min = (int32_t)((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * maxa + maxb);
					break;
				}

I change for:
Code:
void Combat::getMinMaxValues(Creature* creature, Creature* target, int32_t& min, int32_t& max) const
{
	if(!creature){
		return;
	}

	if(Player* player = creature->getPlayer()){
		if(params.valueCallback){
			params.valueCallback->getMinMaxValues(player, min, max);
		}
		else{
			switch(formulaType){
				case FORMULA_LEVELMAGIC:
				{
					max = (int32_t)(((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * mina + minb) * vocation->getMagicDamage());
					min = (int32_t)(((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * maxa + maxb) * vocation->getMagicDamage());
					break;
				}

Then an error appears:
Code:
../combat.cpp: In member function `void Combat::getMinMaxValues(Creature*, Creature*, int32_t&, int32_t&) const':
../combat.cpp:77: error: `vocation' was not declared in this scope

make.exe: *** [../combat.o] Error 1

Please help. Vvafel
 
Code:
../combat.cpp: In member function `void Combat::getMinMaxValues(Creature*, Creature*, int32_t&, int32_t&) const':
../combat.cpp:77: error: 'class Player' has no member named 'getVocation'
../combat.cpp:77: error: `MULTIPLIER_MAGIC' was not declared in this scope

../combat.cpp:78: error: 'class Player' has no member named 'getVocation'

make.exe: *** [../combat.o] Error 1
 
Last edited:
Hey i have Devland 8.0 sql 0.97b

I invented that I can do this:

In combat.ccp
Code:
void Combat::getMinMaxValues(Creature* creature, Creature* target, int32_t& min, int32_t& max) const
{
	if(!creature){
		return;
	}

	if(Player* player = creature->getPlayer()){
		if(params.valueCallback){
			params.valueCallback->getMinMaxValues(player, min, max);
		}
		else{
			switch(formulaType){
				case FORMULA_LEVELMAGIC:
				{
					max = (int32_t)(((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * mina + minb) * player->getMagicDamage());
					min = (int32_t)(((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * maxa + maxb) * player->getMagicDamage());
					break;
				}

In player.ccp I added to:
Code:
uint16_t Player::getMagicDamage()
{
	return vocation->getMagicDamage();
}

And, unfortunately, an error occurred:
Code:
../combat.cpp: In member function `void Combat::getMinMaxValues(Creature*, Creature*, int32_t&, int32_t&) const':
../combat.cpp:77: error: 'class Player' has no member named 'getMagicDamage'

../combat.cpp:78: error: 'class Player' has no member named 'getMagicDamage'

make.exe: *** [../combat.o] Error 1
 
Back
Top