LUA Functions Request

Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications

Moderator: Team Members

Post Reply
User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Post by Scatman » Fri Sep 19, 2008 12:56 pm

Ok now she says what she is supposed to but too many times. After she stops after moving to her first location, she will spam "1" until she starts moving again. Then after reaching loaction 2, and stops, she'll start spamming "2" over and over until she starts moving to location 3, etc.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Sep 19, 2008 1:42 pm

Bah, first she wasn't saying it enough. Now it is too much. Make up your mind! :P Anyways, it is fixed and on public SVN now.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Post by Scatman » Fri Sep 19, 2008 1:49 pm

Hehe, seems I'm a little bi-polar. :) Ok once Tess is updated I'll test it out. I've got another question for ya though.
Do we have a LUA function to check if a specific quest step is completed? In a lot of cases I can use GetQuestStep(spawn, step_id) to see what step I'm on but for this quest I have 3 steps under one grouptasktext so 3 steps are showing at once and I can do them in any order. I have to basically insult each NPC and so there is no specific order I have to talk to them. Well if I talk to the 3rd NPC and complete the 3rd step first, then GetQuestStep would return 1, because it returns the first queststep not completed yet. So I'd only want that 3rd NPC to react to my insult once. Let me know if you need more clarification. I looked for a function in LuaFunctions.cpp but I didn't see one.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Sep 19, 2008 1:58 pm

Ahh, yah I didn't think of that when I made the GetQuestStep function. I'll make a function called QuestStepIsComplete(Player, Quest OR Quest ID, Step ID) that returns true if the step has been completed. Note that the second argument will be a Quest or a Quest ID (not both).

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Post by Scatman » Fri Sep 19, 2008 2:09 pm

Perfect :) thanks. Is there anyway I can have edit permissions to the LUA Functions sticky so I can throw all these new functions in there? Referring to the new functions is getting to be a bit tedious.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Sep 19, 2008 2:11 pm

Heh, sure :) The post is horribly outdated so it could definitely use some cleanup if you are willing :)

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Post by Scatman » Fri Sep 19, 2008 2:15 pm

Yep :) I like to have a reference because I always forget which params go first or which params the new functions have. I'll go through with the LuaFunctions.cpp and make sure everything is up-to-date.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Sep 19, 2008 2:24 pm

You should have access now. If you can't let me know.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Post by Scatman » Fri Sep 19, 2008 3:19 pm

Haha k now she is saying it twice. She says "1" once she stops, and then "1" right before she begins moving to location 2. Then she'll say "2" once she stops and "2" once more right before walking to location 3. :P

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Sep 19, 2008 3:47 pm

Bah, kk, I think I finally got it fixed :)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Sep 19, 2008 6:57 pm

OK, my changes are checked in. I added the following LUA commands:
AddQuestPrereqRace(Quest, race id)
AddQuestPrereqClass(Quest, class id)
AddQuestPrereqTradeskillLevel (not used yet)
AddQuestPrereqTradeskillClass (not used yet)
AddQuestSelectableRewardItem(Quest, item id, quantity)
Quests should now allow you to choose an item when you complete it if you use the AddQuestSelectableRewardItem function. You can mix and match with AddQuestRewardItem if you want. Note that you can call the AddQuestPrereqRace and AddQuestPrereqClass more than once with multiple race/classes. If the player is any of the races in the prereq races then the quest is shown (assuming it passes all other prereqs). The same for classes.
Oh and btw, the server should prevent you from having any items in your overflow slot by checking the items in a quest reward before you accept them.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Post by Scatman » Fri Sep 19, 2008 7:11 pm

Nice! Thanks!

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Fri Sep 19, 2008 7:32 pm

LethalEncounter wrote:AddQuestPrereqRace(Quest, race id)
So, is this actually the race_id, or race_type id?
/laugh
/stare
/shakefist
/cry
/run

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Fri Sep 19, 2008 7:56 pm

race_id, these are only for clients so they should have real race_id values.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sun Sep 21, 2008 2:34 am

Scatman, we got a LUA to cover this? haha.
Castleview1.wmv
Interesting quest, the High Elf mentor. The planter by the merchants spawns a couple of mobs that I also took video of. I'm sure it's not hard to code, but I hadn't seen a quest do what this one did (planting something that appears magically - then stays?)
You do not have the required permissions to view the files attached to this post.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests