Page 1 of 1

Bastok Quest -- Smoke On The Mountain

Posted: Fri Mar 22, 2013 10:42 pm
by eccentricanata
Hello.

This is my first time writing Lua, using SVN, and contributing to this project.

This is for the quest "Smoke On the Mountain", given in Metalworks Eatery (second floor). An additional helper NPC in Bastok Markets (Offa) has been modified. A new ??? (qm2.lua) has been added in S. Gustaberg.

Re: Bastok Quest -- Smoke On The Mountain

Posted: Fri Mar 22, 2013 11:48 pm
by PrBlahBlahtson
Om nom nom.

A few tips, going forward. :) I made the fixes for you, which you can see in my commit.

- When declaring variables that aren't needed outside of that part of the NPC's code, declare them as locals. That way they don't hang around in memory and wreck mischief.
- You also only really need to store quest status and things like that in a variable if you're more comfortable that way, or if you're going to be referring to it more than once.
- When you're using an alias, include the require at the top of the NPC's script. If that file hasn't been loaded yet, the alias you're checking is still nil, which does... interesting things to the server :)
- Smoke on the Mountain should grant the title "Hot Dog."
- Looks like SVN might have ignored your changes to TextIDs, which creates another nil ;)
- You also set the quest up in a way that wasn't repeatable at the fire pit, but that can be tricky if you haven't encountered it before.
- Didn't check for full inventory before giving an item, but we never really mentioned that to you ;)
- Not sure if you did it, or if it just worked out for you, but the TextIDs are nil'd before being used, which is exactly the way to do it.

Also, when comparing times from os.time(), you don't really need to do any fancy math. Greater than, Less than pretty much cuts it.

Committed in r3106

Re: Bastok Quest -- Smoke On The Mountain

Posted: Sun Mar 24, 2013 12:32 am
by Metalfiiish