Dev Blog 20200721 - psychobilli/TrinityCoreIssues GitHub Wiki

I finished the trainers script and opened a pull request. They didn't like it. To make everything work I had to add my on gossip_menu_option records, which they didn't work. They suggested I get data from the live realms, colloquially referred to as "sniffs," rather than use custom gossips. I'm not interested in sniffing data. I'm debating if I want to update the script to remove those new gossips and keep the stuff they would use, but I'm not ready to work on it. Right now I'm focused on a new puzzle.

After submitting the pull request, I started looking into issues with Teldrassil quests. I figured that zone would be the easiest to fix. So I started working through it. At first it was easy. I corrected a few records in creature_queststarter, added a script in creature_template and updated a couple of smart_scripts. Compared to the trainer script, this thing was coming together with ease.

Then I ran into a major hurdle. The Sentinel Huntress who spawns during the Relics of Wakening quest doesn't auto attack. After watching a couple of videos I saw that she should assist and cast a couple of spells. I checked WowHead and saw that she can cast Net, to root enemies, and Bandage, to heal players (presumably, maybe only herself). In TC Cata, she just follows lazily along and has some gossip options to direct players. At least the gossips work.

I plugged away at that for a bit, then moved on. I ran into my second major hurdle: Mist. A simple escort quest, arguably one of the best in the game. Except the quest didn't complete when arriving at the destination. That would be easier than some bizarre NPC behavior.

I understood immediately that smart scripts were going to solve this problem with Mist. I read through the documentation and attempted to correct a few records. Failing that I tried entering a few new ones. I realized I was coming at this framework piecemeal: I was selecting a couple of options from documentation and testing it. It would take forever to find a working solution. I knew this quest existed in Wotlk, so I tested the 335 branch. It worked there. Except 335 has a habit of using C++ scripts over smart scripts. In a moment of intense anticipation, I checked 335 and found NO Teldrassil.cpp scripts. Fist pump! 335 used Smart Scripts, too: the solution was at hand!

It still wasn't straightforward. It took me a couple of days spot checking the data between 335 and 434. Even after copying data over to 434, it still didn't work. Despite my efforts there was one detail I couldn't follow. SMART_ACTION_CALL_TIMED_ACTIONLIST. I kept dismissing it as irrelevant and focusing on things like "Quest Complete" and "The thing I thought was a problem." Days later I was no where near my computer and I realized creature_template.entry + '00' was an extension to a Smart Script. I re-wrote my query and found more data that fit the quest I was looking at. It was still confusing.

I eventually wrote a stored procedure which consolidated the data for a given creature. select * from smart_scripts where entryorguid = concat(@mist_entry, '00') did indeed provide more information. SMART_ACTION_CALL_TIMED_ACTIONLIST runs a new script in sequence. It could also run multiple scripts which could override one another. After more beating my head a against a wall, I eventually learned that the Mist didn't complete on arriving at the destination for two reasons. The first was that Mist had two SMART_ACTION_CALL_TIMED_ACTIONLIST lists, and the second had to override the first with action_param3 = 1. The second was because the "Quest Complete" script didn't set the value for SMART_TARGET_STORED. Once I had that in place - and remembered to reset smart scripts in game - the quest completed.

One minor problem, Sentinel Arynia Cloudsbreak was supposed to send to talk scripts on quest complete. Grr... okay. I can complete the quest without GM commands now. Moving on.

Techinically, I've resolved the major issues with Teldrassil at this point, but the issue with the Setinel Huntress still haunts me. I have since learned that NPCs have factions, and unkillable flags set with unit_flags thanks to troubleshooting Mist. With those lessons I thought I could fix the Sentinel Huntress. Despite my best efforts with Smart Scripts and unit flags, gm commmand 'npc info' still shows that she has those two flags which prevent her from assisting in combat.

They're not coming from creature_template or creature, so what is the data source?