mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 17:09:08 +00:00
FixListSpellsWithCache (#1931)
This is based off of Wishmasters rewrite of spell PR. #1912 and #1843, and partial #1918 I created a new cache singleton with the required code to reference as needed. I clarified some variable names for additional clarity in how they functioned. This requires a wiki update to better describe the functionality that was already defined in code. Commands Spells - Returns all spells Spells <Profession> Returns only the spells in that profession +<profession> Returns only the recipies that the bot has materials to craft <profession> `x - y` Craftable items within those levels <profession> <slot> e.g. Chest, returns craftable items within that slot. Its messy whether what combinations work for commands, but fixing that will come when bot professions are enabled. Edit: To test you can teach a bot various professions by going to a trainer with them. Using gm command .setskill you increase their skill level and with maintenance teach the commands. From wishmasters PR he detailed various commands to test spells spells first aid spells tailoring spells 20-40 spells +tailoring spells head --------- Co-authored-by: Wishmaster117 <140754794+Wishmaster117@users.noreply.github.com>
This commit is contained in:
34
src/database/PlayerbotSpellCache.h
Normal file
34
src/database/PlayerbotSpellCache.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_PLAYERBOTSPELLCACHE_H
|
||||
#define _PLAYERBOT_PLAYERBOTSPELLCACHE_H
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
class PlayerbotSpellCache
|
||||
{
|
||||
public:
|
||||
static PlayerbotSpellCache* Instance()
|
||||
{
|
||||
static PlayerbotSpellCache instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
void Initialize(); // call once on startup
|
||||
|
||||
SkillLineAbilityEntry const* GetSkillLine(uint32 spellId) const;
|
||||
bool IsItemBuyable(uint32 itemId) const;
|
||||
|
||||
private:
|
||||
PlayerbotSpellCache() = default;
|
||||
|
||||
std::map<uint32, SkillLineAbilityEntry const*> skillSpells;
|
||||
std::set<uint32> vendorItems;
|
||||
};
|
||||
|
||||
#define sPlayerbotSpellCache PlayerbotSpellCache::Instance()
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user