print("NPC_Balloonist init") require "lua/entity.lua" require "lua/utilities.lua" require "lua/level_hub/npc_base.lua" require "lua/level_hub/ruinsstate.lua" npcname = "balloonist" ruins["npcPointers"][npcname] = get_object() doFacing = true doGreetAnim = true doTalkAnim = true myConversations = { "", -- 1 "", -- 2 "", -- 3 "RuinsBalloonist04", -- 4 "RuinsBalloonist05", -- 5 "RuinsBalloonist06", -- 6 "RuinsBalloonist07", -- 7 "RuinsBalloonist05", -- 8 "RuinsBalloonist06", -- 9 "RuinsBalloonist07", -- 10 "RuinsBalloonist05", -- 11 "RuinsBalloonist06", -- 12 "RuinsBalloonist07", -- 13 "RuinsBalloonist14", -- 14 "RuinsBalloonist15", -- 15 "RuinsBalloonist16", -- 16 "RuinsBalloonist14", -- 17 "RuinsBalloonist15", -- 18 "RuinsBalloonist16", -- 19 "RuinsBalloonist14", -- 20 "RuinsBalloonist07", -- 21 "RuinsBalloonist22", -- 22 } function selectConversation() local state = RuinsState.get() if state == 1 then activeConversation = "RuinsBalloonist01" conversationResultYes = function() print("goToNextLevel") goToNextLevel() end conversationResultNo = function() activeConversation = "RuinsBalloonist01_Refuse" talk() conversationResultNo = function() end end elseif state == 2 and ruins.sc05Done then activeConversation = "RuinsBalloonist02" conversationResultYes = function() print("goToNextLevel") goToNextLevel() end conversationResultNo = function() activeConversation = "RuinsBalloonist02_Refuse" talk() conversationResultNo = function() end end elseif state == 3 then if ruins.state3UpgradeDone then if not hadFirstState3Conversation then nextLevelPrompt(false,"RuinsBalloonist03_1",nil,"RuinsBalloonist03_Refuse",nil) hadFirstState3Conversation = true else nextLevelPrompt(false,"RuinsBalloonist03_2",nil,nil,nil) end else activeConversation = "RuinsBalloonist03_0" end else activeConversation = myConversations[state] print( "offerBalloonRide" , offerBalloonRide() ) if offerBalloonRide() then conversationResultAll = function() activeConversation = "RuinsBalloonistRidePrompt" conversationResultYes = function() print("start BalloonRide") object("StartRide").trigger.send(1) conversationResultYes = function() end end conversationResultAll = function() end talk() end end end end function offerBalloonRide() local state = RuinsState.get() if state >= 4 then if state == 4 then if ruins.sc11Done then return true end elseif state <= 13 then return true elseif state == 22 then return true end else return false end end while tick() do npctick(dt) if trigger.received(1,"playAnimRepair") then trigger.send(1,"animRepair") end if trigger.received(1,"stopAnimRepair") then trigger.send(2,"animRepair") end end