Artisan Titles
I hadn't seen this posted anywhere, so just wanted to toss out my solution to the Artisan titles. This likely isn't the best way to do it, but it works.
For reference, here's how the titles and tradeskills map out: 100 - Apprentice Artisan 200 - Journeyman Artisan 250 - Expert Artisan 300 - Master Artisan Code:
sub EVENT_ENTERZONE { Code:
INSERT INTO `eqemu`.`titles` (`id`, `skill_id`, `min_skill_value`, `max_skill_value`, `min_aa_points`, `max_aa_points`, `class`, `gender`, `char_id`, `status`, `item_id`, `prefix`, `suffix`, `title_set`) VALUES ('400', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '0', '-1', 'Master Artisan', '', '10'); |
Keeping with a format you're familiar with, rather than going with lists/arrays, given/when, ranges, etc. (i.e. using your example).
You may want to consider using elsif's, rather than if's, since every if will be called otherwise. You may be noticing that the titles are changed (you may not, since it will be relatively fast/instantaneous). Code:
sub EVENT_ENTERZONE { |
Here's my re-write, you can use it if you'd like:
Code:
sub EVENT_ENTERZONE { Code:
INSERT INTO `titles` VALUES ('400', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '0', '-1', 'Master Artisan', '', '10'), ('401', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '0', '-1', 'Expert Artisan', '', '9'), ('402', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '0', '-1', 'Journeyman Artisan', '', '8'), ('403', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '0', '-1', 'Apprentice Artisan', '', '7'); |
So titles that require more than is inherently supported in the database (e.g., class & level) are set on a per-zone basis. Guess that makes sense. It's not part of the player profile, I suppose.
Maybe at some point there'll be a char_titles table with one-time granted title unlocks per character instead. |
I just run the check on zone. I know lots of servers put titles on an NPC that you hail to get it or whatever, or even on connect, but I wanted something as transparent as possible.
|
I figured KK was going to give you the condensed/efficient method, which is cool.
Though, drop this into Notepad++, in a very quick effort (have to run) to explain somewhat of what is happening. More technically correct terminology can be found throughout the internet. I used as many layman's terms as I could, however, I have to admit, I'm so used to those terms anymore, I may have done more harm than good trying the plain English approach. This is for anyone not just the OP, for those perhaps scratching their heads, wondering "what is that %h all about, seem em before but I still dont 'get it'": Code:
sub EVENT_ENTERZONE { |
All times are GMT -4. The time now is 05:45 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.