Skip to content

Commit

Permalink
chore: fix minor console errors
Browse files Browse the repository at this point in the history
Update spawns_npc_by_time.lua

Update spawns_npc_by_time.lua

Update spawns_npc_by_time.lua
  • Loading branch information
omarcopires committed Feb 20, 2024
1 parent 9c2b4b6 commit a4769af
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local config = {
pos = Position(33497, 32196, 7),
herbId = 5953,
herbWeight = 1,
storage = ThreatenedDreams.Mission03.RavenHerbTimer,
storage = Storage.Quest.U11_40.ThreatenedDreams.Mission03.RavenHerbTimer,
}

local createRavenHerb = GlobalEvent("createRavenHerb")
Expand Down Expand Up @@ -55,5 +55,5 @@ function ravenHerb.onUse(player, item, fromPosition, target, toPosition, isHotke
return true
end

ravenHerb:aid(ThreatenedDreams.Mission03.RavenHerbTimer)
ravenHerb:id(25783)
ravenHerb:register()
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@ local npcSpawns = {

local spawnsNpcByTime = GlobalEvent("SpawnsNpcByTime")

function spawnsByTimeEvent.onPeriodChange(period)
function spawnsNpcByTime.onPeriodChange(period)
for _, npcSpawn in ipairs(npcSpawns) do
if npcSpawn.spawnPeriod == period then
local spawnNpc = Game.createNpc(npcSpawn.name, npcSpawn.position)
if spawnNpc then
spawnNpc:setMasterPos(npcSpawn.position)
npcSpawn.position:sendMagicEffect(CONST_ME_TELEPORT)
logger.info("[NPC Spawn] {} has spawned", npcSpawn.name)
spawnNpc:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
elseif npcSpawn.despawnPeriod == period then
local despawnNpc = Npc(npcSpawn.name)
if despawnNpc then
despawnNpc:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
despawnNpc:remove()
logger.info("[NPC Despawn] {} has despawned", npcSpawn.name)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion data/libs/core/global_storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ Global = {
Storage = {
FamiliarSummonEvent10 = 30054,
FamiliarSummonEvent60 = 30055,
CobraFlask = 30055,
CobraFlask = 30056,
},
}

0 comments on commit a4769af

Please sign in to comment.