New Quest Features

EQ2Emulator Development forum.

Moderator: Team Members

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

New Quest Features

Post by thefoof » Wed Aug 28, 2013 2:45 pm

Just committed a couple new quest features.

1. You may now use the subtype 'MaxCoin' to specify a maxcoin range for quest rewards. This will generate a coin value between Coin and MaxCoin, this will only be used if Coin is > 0.

2. LUA function: SetQuestComplete(Quest* quest). This will set a quest's completed_flag as true, which means the quest journal will show a quest as completed.

EDIT: The function is causing server crashes when zoning with a quest with the SetQuestComplete set so I'll have to look into this a bit more, I know the flag I set to send is correct so it's breaking somewhere else. Basically hold off on using this for now :P

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:

Re: New Quest Features

Post by John Adams » Wed Aug 28, 2013 5:48 pm

thefoof wrote:2. LUA function: SetQuestComplete(Quest* quest). This will set a quest's completed_flag as true, which means the quest journal will show a quest as completed.
What the devil? We never had completed quests? lol Oy..

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: New Quest Features

Post by thefoof » Wed Aug 28, 2013 5:50 pm

John Adams wrote:
thefoof wrote:2. LUA function: SetQuestComplete(Quest* quest). This will set a quest's completed_flag as true, which means the quest journal will show a quest as completed.
What the devil? We never had completed quests? lol Oy..
I think at one point we did but the quest journal packet changed around 931 (just guessing from the if statements)

Let me clarify this is just the flag next to the quest that says completed, not the completed journal tab.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: New Quest Features

Post by thefoof » Wed Aug 28, 2013 7:22 pm

thefoof wrote:EDIT: The function is causing server crashes when zoning with a quest with the SetQuestComplete set so I'll have to look into this a bit more, I know the flag I set to send is correct so it's breaking somewhere else. Basically hold off on using this for now :P
I fixed the crash, something I'm noticing now is the flag doesn't show until you either zone or get another quest update, or if you're getting this quest and it's already flagged as complete in the init quest function.

I've basically concluded the quest journal flags don't update until you get a journal reply message with an update, or you zone getting all new data. So this is probably the order we run through quest steps. We'll have to set the flag before the update gets sent somehow.

One way I was thinking of doing this is just like how we save a complete action to a step, flag a queststep as the last step in the quest. But not a high priority going to leave it as is now.

I'm going to move all my randomized coin values over to the db so just wanted to get this basically functional so I don't have to run through all the scripts twice lol.

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: New Quest Features

Post by xinux » Wed Aug 28, 2013 9:43 pm

Just a side note unless it has been changed we send all the quests in a update instead of just the quest that need's a update. Now back to your normally scheduled program.
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: New Quest Features

Post by thefoof » Fri Aug 30, 2013 2:21 am

Okay I've got this working properly now on my local, it's indeed a packet order type issue. I set the server to send the quest journal packet as well right before an update packet and its all working groovy now. I also have a fix for the bug where the AddStepProgress function had no check to see if you were going past the max progress needed.

I'll post these later today after a bit more testing and maybe a couple minor fixes to other quest functions if I find anything else.

Note I also plan to change the LUA function name just to not cause confusion as to what it does, will document it after I get everything finalized to the SVN (for real this time :wink: )

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New Quest Features

Post by Jabantiz » Fri Aug 30, 2013 12:21 pm

Nice job on figuring this stuff out foof

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: New Quest Features

Post by thefoof » Fri Aug 30, 2013 5:01 pm

Thanks jab :D . Here's the summary of all the changes I just commited:

*Changed name of lua function SetQuestComplete to SetCompleteFlag

*Added: enc_level field to quests table, and we now use this value (can flag a quest as heroic or epic)

*Fixed: QuestStep::AddQuestStep(), added a check to make sure you don't add more progress than what's required

*Fixed: We now send the quest journal on every update, for more accurate quest updates.

*Added: We now send the repeatable flag, either our struct is off or there's another unknown repeatable flag somewhere in one of the quest packets (possibly display_status)




Here's some TODO for later:

*Force AddQuestRequired to update on spawns in zone after each quest update

*Possibly update the QuestJournalReply struct, I tried sending the classic_eq_sound and nothing special happened, same with the repeatable flag.

*Send the quest journal to a player after leveling if we don't, the difficulty colors don't seem to change

