How to fix that to compile and work propelly?
That part of the script in condition.cpp is to do effect when a immune monster/creature step in field, tried with switch(creature->isImmune...) but idk c++
Copyed that part from combat.cpp "Game::combatBlockHit"
thanks in advance.
That part of the script in condition.cpp is to do effect when a immune monster/creature step in field, tried with switch(creature->isImmune...) but idk c++
Copyed that part from combat.cpp "Game::combatBlockHit"
C:
bool ConditionDamage::doDamage(Creature* creature, int32_t healthChange)
{
if (creature->isImmune(getType()) && !creature->isInGhostMode() && !creature->getPlayer()) {
uint8_t hitEffect = 0;
switch(creature->isImmune(getType())) { // <<<<< HERE IS THE PROBLEM, IDK HOW TO MAKE SYSTEM RECOGNIZE WHATS THE FIELD TYPE ACCORDING WITH THE IMMUNITY
case COMBAT_UNDEFINEDDAMAGE: {
return;
}
case COMBAT_ENERGYDAMAGE:
case COMBAT_FIREDAMAGE:
case COMBAT_PHYSICALDAMAGE: {
hitEffect = CONST_ME_BLOCKHIT;
break;
}
case COMBAT_EARTHDAMAGE: {
hitEffect = CONST_ME_GREEN_RINGS;
break;
}
default: {
hitEffect = CONST_ME_BLOCKHIT;
break;
}
}
g_game.addMagicEffect(creature->getPosition(), hitEffect);
return false;
}
thanks in advance.