39 lines
945 B
Lua
39 lines
945 B
Lua
-- ============================================
|
|
-- 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")
|
|
|
|
end
|
|
|
|
function on_item_pickup(object_name)
|
|
print("========================================")
|
|
print("on_item_pickup CALLBACK CALLED!")
|
|
print("Player picked up item from: " .. tostring(object_name))
|
|
print("========================================")
|
|
|
|
game_api.pickup_item(object_name)
|
|
|
|
--game_api.show_inventory()
|
|
end
|
|
|
|
print("Lua script loaded successfully!") |