bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 939
- Solutions
- 7
- Reaction score
- 129
- Location
- Brazil
- YouTube
- caruniawikibr
Hey guys, I need to solve this problem here.
what happens is the following,
this purple fire from poi, it has 3 stages. however I would like to adapt the script so that it does exactly the same damage as global tibia.
that is, when he is not in fire format, do not take damage.
however I noticed that when being in the first stage and last stage and it turns into the middle stage, the player takes 2 damage at the same time example.
i'm stepping on the last level 3 fire stage, and then it goes back to 2, i take 300 damage from the big fire + 300 damage from the second fire totaling 600.
I would like the damage to only deal on fires but not when it changes stages.
what happens is the following,
this purple fire from poi, it has 3 stages. however I would like to adapt the script so that it does exactly the same damage as global tibia.
that is, when he is not in fire format, do not take damage.
however I noticed that when being in the first stage and last stage and it turns into the middle stage, the player takes 2 damage at the same time example.
i'm stepping on the last level 3 fire stage, and then it goes back to 2, i take 300 damage from the big fire + 300 damage from the second fire totaling 600.
I would like the damage to only deal on fires but not when it changes stages.
Lua:
local fires = {
[2040] = {vocationId = 1, damage = 300},
[2041] = {vocationId = 1, damage = 600},
[2042] = {vocationId = 1, damage = 1200},
[2043] = {vocationId = 1, damage = 2400},
[2044] = {vocationId = 1, damage = 3600},
[2045] = {vocationId = 1, damage = 7200},
[2046] = {vocationId = 2, damage = 300},
[2047] = {vocationId = 2, damage = 600},
[2048] = {vocationId = 2, damage = 1200},
[2049] = {vocationId = 2, damage = 2400},
[2050] = {vocationId = 2, damage = 3600},
[2051] = {vocationId = 2, damage = 7200},
[2052] = {vocationId = 3, damage = 300},
[2053] = {vocationId = 3, damage = 600},
[2054] = {vocationId = 3, damage = 1200},
[2055] = {vocationId = 3, damage = 2400},
[2056] = {vocationId = 3, damage = 3600},
[2057] = {vocationId = 3, damage = 7200},
[2058] = {vocationId = 4, damage = 300},
[2059] = {vocationId = 4, damage = 600},
[2060] = {vocationId = 4, damage = 1200},
[2061] = {vocationId = 4, damage = 2400},
[2062] = {vocationId = 4, damage = 3600},
[2063] = {vocationId = 4, damage = 7200}
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local fire = fires[item.actionid]
if not fire then
return true
end
if player:getVocation():getBase():getId() == fire.vocationId then
doTargetCombat(0, player, COMBAT_FIREDAMAGE, -300, -300, CONST_ME_HITBYFIRE)
else
local combatType = COMBAT_FIREDAMAGE
if fire.damage > 300 then
combatType = COMBAT_PHYSICALDAMAGE
end
doTargetCombat(0, player, combatType, -fire.damage, -fire.damage, CONST_ME_FIREATTACK)
end
return true
end