Simple script which checks the players class and lists only glyphs avalible for that class. All in one, no need for 10 vendors!



This script requires the Multivendor script from Rochet to work. And Glyph vendors, I've used the vendors from Triforce Mall v3.6.



NPC SQL
Code:
INSERT INTO `creature_template` VALUES (41000, 0, 0, 0, 0, 0, 28190, 0, 0, 0, 'Glyph Vendor', 'Fanatic-wow', '', 0, 80, 80, 0, 35, 35, 133, 1, 1, 1.1, 0, 600, 900, 0, 1000, 100, 1500, 1500, 1, 2, 0, 0, 0, 0, 0, 0, 0, 480, 750, 1000, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 100, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 'glyph_vendor', 12340);
Npc_vendor Glyphs
Code:
INSERT INTO `npc_vendor` (`entry`,`item`) VALUES 
('500026','43533'),
('500026','43534'),
('500026','43535'),
('500026','43536'),
('500026','43537'),
('500026','43538'),
('500026','43539'),
('500026','43541'),
('500026','43542'),
('500026','43543'),
('500026','43544'),
('500026','43545'),
('500026','43546'),
('500026','43547'),
('500026','43548'),
('500026','43549'),
('500026','43550'),
('500026','43551'),
('500026','43552'),
('500026','43553'),
('500026','43554'),
('500026','43671'),
('500026','43672'),
('500026','43673'),
('500026','43825'),
('500026','43826'),
('500026','43827'),
('500026','45799'),
('500026','45800'),
('500026','45803'),
('500026','45804'),
('500026','45805'),
('500026','45806'),
('500027','40896'),
('500027','40897'),
('500027','40899'),
('500027','40900'),
('500027','40901'),
('500027','40902'),
('500027','40903'),
('500027','40906'),
('500027','40908'),
('500027','40909'),
('500027','40912'),
('500027','40913'),
('500027','40914'),
('500027','40915'),
('500027','40916'),
('500027','40919'),
('500027','40920'),
('500027','40921'),
('500027','40922'),
('500027','40923'),
('500027','40924'),
('500027','43316'),
('500027','43331'),
('500027','43332'),
('500027','43334'),
('500027','43335'),
('500027','43674'),
('500027','44922'),
('500027','44928'),
('500027','45601'),
('500027','45602'),
('500027','45603'),
('500027','45604'),
('500027','45622'),
('500027','45623'),
('500027','46372'),
('500027','48720'),
('500027','50125'),
('500046','42897'),
('500046','42898'),
('500046','42899'),
('500046','42900'),
('500046','42901'),
('500046','42902'),
('500046','42903'),
('500046','42904'),
('500046','42905'),
('500046','42906'),
('500046','42907'),
('500046','42908'),
('500046','42909'),
('500046','42910'),
('500046','42911'),
('500046','42912'),
('500046','42913'),
('500046','42914'),
('500046','42915'),
('500046','42916'),
('500046','42917'),
('500046','43338'),
('500046','43350'),
('500046','43351'),
('500046','43354'),
('500046','43355'),
('500046','43356'),
('500046','45625'),
('500046','45731'),
('500046','45732'),
('500046','45733'),
('500046','45734'),
('500046','45735'),
('500057','42734'),
('500057','42735'),
('500057','42736'),
('500057','42737'),
('500057','42738'),
('500057','42739'),
('500057','42740'),
('500057','42741'),
('500057','42742'),
('500057','42743'),
('500057','42744'),
('500057','42745'),
('500057','42746'),
('500057','42747'),
('500057','42748'),
('500057','42749'),
('500057','42750'),
('500057','42751'),
('500057','42752'),
('500057','42753'),
('500057','42754'),
('500057','43339'),
('500057','43357'),
('500057','43359'),
('500057','43360'),
('500057','43361'),
('500057','43364'),
('500057','44684'),
('500057','44920'),
('500057','44955'),
('500057','45736'),
('500057','45737'),
('500057','45738'),
('500057','45739'),
('500057','45740'),
('500057','50045'),
('500068','41092'),
('500068','41094'),
('500068','41095'),
('500068','41096'),
('500068','41097'),
('500068','41098'),
('500068','41099'),
('500068','41100'),
('500068','41101'),
('500068','41102'),
('500068','41103'),
('500068','41104'),
('500068','41105'),
('500068','41106'),
('500068','41107'),
('500068','41108'),
('500068','41109'),
('500068','41110'),
('500068','43340'),
('500068','43365'),
('500068','43366'),
('500068','43367'),
('500068','43368'),
('500068','43369'),
('500068','43867'),
('500068','43868'),
('500068','43869'),
('500068','45741'),
('500068','45742'),
('500068','45743'),
('500068','45744'),
('500068','45745'),
('500068','45746'),
('500068','45747'),
('500095','42954'),
('500095','42955'),
('500095','42956'),
('500095','42957'),
('500095','42958'),
('500095','42959'),
('500095','42960'),
('500095','42961'),
('500095','42962'),
('500095','42963'),
('500095','42964'),
('500095','42965'),
('500095','42966'),
('500095','42967'),
('500095','42968'),
('500095','42969'),
('500095','42970'),
('500095','42971'),
('500095','42972'),
('500095','42973'),
('500095','42974'),
('500095','43343'),
('500095','43376'),
('500095','43377'),
('500095','43378'),
('500095','43379'),
('500095','43380'),
('500095','45761'),
('500095','45762'),
('500095','45764'),
('500095','45766'),
('500095','45767'),
('500095','45768'),
('500095','45769'),
('500097','41517'),
('500097','41518'),
('500097','41524'),
('500097','41526'),
('500097','41527'),
('500097','41529'),
('500097','41530'),
('500097','41531'),
('500097','41532'),
('500097','41533'),
('500097','41534'),
('500097','41535'),
('500097','41536'),
('500097','41537'),
('500097','41538'),
('500097','41539'),
('500097','41540'),
('500097','41541'),
('500097','41542'),
('500097','41547'),
('500097','41552'),
('500097','43344'),
('500097','43381'),
('500097','43385'),
('500097','43386'),
('500097','43388'),
('500097','43725'),
('500097','44923'),
('500097','45770'),
('500097','45771'),
('500097','45772'),
('500097','45775'),
('500097','45776'),
('500097','45777'),
('500097','45778'),
('500110','42453'),
('500110','42454'),
('500110','42455'),
('500110','42456'),
('500110','42457'),
('500110','42458'),
('500110','42459'),
('500110','42460'),
('500110','42461'),
('500110','42462'),
('500110','42463'),
('500110','42464'),
('500110','42465'),
('500110','42466'),
('500110','42467'),
('500110','42468'),
('500110','42469'),
('500110','42470'),
('500110','42471'),
('500110','42472'),
('500110','42473'),
('500110','43389'),
('500110','43390'),
('500110','43391'),
('500110','43392'),
('500110','43393'),
('500110','43394'),
('500110','45779'),
('500110','45780'),
('500110','45781'),
('500110','45782'),
('500110','45783'),
('500110','45785'),
('500110','45789'),
('500110','50077'),
('500111','43395'),
('500111','43396'),
('500111','43397'),
('500111','43398'),
('500111','43399'),
('500111','43400'),
('500111','43412'),
('500111','43413'),
('500111','43414'),
('500111','43415'),
('500111','43416'),
('500111','43417'),
('500111','43418'),
('500111','43419'),
('500111','43420'),
('500111','43421'),
('500111','43422'),
('500111','43423'),
('500111','43424'),
('500111','43425'),
('500111','43426'),
('500111','43427'),
('500111','43428'),
('500111','43429'),
('500111','43430'),
('500111','43431'),
('500111','43432'),
('500111','45790'),
('500111','45792'),
('500111','45793'),
('500111','45794'),
('500111','45795'),
('500111','45797'),
('500111','49084'),
('500113','42396'),
('500113','42397'),
('500113','42398'),
('500113','42399'),
('500113','42400'),
('500113','42401'),
('500113','42402'),
('500113','42403'),
('500113','42404'),
('500113','42405'),
('500113','42406'),
('500113','42407'),
('500113','42408'),
('500113','42409'),
('500113','42410'),
('500113','42411'),
('500113','42412'),
('500113','42414'),
('500113','42415'),
('500113','42416'),
('500113','42417'),
('500113','43342'),
('500113','43370'),
('500113','43371'),
('500113','43372'),
('500113','43373'),
('500113','43374'),
('500113','45753'),
('500113','45755'),
('500113','45756'),
('500113','45757'),
('500113','45758'),
('500113','45760');
Script
Code:
/*
Made by Tatsu. 
Edited and optimized by Zxtreme.
Please include credits if shared.
Fanatic-wow.com
*/
#include "ScriptPCH.h"

