Skip to content

Commit

Permalink
npc alter improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed Feb 22, 2024
1 parent 7d90b9a commit aace01a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions data-otservbr-global/npc/altar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ local function creatureSayCallback(npc, creature, type, message)
end

message = message:lower()
if MsgContains(message, "offer") then
npcHandler:say("Five tainted hearts and five darklight hearts drowned in a worldly wealth of 50000000 gold pieces for the righteous. Are you prepared?", npc, creature)
if MsgContains(message, "kneel") then
npcHandler:say("Prepare your offer and cling to the sanctitity of this place.", npc, creature)
npcHandler:setTopic(playerId, 1)
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 1 then
elseif MsgContains(message, "offer") and npcHandler:getTopic(playerId) == 1 then
npcHandler:say("Five tainted hearts and five darklight hearts drowned in a worldly wealth of 50000000 gold pieces for the righteous. Are you prepared?", npc, creature)
npcHandler:setTopic(playerId, 2)
elseif MsgContains(message, "yes") and npcHandler:getTopic(playerId) == 2 then
npcHandler:setTopic(playerId, 0)
if player:getItemCount(43855) < 5 or player:getItemCount(43854) < 5 then
-- Verifica se o jogador tem menos de 5 de cada item
npcHandler:say("Sorry, you don't have all items.", npc, creature)
return true
end
Expand All @@ -67,7 +69,7 @@ local function creatureSayCallback(npc, creature, type, message)
end

if player:removeItem(43855, 5) and player:removeItem(43854, 5) then
player:addItem(43895, 1)
player:addItem(BAG_YOU_COVET, 1)
npcHandler:say("Your sacrifice has been accepted, mortal. Embrace your reward!", npc, creature)
end
elseif MsgContains(message, "no") and npcHandler:getTopic(playerId) == 1 then
Expand Down
3 changes: 3 additions & 0 deletions data-otservbr-global/world/otservbr-npc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2986,4 +2986,7 @@
<npc centerx="33710" centery="32602" centerz="6" radius="1">
<npc name="Hawkhurst Ingol" x="0" y="0" z="15" spawntime="60" />
</npc>
<npc centerx="34070" centery="32009" centerz="14" radius="1">
<npc name="Altar" x="0" y="0" z="15" spawntime="60" />
</npc>
</npcs>

0 comments on commit aace01a

Please sign in to comment.