johnsamir
Advanced OT User
Hi
I USE TFS 1.4 protocol 8.6
here the poison field is bugged it only takes the first step after that, when you walk on fields nothings happens
this is c++
any ideas how to fix this?
I USE TFS 1.4 protocol 8.6
here the poison field is bugged it only takes the first step after that, when you walk on fields nothings happens
LUA:
<item id="1490" article="a" name="poison field">
<attribute key="type" value="magicfield" />
<attribute key="decayTo" value="0" />
<attribute key="duration" value="120" />
<attribute key="field" value="poison">
<attribute key="ticks" value="5000" />
<attribute key="start" value="5" />
<attribute key="damage" value="100" />
</attribute>
</item>
this is c++
Code:
bool ConditionDamage::startCondition(Creature* creature)
{
if (!Condition::startCondition(creature)) {
return false;
}
if (!delayed) {
// delayed condition does no initial damage
if (!doDamage(creature, initDamage)) {
return false;
}
}
if (!init()) {
return false;
}
return true;
}
Code:
bool ConditionDamage::doDamage(Creature* creature, int32_t healthChange)
{
if (creature->isSuppress(getType()) || creature->isImmune(getType())) {
return false;
}
CombatDamage damage;
damage.origin = ORIGIN_CONDITION;
damage.primary.value = healthChange;
damage.primary.type = Combat::ConditionToDamageType(conditionType);
Creature* attacker = g_game.getCreatureByID(owner);
if (field && creature->getPlayer() && attacker && attacker->getPlayer()) {
damage.primary.value = static_cast<int32_t>(std::round(damage.primary.value / 2.));
}
if (!creature->isAttackable() || Combat::canDoCombat(attacker, creature) != RETURNVALUE_NOERROR) {
if (!creature->isInGhostMode()) {
g_game.addMagicEffect(creature->getPosition(), CONST_ME_POFF);
}
return false;
}
if (g_game.combatBlockHit(damage, attacker, creature, false, false, field)) {
return false;
}
return g_game.combatChangeHealth(attacker, creature, damage);
}