class glyph_vendor : public CreatureScript 
{
    public: glyph_vendor() : CreatureScript("glyph_vendor") {}

    bool OnGossipHello(Player* player, Creature* creature) 
    {
        if (player->getClass() == CLASS_WARRIOR)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Warrior", GOSSIP_SENDER_MAIN, 500111);

        if (player->getClass() == CLASS_PALADIN)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Paladin", GOSSIP_SENDER_MAIN, 500068);

        if (player->getClass() == CLASS_DEATH_KNIGHT)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Death Knight", GOSSIP_SENDER_MAIN, 500026);

        if (player->getClass() == CLASS_HUNTER)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Hunter", GOSSIP_SENDER_MAIN, 500046);

        if (player->getClass() == CLASS_SHAMAN)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Shaman", GOSSIP_SENDER_MAIN, 500097);

        if (player->getClass() == CLASS_ROGUE)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Rogue", GOSSIP_SENDER_MAIN, 500095);

        if (player->getClass() == CLASS_DRUID)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Druid", GOSSIP_SENDER_MAIN, 500027);

        if (player->getClass() == CLASS_MAGE)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Mage", GOSSIP_SENDER_MAIN, 500057);

        if (player->getClass() == CLASS_PRIEST)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Priest", GOSSIP_SENDER_MAIN, 500113);

        if (player->getClass() == CLASS_WARLOCK)
        player->ADD_GOSSIP_ITEM(6, "Glyphs Warlock", GOSSIP_SENDER_MAIN, 500110);

        player->SEND_GOSSIP_MENU(60000, creature->GetGUID());
        return true;
    }

    bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 uiActions) 
    {
        player->PlayerTalkClass->ClearMenus();
        player->GetSession()->SendListInventory(creature->GetGUID(), uiActions);
        return true;
    }
};

void AddSC_glyph_vendor()
{
    new glyph_vendor;
}
Also works for other vendors. Just replace the creature entry(500111) with your own custom entry.


Credits Tatsu


› See More: [C++/SQL] All in one Glyph Vendor.