Tfs 1.2
I found this on combat.cpp
Inside function
Someone can tell me how harmfulField work?
I found this on combat.cpp
Inside function
C++:
void MagicField::onStepInField(Creature* creature)
C++:
const ItemType& it = items[getID()];
if (it.conditionDamage) {
Condition* conditionCopy = it.conditionDamage->clone();
uint32_t ownerId = getOwner();
if (ownerId) {
bool harmfulField = true;
if (g_game.getWorldType() == WORLD_TYPE_NO_PVP || getTile()->hasFlag(TILESTATE_NOPVPZONE)) {
Creature* owner = g_game.getCreatureByID(ownerId);
if (owner) {
if (owner->getPlayer() || (owner->isSummon() && owner->getMaster()->getPlayer())) {
harmfulField = false;
}
}
}
Player* targetPlayer = creature->getPlayer();
if (targetPlayer) {
Player* attackerPlayer = g_game.getPlayerByID(ownerId);
if (attackerPlayer) {
if (Combat::isProtected(attackerPlayer, targetPlayer)) {
harmfulField = false;
}
}
}
if (!harmfulField || (OTSYS_TIME() - createTime <= 5000) || creature->hasBeenAttacked(ownerId)) {
conditionCopy->setParam(CONDITION_PARAM_OWNER, ownerId);
}
}
creature->addCondition(conditionCopy);
}
}
Someone can tell me how harmfulField work?