diff --git a/data/items/items.srv b/data/items/items.srv
index 37bd791..52301d3 100644
--- a/data/items/items.srv
+++ b/data/items/items.srv
@@ -24447,27 +24447,27 @@ Attributes = {Waypoints=500}
TypeID = 5405
Name = "ocean floor"
-Flags = {Bank,Unmove}
+Flags = {Bank,Unmove,CollisionEvent}
Attributes = {Waypoints=500}
TypeID = 5406
Name = "ocean floor"
-Flags = {Bank,Unmove}
+Flags = {Bank,Unmove,CollisionEvent}
Attributes = {Waypoints=500}
TypeID = 5407
Name = "ocean floor"
-Flags = {Bank,Unmove}
+Flags = {Bank,Unmove,CollisionEvent}
Attributes = {Waypoints=500}
TypeID = 5408
Name = "ocean floor"
-Flags = {Bank,Unmove}
+Flags = {Bank,Unmove,CollisionEvent}
Attributes = {Waypoints=500}
TypeID = 5409
Name = "ocean floor"
-Flags = {Bank,Unmove}
+Flags = {Bank,Unmove,CollisionEvent}
Attributes = {Waypoints=500}
TypeID = 5410
@@ -25925,12 +25925,12 @@ Name = "" # this is nothing in client
TypeID = 5743
Name = "wooden floor"
-Flags = {Bank,Unmove}
+Flags = {Bank,Unmove,CollisionEvent}
Attributes = {Waypoints=500}
TypeID = 5744
Name = "wooden floor"
-Flags = {Bank,Unmove}
+Flags = {Bank,Unmove,CollisionEvent}
Attributes = {Waypoints=500}
TypeID = 5745
@@ -26017,7 +26017,7 @@ Attributes = {Waypoints=110}
TypeID = 5764
Name = "a ventilation grille"
-Flags = {Bank,Unmove}
+Flags = {Bank,Unmove,CollisionEvent}
Attributes = {Waypoints=500}
TypeID = 5765
diff --git a/data/movements/movements.xml b/data/movements/movements.xml
index 5b07647..3844810 100644
--- a/data/movements/movements.xml
+++ b/data/movements/movements.xml
@@ -388,8 +388,12 @@
-
-
+
+
+
+
+
+
@@ -666,6 +670,10 @@
+
+
+
+
diff --git a/data/movements/scripts/misc/drowning.lua b/data/movements/scripts/misc/drowning.lua
index aeabc52..e346815 100644
--- a/data/movements/scripts/misc/drowning.lua
+++ b/data/movements/scripts/misc/drowning.lua
@@ -1,6 +1,5 @@
local condition = Condition(CONDITION_DROWN)
-condition:setParameter(CONDITION_PARAM_HIT_DAMAGE, 20)
-condition:setTiming(9999)
+condition:setTiming(5)
function onStepIn(creature, item, position, fromPosition)
@@ -8,7 +7,12 @@ function onStepIn(creature, item, position, fromPosition)
if player == nil then
return true
end
-
+
+ local helmet = player:getSlotItem(CONST_SLOT_HEAD)
+ if helmet ~= nil and helmet:getId() == 5460 then
+ return true
+ end
+
if math.random(1, 10) == 1 then
position:sendMagicEffect(CONST_ME_BUBBLES)
end
diff --git a/data/movements/scripts/misc/helmet_of_the_deep.lua b/data/movements/scripts/misc/helmet_of_the_deep.lua
new file mode 100644
index 0000000..74091fb
--- /dev/null
+++ b/data/movements/scripts/misc/helmet_of_the_deep.lua
@@ -0,0 +1,4 @@
+function onEquip(player, item, slot)
+ player:removeCondition(CONDITION_DROWN)
+ return true
+end
\ No newline at end of file
diff --git a/src/condition.cpp b/src/condition.cpp
index 237db4e..4d923d2 100644
--- a/src/condition.cpp
+++ b/src/condition.cpp
@@ -917,6 +917,13 @@ bool ConditionDamage::executeCondition(Creature* creature, int32_t)
return false;
}
} else if (conditionType == CONDITION_DROWN) {
+ if (isFirstCycle && count - max_count == -2) {
+ doDamage(creature, -20);
+ isFirstCycle = false;
+ count = max_count;
+ return true;
+ }
+
const int32_t r_cycle = cycle;
if (r_cycle) {
if (count <= 0) {
diff --git a/src/condition.h b/src/condition.h
index fe81f43..ed33877 100644
--- a/src/condition.h
+++ b/src/condition.h
@@ -283,7 +283,7 @@ class ConditionDamage final : public Condition
int32_t max_count = 0;
int32_t factor_percent = -1;
int32_t hit_damage = 0;
-
+ bool isFirstCycle = true;
uint32_t owner = 0;
bool doDamage(Creature* creature, int32_t healthChange);
diff --git a/src/player.cpp b/src/player.cpp
index 1bc1d17..49bb168 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -1164,6 +1164,7 @@ void Player::onThink(uint32_t interval)
addMessageBuffer();
}
+ lastWalkingTime += interval;
if (!getTile()->hasFlag(TILESTATE_NOLOGOUT) && !isAccessPlayer()) {
idleTime += interval;
const int32_t kickAfterMinutes = g_config.getNumber(ConfigManager::KICK_AFTER_MINUTES);
diff --git a/src/player.h b/src/player.h
index 5050903..3f39f9c 100644
--- a/src/player.h
+++ b/src/player.h
@@ -286,6 +286,19 @@ class Player final : public Creature, public Cylinder
void resetIdleTime() {
idleTime = 0;
+ resetLastWalkingTime();
+ }
+
+ int32_t getIdleTime() const {
+ return idleTime;
+ }
+
+ void resetLastWalkingTime() {
+ lastWalkingTime = 0;
+ }
+
+ int32_t getLastWalkingTime() const {
+ return lastWalkingTime;
}
bool isInGhostMode() const {
@@ -1045,6 +1058,7 @@ class Player final : public Creature, public Cylinder
int32_t bloodHitCount = 0;
int32_t shieldBlockCount = 0;
int32_t idleTime = 0;
+ int32_t lastWalkingTime = 0;
uint16_t staminaMinutes = 3360;
uint16_t maxWriteLen = 0;