Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free boats #800

Closed
wants to merge 1 commit into from
Closed

Free boats #800

wants to merge 1 commit into from

Conversation

HeavenIsLost
Copy link
Contributor

Able to choose if free boats or not and some fixes in boats Npcs( costs, need premium, voices, and some keywords ).

…ts, need premium, voices, and some keywords ).
@EPuncker
Copy link
Contributor

I still don't like this implementation, better edit the StdModule.travel instead as I said in your another pull request, if it got added I'll just skip updating travel npcs because of the way you added too much code for just a cost change, I still don't see the option to disable premium and quest check :/ better to pull it once all is completed

@HeavenIsLost
Copy link
Contributor Author

Too much job to pull everything in one time. I just want to have a option to have free or paid boats. Of course, you are right, stdModule.travel implementation 1000 more clean than this, but it would fuck the messages, because we need to have the message with the cost of travel and the message without the cost of the travel, it cannot be implemented in a custom manner for every npc with stdModule.travel, its why i have done what i have done. Disabling the need to have premium could be done directly on stdModule.travel( using luaFlags ). The options to disable/enable quest check could be done with luaFlags( just add one variable to luaFlags table and do the code to check if player has the quest/mission required and the need is enabled on luaFlags, we can do this in the future ). Its a WIP. Its not too much code, its just duplicate.

@tarantonio
Copy link
Contributor

In my opinion, the way to go is:

  • If you have free premium on config.lua, then you have free boats.
  • Else you have to pay for travels.

@PrinterLUA
Copy link
Collaborator

Maybe we should done, something like this:
http://pastebin.com/gF3PaeBY

To cut the code alot.

@HeavenIsLost
Copy link
Contributor Author

If you want to in do this way( dynamic ), i think i have a better way:
local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.sayPaidFree, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Thais %s?', textPaid = "for 180 golds",textFree = "for free"})

It would choose if use TextPaid or TextFree based on luaFlags.freeBoats = true

@EPuncker

Quest check:

local travelNode = keywordHandler:addKeyword({'yalahar'}, StdModule.sayQuestCheck, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you seek a passage to Yalahar for 240 golds?', questCheck = { enabled = luaFlags.accessToYalahar, storage = Storages.accessToYalahar, value = 2 } }})

Instead of doing a stdModule.say to questCheck and another to paid or free we can implement everything in normal stdModule.say.

@EPuncker
Copy link
Contributor

dude why not focus on fixing existing content and adding new content so then we can finally think on adding features? :/

@PrinterLUA
Copy link
Collaborator

Well, we could edit the modules. But i have never take a look into the npc libs. So i would not dare to change there ^^

@HeavenIsLost
Copy link
Contributor Author

I can do this, i will work on this and then i will make a new pull request in this subject( again! ).

@PrinterLUA
Copy link
Collaborator

Haha heaven, sorry bro :) But thanks that you are doing this ^^ I love the spirit in you!

@Royalot
Copy link
Collaborator

Royalot commented Jun 28, 2014

i think with printers script we can fix this #698 issue, too

@EPuncker
Copy link
Contributor

I like @PrinterLUA script lol :D I see no problem in adding it to all npcs, also instead of freeTravel setting, just edit it so if price = 0 then it act as if freetravel were true =P

@HeavenIsLost
Copy link
Contributor Author

My new proposal is better than Printer one, more clean than use creaturecallbacksay.

@EPuncker
Copy link
Contributor

@HeavenIsLost where is it? xD

@PrinterLUA
Copy link
Collaborator

I took look into the stdmodule, if you ask me. It's not even the best idea to use stdmodule, its so badly made.

But here it is, i also converted it to metatables:
http://pastebin.com/JHJM44dU

And here is the example how the captain module should look:
http://pastebin.com/NHV7UEva

Free travel, such as prem and price cost will be free if you have setted on config.lua freePremium = "yes".

If you want use the other solution, which is updated than the other one above:
http://pastebin.com/CVr7J1ve

@PrinterLUA PrinterLUA closed this Jul 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants