Skip to content

Commit 1943738

Browse files
committed
fix(npc): Cipfried and Dallheim don't cure burning
Both offer free healing and both handle CONDITION_POISON only, so a player who says "hi"/"heal" while on fire is told they look fine and keeps burning. They are the two free healers newcomers reach first, so it is the most noticeable case. Other healer NPCs already do this: Quentin, Alia, Amanda, Azalea and Cedrik all handle CONDITION_FIRE alongside poison. This just brings these two in line with them, adding the fire branch before the poison one so the more specific condition is matched first. Counted across data-otservbr-global/npc: 35 NPCs expose a "heal" keyword, but only some of them handle fire.
1 parent ec41dfc commit 1943738

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

data-otservbr-global/npc/cipfried.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ keywordHandler:addAliasKeyword({ "wolves" })
133133
keywordHandler:addKeyword({ "adventure" }, StdModule.say, { npcHandler = npcHandler, text = "I can see a bright future for you... you will soon embark on a very big adventure and explore the world of {Tibia} - maybe even influence history!" })
134134
keywordHandler:addAliasKeyword({ "explore" })
135135

136+
keywordHandler:addKeyword({ "heal" }, StdModule.say, { npcHandler = npcHandler, text = "You are burning. Let me quench those flames." }, function(player)
137+
return player:getCondition(CONDITION_FIRE)
138+
end, function(player)
139+
local health = player:getHealth()
140+
if health < 65 then
141+
player:addHealth(65 - health)
142+
end
143+
player:removeCondition(CONDITION_FIRE)
144+
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
145+
end)
136146
keywordHandler:addKeyword({ "heal" }, StdModule.say, { npcHandler = npcHandler, text = "You are poisoned. I will help you." }, function(player)
137147
return player:getCondition(CONDITION_POISON)
138148
end, function(player)

data-otservbr-global/npc/dallheim.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,16 @@ keywordHandler:addKeyword({ "billy" }, StdModule.say, { npcHandler = npcHandler,
194194
keywordHandler:addAliasKeyword({ "willie" })
195195

196196
-- Healing
197+
keywordHandler:addKeyword({ "heal" }, StdModule.say, { npcHandler = npcHandler, text = "You are burning. Let me quench those flames." }, function(player)
198+
return player:getCondition(CONDITION_FIRE) ~= nil
199+
end, function(player)
200+
local health = player:getHealth()
201+
if health < 65 then
202+
player:addHealth(65 - health)
203+
end
204+
player:removeCondition(CONDITION_FIRE)
205+
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
206+
end)
197207
keywordHandler:addKeyword({ "heal" }, StdModule.say, { npcHandler = npcHandler, text = "You are poisoned. I will help you." }, function(player)
198208
return player:getCondition(CONDITION_POISON) ~= nil
199209
end, function(player)

0 commit comments

Comments
 (0)