Skip to content

Commit

Permalink
Update data-otservbr-global/scripts/creaturescripts/quests/the_dream_…
Browse files Browse the repository at this point in the history
…courts/faceless_bane_step_positions.lua

Co-authored-by: Luan Luciano <[email protected]>
  • Loading branch information
CarlosE-Dev and Luan Luciano authored Mar 30, 2024
1 parent d1f38c8 commit 6846be7
Showing 1 changed file with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,37 +71,23 @@ function facelessBaneStepPositions.onStepIn(creature, item, position, fromPositi
end

if Game.getStorageValue(GlobalStorage.FacelessBaneStepsOn) < 1 then
local positionAlreadyAdded = false
if #walkedPositions == 0 then
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ)
position:sendMagicEffect(CONST_ME_YELLOWENERGY)
table.insert(walkedPositions, position)
return true
end

for _, p in ipairs(walkedPositions) do
if p == position then
positionAlreadyAdded = true
break
if #walkedPositions > 0 then
for _, walkedPos in ipairs(walkedPositions) do
if walkedPos == position then
return true
end
end
end

if positionAlreadyAdded then
return true
else
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ)
position:sendMagicEffect(CONST_ME_YELLOWENERGY)
table.insert(walkedPositions, position)
position:sendSingleSoundEffect(SOUND_EFFECT_TYPE_SPELL_BUZZ)
position:sendMagicEffect(CONST_ME_YELLOWENERGY)
table.insert(walkedPositions, position)

if #walkedPositions == 13 then
Game.setStorageValue(GlobalStorage.FacelessBaneStepsOn, 1)
addEvent(resetWalkedPositions, 60 * 1000)
sendEnergyEffect()
return true
end
if #walkedPositions == 13 then
Game.setStorageValue(GlobalStorage.FacelessBaneStepsOn, 1)
addEvent(resetWalkedPositions, 60 * 1000)
sendEnergyEffect()
end

return true
end
return true
end
Expand Down

0 comments on commit 6846be7

Please sign in to comment.