![]() |
|
#17
|
||||
|
Quote:
But then even if a zone/level is mapped, if it's a multi-level zone, and the mob is not on the first/ground floor, the mob's loc needs to say what level it's on: otherwise the wiki will assume the mob is on the first floor. I tried to write the code to be as accommodating as possible and work with any reasonable language wiki editors might use, so (for instance) you can say "0th level" or "basement" or "underground": Code:
if (containsAnyNumber(text, 0, 'th') || containsAny(text, 'basement', 'underground', 'tunnel')) return levels[0];
if (containsAnyNumber(text, 1, 'st') || containsAny(text, 'one', 'first', 'ground')) return levels[1];
if (containsAnyNumber(text, 2, 'nd') || containsAny(text, 'two', 'second')) return levels[2];
if (containsAnyNumber(text, 3, 'rd') || containsAny(text, 'three', 'third')) return levels[3];
if (containsAnyNumber(text, 4, 'th') || containsAny(text, 'four', 'fourth')) return levels[4];
if (containsAnyNumber(text, 5, 'th') || containsAny(text, 'five', 'fifth')) return levels[5];
if (containsAnyNumber(text, 6, 'th') || containsAny(text, 'six', 'sixth')) return levels[6];
if (containsAnyNumber(text, 7, 'th') || containsAny(text, 'seven', 'seventh')) return levels[7];
if (containsAnyNumber(text, 8, 'th') || containsAny(text, 'eight', 'eighth')) return levels[8];
if (containsAnyNumber(text, 9, 'th') || containsAny(text, 'nine', 'ninth')) return levels[9];
Instead, I opted to assume every mob was on the first level, but then that leaves mobs on 2nd+ floor showing up wrong ... until someone adds their level to their loc. Since the ultimate goal is to get every mob's level in their loc, so that you can see where every mob is, and since defaulting to level 1 lets lots of mobs work without extra editing, I figured that was worth the cost of some 2nd+ level mobs showing a misleading "X" (in a way that's a "feature" that encourages wiki editors to add levels to mob's locs [You must be logged in to view images. Log in or Register.]). But it does have a cost (of some mobs showing up wrong), so I admit it's not perfect and I'm open to suggestions.
__________________
Loramin Frostseer <Anonymous>, Hetch<Anonymous>, Tecla <Kingdom>, ... Check out the "Where To Go For XP/For Treasure?" Guides Anyone can improve the wiki! If you are new to the Blue or Green servers, you can improve the wiki to earn a "welcome package" of platinum and/or gear! Send me a forum message for details. | |||
|
|
||||
|
|