mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-11-28 07:36:50 +01: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:
@@ -2,12 +2,7 @@ local drunk = Condition(CONDITION_DRUNK)
|
||||
drunk:setParameter(CONDITION_PARAM_TICKS, 60000)
|
||||
|
||||
local poison = Condition(CONDITION_POISON)
|
||||
poison:setParameter(CONDITION_PARAM_DELAYED, true)
|
||||
poison:setParameter(CONDITION_PARAM_MINVALUE, -50)
|
||||
poison:setParameter(CONDITION_PARAM_MAXVALUE, -120)
|
||||
poison:setParameter(CONDITION_PARAM_STARTVALUE, -5)
|
||||
poison:setParameter(CONDITION_PARAM_TICKINTERVAL, 5000)
|
||||
poison:setParameter(CONDITION_PARAM_FORCEUPDATE, true)
|
||||
poison:setTiming(100)
|
||||
|
||||
local messages = {
|
||||
[FLUID_WATER] = "Gulp.",
|
||||
@@ -48,7 +43,7 @@ function onUse(player, item, fromPosition, target, toPosition)
|
||||
if self and item:getFluidType() == FLUID_BEER or item:getFluidType() == FLUID_WINE or item:getFluidType() == FLUID_RUM then
|
||||
player:addCondition(drunk)
|
||||
elseif self and item:getFluidType() == FLUID_SLIME then
|
||||
player:addCondition(slime)
|
||||
player:addCondition(poison)
|
||||
elseif item:getFluidType() == FLUID_MANAFLUID then
|
||||
target:addMana(math.random(50, 100))
|
||||
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
|
||||
|
||||
@@ -9303,7 +9303,7 @@ TypeID = 2121
|
||||
Name = "poison gas"
|
||||
Flags = {CollisionEvent,Unmove,Avoid,MagicField,Expire}
|
||||
Attributes = {AvoidDamageTypes=POISON,Brightness=2,LightColor=104,ExpireTarget=0,TotalExpireTime=250}
|
||||
MagicField = {Type=POISON,Count=100}
|
||||
MagicField = {Type=POISON,Count=100,Damage=5}
|
||||
|
||||
TypeID = 2122
|
||||
Name = "an energy field"
|
||||
@@ -9338,7 +9338,7 @@ TypeID = 2127
|
||||
Name = "poison gas"
|
||||
Flags = {CollisionEvent,Unmove,Avoid,MagicField}
|
||||
Attributes = {AvoidDamageTypes=POISON,Brightness=2,LightColor=104}
|
||||
MagicField = {Type=POISON,Count=100}
|
||||
MagicField = {Type=POISON,Count=100,Damage=5}
|
||||
|
||||
TypeID = 2128
|
||||
Name = "a magic wall"
|
||||
@@ -9376,7 +9376,7 @@ TypeID = 2134
|
||||
Name = "poison gas"
|
||||
Flags = {CollisionEvent,Unmove,Avoid,MagicField,Expire}
|
||||
Attributes = {AvoidDamageTypes=POISON,Brightness=2,LightColor=214,ExpireTarget=0,TotalExpireTime=8}
|
||||
MagicField = {Type=POISON,Count=100}
|
||||
MagicField = {Type=POISON,Count=100,Damage=5}
|
||||
|
||||
TypeID = 2135
|
||||
Name = "an energy field"
|
||||
@@ -24442,7 +24442,7 @@ Attributes = {Brightness=7,LightColor=207}
|
||||
|
||||
TypeID = 5404
|
||||
Name = "ocean floor"
|
||||
Flags = {Bank,Unmove}
|
||||
Flags = {Bank,Unmove,CollisionEvent}
|
||||
Attributes = {Waypoints=500}
|
||||
|
||||
TypeID = 5405
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<attribute key="shootEffect" value="ice"/>
|
||||
<attribute key="areaEffect" value="icearea"/>
|
||||
</attack>
|
||||
<attack name="drown" chance="100" target="1" range="7" radius="2" min="-330" max="-450">
|
||||
<attack name="drown" chance="10" target="1" range="7" radius="2" min="-330" max="-450">
|
||||
<attribute key="areaEffect" value="bluebubble"/>
|
||||
</attack>
|
||||
</attacks>
|
||||
|
||||
@@ -388,7 +388,9 @@
|
||||
<movevent event="StepIn" movementid="237" script="nostalrius/237.lua" />
|
||||
|
||||
<!-- Nostalrius Default Movements -->
|
||||
|
||||
<movevent event="StepIn" itemid="5404" script="misc/drowning.lua" />
|
||||
<movevent event="StepOut" itemid="5404" script="misc/drowning.lua"/>
|
||||
|
||||
<!-- Floorchange -->
|
||||
<movevent event="StepIn" itemid="293" script="misc/floorchange.lua" />
|
||||
<movevent event="AddItem" itemid="293" tileitem="1" script="misc/floorchange.lua" />
|
||||
|
||||
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