-- ============================================
-- NPC PATROL WAYPOINTS
-- ============================================

local function step3()
    game_api.npc_walk_to(0, 0.0, 0.0, -30.0, step1)
end

local function step2()
    game_api.npc_walk_to(0, -2.0, 0.0, -2.0, step3)
end

function step1()
    game_api.npc_walk_to(0, 2.0, 0.0, -2.0, step2)
end

step1()

-- ============================================
-- ITEM PICKUP HANDLER
-- ============================================

function on_health_pickup()
    game_api.pickup_item("health_potion")
    print("[Lua] Health potion picked up!")
    
end

-- ============================================
-- NPC INTERACTION HANDLER
-- ============================================

function on_npc_interact(npc_index)
    print("[Lua] NPC interaction! Index: " .. tostring(npc_index))
    
    if npc_index == 1 then
        game_api.start_dialogue("test_line_dialogue")
    else
        game_api.receive_npc_gift(npc_index)
    end
end

print("Lua script loaded successfully!")