Feature - Implemented Track which quest item Shen Copperhead sent you to get

zarqon

Well-known member
Mafia tracks most quests very well, allowing scripters to save server hits when making scripts that need to check quest progress. There is a little hole in its tracking, however: Shen Copperhead's series of items that he sends you to get. The questL11Shen property lets us know whether or not he's currently sent us out to get an item, but not which item he's sent us to get. Possible items include:

  • The Stankara Stone
  • The First Pizza
  • Murphy's Rancid Black Flag
  • The Eye of the Stars
  • The Shield of Brook

I propose that mafia track this in a property, perhaps shenQuestItem, which would be set when enquested with an item, and cleared when you hand in the item.
 

Erich

Member
While this is brought up, I have a question about the quest tracking preferences, since I noticed it while looking up this exact quest last night. The wiki shows most quests and their steps, though some aren't listed. Is there a way for me to check in Mafia what the all steps are, since doing prefref in the cli only shows the current step and default? From memory, I saw that Shen is:

Unstarted
Started
Step1-5 (get, bring, get, bring, get)
Finished
 

zarqon

Well-known member
Mafia has an internal data file which lists all of this. Prefref Plus handily exposes this data for you, if you'd like to give it a try (link in my sig). Just mouseover any quest property to see the full list of what each step means.
 

Darzil

Developer
Because I'm dumb, yesterday I captured all the quest log and Copperhead quest html, then didn't save it.

Hopefully I'll remember when I'm there again tomorrow.
 
Because I'm dumb, yesterday I captured all the quest log and Copperhead quest html, then didn't save it.

Hopefully I'll remember when I'm there again tomorrow.

I've been using the location link given in the quest log in place of mafia tracking the particular goal.

Code:
	matcher myShen = create_matcher("<tr rel=\"copperhead\">(?:.*?)<b>(.*?)</b>", page);

You probably want more than that but I figured I'd post it anyway.
 

Erich

Member
Because I'm dumb, yesterday I captured all the quest log and Copperhead quest html, then didn't save it.

Hopefully I'll remember when I'm there again tomorrow.

Yesterday I copy and pasted some of the text:

Code:
Recover Murphy's Rancid Black Flag from The Castle in the Clouds in the Sky (Top Floor).

Take Murphy's Rancid Black Flag back to the Copperhead Club.

[missed this one]

Take The Shield of Brook back to the Copperhead Club.

Recover The Eye of the Stars from The Hole in the Sky.

Take The Eye of the Stars back to the Copperhead Club.

There are links and such but I'll see them tomorrow as well. This is day 2.
 

Darzil

Developer
r18728 - lightly tested.
r18729 also updates shenQuestItem when you get the item, or from log when told to take it back, untested.
 
Last edited:

zarqon

Well-known member
Finally got around to testing this. The new property is working splendidly, thanks very much! Could we also update the questL11Shen property when we turn in an item rather than needing to hit the quest log? After fetching the shenQuestItem, I'd like to be able to simply adventure in the Club until the quest property updates to indicate we turned it in.
 

Darzil

Developer
It should do so.
Code:
		case 852:
			// Shen Copperhead, Jerk
			// Deliberate fallthrough
		case 853:
		{	// Shen Copperhead, Huge Jerk
			Matcher matcher = ChoiceManager.SHEN_PATTERN.matcher( text );
			if ( matcher.find() )
			{
				Preferences.setString( "shenQuestItem", matcher.group( 1 ) );
			}
		}
			// Deliberate fallthrough
		case 854:
			// Shen Copperhead, World's Biggest Jerk
			QuestDatabase.advanceQuest( Quest.SHEN );
 

zarqon

Well-known member
Hmmm, I have a script that adventures until the property changes (it's more complicated but essentially while (quest property check) adventure(1,place)) and it blew right past those steps and kept adventuring. Rerunning the script (which visits the quest log) correctly detected the quest progress. I'll test it again when I come back around in a few days (Pocket Familiar factoid runs) and see if the problem may lie within the script.
 

Darzil

Developer
The odd bit about that is that we cannot tell the quest step from the quest log as there is nothing to indicate which item you are getting, first second or third.
 

zarqon

Well-known member
Yeah, I'm digging into it and I believe I've found the problem lies at home.

So... thanks!
 
Top