*Eventually figure out how to set a zone color as yellow in the journal

*Figure out how to activate the different quest journal sorting options

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New Quest Features

Post by Jabantiz » Fri Aug 30, 2013 5:33 pm

thefoof wrote: *Added: We now send the repeatable flag, either our struct is off or there's another unknown repeatable flag somewhere in one of the quest packets (possibly display_status)[/b]

...


*Eventually figure out how to set a zone color as yellow in the journal

*Figure out how to activate the different quest journal sorting options
Repeatable flag is in the display_status as well as turning the category name yellow. However making it yellow requires a new flag for all variations of flags so you need a new value to send it as yellow and repeatable, or yellow and complete.

display_status also handles the hidden flag and the check mark to the left for if you are tracking the quest in the quest helper or not.

As for sorting options it should mostly be client side and you should be able to sort it now.

On a side not I am adding the tradeskill prereq for quests.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New Quest Features

Post by Jabantiz » Fri Aug 30, 2013 6:27 pm

Jabantiz wrote:On a side not I am adding the tradeskill prereq for quests.
This code is now on Dev SVN, both lua and DB should work to set tradeskill prereq's

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

New Commit

Post by thefoof » Thu Sep 05, 2013 6:02 am

This is alot of small changes/new checks but it's all related to quests in some fashion or another so just posting it here.

Added: Max TS and Adv level prereqs to quests (self explanatory ;))

Added: bool Player::CanReceiveQuest(), moved some checks from Player::CheckQuestFlag to this
I moved alot of the checks for quest flags into CanReceiveQuest so that we can just check for that value on individual quests without a ton of repetative code. CheckQuestFlag() still works exactly the same, I added the ability for Max level reqs and I also added a check so you can't be offered a quest you already have.

Added:Yellow name/category support for quests(right now this is set to happen if the zonename you're in matches the quest's zonename. can manually set it through the lua function SetQuestYellow[Quest* quest])


Added:vector<Spawn*> ZoneServer::GetSpawnsByID()

This just returns all of the spawns in a zone from the spawn_list with the spawn_id you give it.

Added: LUA functions RemoveSpawnIDAccess() and AddSpawnIDAccess()
These functions work just like AddSpawnAccess and remove spawn access, except for every spawn in a zone with the id you give. Their params are the same for syntax, RemoveSpawnIDAccess(Spawn* spawn, int32 spawn_id, [ZoneServer* zone]) the zone param is optional, if not set it will use the spawn's zone. The spawn is the spawn to grant/remove access to.

Added: LUA function: CanReceiveQuest(Spawn* player, int32 quest_id)
This runs a check with the function of the same name I mentioned earlier and returns a bool. The spawn must be a player for it to work. (Should make spawnscripts for quest NPCs alot simpler for quests with alot of requirements.)

Changed: PlayAnimation lua function and server function
I added 2 optional params to change the way PlayAnimation works, you can now use a player for the third param. If the third param is used the function checks for the forth param which is an int8. Using 1 for param 4 will only send the animation to the player, 2 sends it to all players in range except the player in param 3. Param 4 defaults to 1 if not set.

Will get all the LUA functions documented in the next day or two :D

User avatar
alfa
Team Member
Posts: 550
Joined: Fri Jul 27, 2007 6:24 pm
Location: France
Contact:

Re: New Quest Features

Post by alfa » Thu Sep 05, 2013 12:51 pm

Great work ^^
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: New Quest Features

Post by thefoof » Fri Sep 27, 2013 10:44 pm

Just committed db/code support for tradeskill XP rewards.

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: New Quest Features

Post by thefoof » Sat Sep 28, 2013 10:56 pm

Just committed support for crafting quest steps. Here's a link to the LUA function.


EDIT: Made a small adjustment to this feature and went ahead to set quests with the category "Tradeskill" to use the player's tradeskill level calculating the difficulty. Also hardcoded more categories to auto yellow in the quest journal. If more need to be added refer to Quest::CheckCategoryYellow()

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New Quest Features

Post by Jabantiz » Wed Apr 22, 2015 4:07 pm

Fixed an issue with repeatable quests that Cynnar pointed out to me. Basically if you completed a quest and got it again then logged out when you logged back in the quest was gone. It will now still be there but there are some issues with the listing in the completed tab, as that tab seems to be minor I will leave like this for now.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests