mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-13 22:34:53 +02:00
introduce drowning condition, fix monsters to use uniform random, fix poison field on walk instant damage hit, need to check how drowning works and remove damage only when player is idle for 4s
This commit is contained in:
27
data/movements/scripts/misc/drowning.lua
Normal file
27
data/movements/scripts/misc/drowning.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
local condition = Condition(CONDITION_DROWN)
|
||||
condition:setParameter(CONDITION_PARAM_HIT_DAMAGE, 20)
|
||||
condition:setTiming(9999)
|
||||
|
||||
|
||||
function onStepIn(creature, item, position, fromPosition)
|
||||
local player = creature:getPlayer()
|
||||
if player == nil then
|
||||
return true
|
||||
end
|
||||
|
||||
if math.random(1, 10) == 1 then
|
||||
position:sendMagicEffect(CONST_ME_BUBBLES)
|
||||
end
|
||||
player:addCondition(condition)
|
||||
return true
|
||||
end
|
||||
|
||||
function onStepOut(creature, item, position, fromPosition)
|
||||
local player = creature:getPlayer()
|
||||
if player == nil then
|
||||
return true
|
||||
end
|
||||
|
||||
player:removeCondition(CONDITION_DROWN)
|
||||
return true
|
||||
end
|
Reference in New Issue
Block a user