Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boontaHeraConvoHandler = Object:new {
- }
- function boontaHeraConvoHandler:getNextConversationScreen(conversationTemplate, conversingPlayer, selectedOption)
- -- Assign the player to variable creature for use inside this function.
- local creature = LuaCreatureObject(conversingPlayer)
- -- Get the last conversation to determine whetehr or not we're on the first screen
- local convosession = creature:getConversationSession()
- lastConversation = nil
- local conversation = LuaConversationTemplate(conversationTemplate)
- local nextConversationScreen
- -- If there is a conversation open, do stuff with it
- if ( conversation ~= nil ) then
- -- check to see if we have a next screen
- if ( convosession ~= nil ) then
- local session = LuaConversationSession(convosession)
- if ( session ~= nil ) then
- lastConversationScreen = session:getLastConversationScreen()
- end
- end
- -- Last conversation was nil, so get the first screen
- if ( lastConversationScreen == nil ) then
- nextConversationScreen = conversation:getScreen("first_screen")
- else
- -- Start playing the rest of the conversation based on user input
- local luaLastConversationScreen = LuaConversationScreen(lastConversationScreen)
- -- Set variable to track what option the player picked and get the option picked
- local optionLink = luaLastConversationScreen:getOptionLink(selectedOption)
- nextConversationScreen = conversation:getScreen(optionLink)
- end
- end
- -- end of the conversation logic.
- return nextConversationScreen
- end
- function boontaHeraConvoHandler:runScreenHandlers(conversationTemplate, conversingPlayer, conversingNPC, selectedOption, conversationScreen)
- -- Plays the screens of the conversation.
- local player = LuaSceneObject(conversingPlayer)
- local screen = LuaConversationScreen(conversationScreen)
- local screenID = screen:getScreenID()
- local pConvScreen = screen:cloneScreen()
- local clonedConversation = LuaConversationScreen(pConvScreen)
- local playerFaction = self:getFactionFromHashCode(CreatureObject(conversingPlayer):getFaction())
- end
- return pConvScreen
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement