Don't copy mounts to characters without sufficient riding skill#19
Conversation
| { | ||
| QueryResult result2 = CharacterDatabase.Query("SELECT `spell` FROM `character_spell` WHERE `guid`={};", i); | ||
| QueryResult result2 = CharacterDatabase.Query("SELECT character_spell.`spell` FROM `character_spell`" | ||
| "INNER JOIN `acore_world`.`item_template` it ON it.`RequiredSkill` = {} AND it.`RequiredSkillRank`<={} AND it.`spellid_2`=character_spell.`spell`" |
There was a problem hiding this comment.
I have no idea if this is the best way to handle the skill check. The spells themselves don't have a riding skill limitation so we need to go back to the item and cross reference the requirements needed to use the item that teaches the mount
The approach here also improves performance (A side effect and not the main goal of this pr) since we no longer have to loop through every single spell and can iterate over only the mounts
|
This works but the query is quite slow, we need to also add indexes on all the join fields. I'm not sure what the protocol is for modules adding indexes to AC. Adding Anyone got any better suggestions for fixing it? edit adding an index on |
Changes Proposed:
I don't know if something changed in azerothcore but today if a character learns the mount they can ride it. There is no check against riding skill when using the spell, only when learning it.
The result is that if you have a level 60 with a bunch of mounts then create a level 1 character on the same account, the mounts get copied to the level 1 character and the level 1 character can use them even if they don't have the sufficient riding skill to use the mount.
I can use a 100% mount at level 1 with this mod which breaks a fundamental game rule
Issues Addressed:
#18
Tests Performed:
Built and tested.