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

Monster attacking other

fegarox

New Member
Joined
Oct 6, 2010
Messages
19
Reaction score
0
The monsters of my server are attacking each other when they use area spells. How can i solve this? Thanks.
 
When i try to compile this code i receive this error:

Code:
  In member function 'virtual void Monster::drainHealth(Creature*, CombatType_t, int32_t)': 
136 monster.cpp expected ',' or ';' before 'if' 
1489 monster.cpp expected '}' at end of input
1489 monster.cpp *** [obj//monster.o] Error 1
 
Lol, rookie mistake by BeniS.

replace

Code:
void Monster::drainHealth(Creature* attacker, CombatType_t combatType, int32_t damage)
{
	bool effect = true
	if(g_config.getBool(ConfigManager::MONSTER_DAMAGED_BY_PLAYER_ONLY))
	{
		if(!isPlayerSummon()) //Player summons can be damaged by players and monsters
		{
			if(attacker->getPlayer() || attacker->isPlayerSummon()) //Make sure it is a player making damage
				effect = true
			else
				effect = false
		}
		else
			effect = true
	}
	else
		effect = true
	
	if(effect)
	{
		Creature::drainHealth(attacker, combatType, damage);
		if(isInvisible())
			removeCondition(CONDITION_INVISIBLE);
	}
	else
		Creature::drainHealth(attacker, combatType, 0);
}

with

Code:
void Monster::drainHealth(Creature* attacker, CombatType_t combatType, int32_t damage)
{
	bool effect = true;
	if(g_config.getBool(ConfigManager::MONSTER_DAMAGED_BY_PLAYER_ONLY))
	{
		if(!isPlayerSummon()) //Player summons can be damaged by players and monsters
		{
			if(attacker->getPlayer() || attacker->isPlayerSummon()) //Make sure it is a player making damage
				effect = true;
			else
				effect = false;
		}
		else
			effect = true;
	}
	else
		effect = true;
	
	if(effect)
	{
		Creature::drainHealth(attacker, combatType, damage);
		if(isInvisible())
			removeCondition(CONDITION_INVISIBLE);
	}
	else
		Creature::drainHealth(attacker, combatType, 0);
}
 
Back
Top