tylerdurden
New Member
- Joined
- Jan 10, 2022
- Messages
- 17
- Reaction score
- 1
Hello. So we all know the fields have been bugged in TFS since a very long time despite trying to fix them by Nekiro, Zbizu and others... Ive decided to fix them in lua but here comes the problem with field damage. Whenever a player or monster step on the field it always deal 20 damage and it is fine but there should be one exception: if a player step on a field created by other player, it should deal 10 damage and 8 times 5 damage (half). I dont know how to do it in lua, its probably not possible?
I think I would need to get the "attacker" somehow
I think I would need to get the "attacker" somehow
Lua:
function onStepIn(creature, item, position, fromPosition)
if creature:isPlayer() then
doTargetCombat(0, creature, COMBAT_FIREDAMAGE, -20, -20, CONST_ME_FIREAREA, true, false, false)
local condition1 = Condition(COMBAT_FIREDAMAGE )
condition1:setParameter(CONDITION_PARAM_DELAYED, 1)
condition1:addDamage(8, 8000, -10)
creature:addCondition(condition1)
end
if creature:isMonster() then
if creature:isImmune(CONDITION_FIRE) then
creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
else
doTargetCombat(0, creature, COMBAT_FIREDAMAGE, -20, -20, CONST_ME_FIREAREA, true, false, false)
local condition2 = Condition(COMBAT_FIREDAMAGE )
condition2:setParameter(CONDITION_PARAM_DELAYED, 1)
condition2:addDamage(8, 8000, -10)
creature:addCondition(condition2)
end
end
return true
end