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


local function step2()
    game_api.npc_walk_to(1, 19.5, 0.0, 32, step1)
end

function step1()
    game_api.npc_walk_to(1, -6.45, 0.0, 7.82, step2)
end

step1()

local function step2x()
    game_api.npc_walk_to(3, 12.7499, 0, -20.8708, step1x)
end

function step1x()
    game_api.npc_walk_to(3, -5.74176,  0, -25.8261, step2x)
end

step1x()
-- ============================================
-- 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 == 0 then
        game_api.start_dialogue("dialog_student")
    end
	if npc_index == 1 then
		game_api.start_dialogue("dialog_female_student")
	end
	if npc_index == 2 then
        game_api.start_dialogue("dialog_mukhtar")
    end
	if npc_index == 4 then
        game_api.start_dialogue("dialog_aida")
    end
end

print("Lua script loaded successfully!")