Jump to content
  • Announcements

    • Xmat

      Pravidlo pro postování v TTT

      Do sekce Tipy, triky, tutoriály nepatří žádné dotazy.   Postujte sem vaše návody, tipy a různé další věci jež uznáte za vhodné sdělit zdejšímu osazenstvu, ale veškeré dotazy směřujte do sekce Všeobecná diskuse.
    • Replik

      Seznam návodů a důležitých témat v této sekci

      Pro lepší přehlednost jsem vytvořil tento seznam, který vás, méně zkušené, lépe provede touto sekcí. Věřím, že zde najdete, co hledáte. Vypsané jsou návody, které jsou oficiálně uznané jako návody. Běžné diskuze, které neposkytují postupy a rady zvěřejněny nejsou.   Instalace vlastního MaNGOS Serveru Díky těmto návodům budete (měli by jste být) schopni vytvořit a následně spustit váš vlastní server. Nastavení je pro verze s i bez datadisku.   Instalace MaNGOS Serveru (bez datadisku TBC) - Autor Benny Instalace MaNGOS Serveru (s datadiskem TBC) - Autor Malfik Instalace MaNGOS Serveru v prostředí Linux - Autor charlie Instalace MaNGOS Serveru v prostředí Linux - Autor kupkoid   Chyby a jejich řešení při přihlašování k serveru - Autor Cybe   Zálohování uživatelských dat   Dávkový soubor (BAT soubor) pro vytvoření SQL záloh - Autor Replik   Kompilování - tvoření vlastních release (revizí)   Tvorba kompilací pro Win32 (MangoScript) - Autor bLuma   Ostatní - těžko zařaditelné, ale neznamená to, že nejsou dobré   VIP Systém - Autor charlie Tvorba Webových stránek pro MaNGOS - Autor zahuba Tvorba teleportačních NPC (MangoScript) - Autor Replik Registrační web (původně předělaná SPORA) Funkční pro Antrix i MaNGOS - Autor Replik Nastavení a spuštění Minimanager pro MaNGOS - Autor BlackMartin Nastavení MaNGOS Website - Autor Artorius   Samozřejmě jsou zde i jiné návody, ale tyto jsou nejvíce používané, proto věřím, že vám budou nápomocné. Tuto sekci budeme upravovat podle potřeby. Pokud by jste něco nenašli nebo si nevěděli rady, hledejte na fóru a teprve potom založte vlastní topik. Pokud nějaký autor vytvoří kvalitní návod a chtěl by ho zveřejnit i v tomto seznamu, doporučuji, aby mi napsal zprávu skrze PM.   Díky a přeji hezký den na WoWResource   Replik
    • Aristo

      Příspěvky tam, kde nemají co dělat

      Dodržujte zákaz přispívání do topiků s repaky pokud si to zakladatelé nepřejí!! Opakované psaní příspěvků bude trestáno warnem.
    • Aristo

      Používání spoilerů

      Poslední dobou má většina uživatelů fora zvláštní nutkání postovat extrémně dlouhé texty nebo kódy, které zabírají v nejedenom případu i 80% obsahu celé stránky a hodně tak zvedají nepřehlednost v topiku. Chtěl bych všechny uživatele požádat, aby při postování citací, jakýchkoliv kódů, errorů, atp... delších než 30 řádků používali funkci spoileru.   Funkci vyvoláte příkazem [spoiler] text [/spoiler]   Ukázka:  
Sign in to follow this  
lopitr

Ucitel profesi

Recommended Posts

Zdravím, tak tady mám další script.

 

NPC naučí hráče profese. Za VIP Itemy. Nebo Itemy ktere hráč získa při zabití npc.

NPC ma kontrolu proti zneuživání. V praxi to znamená že hlída kolik má hráč profesí aby nemohl podvádět.

 

Zde je script.

 

 

#include "ScriptPCH.h"

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

   bool OnGossipHello(Player *player, Creature *_creature)
   {

int pocet = 0;
if(player->HasSpell(3908)) pocet++;
if(player->HasSpell(8613)) pocet++;
if(player->HasSpell(2575)) pocet++;
if(player->HasSpell(2366)) pocet++;
if(player->HasSpell(2259)) pocet++;
if(player->HasSpell(2018)) pocet++;
if(player->HasSpell(4036)) pocet++;
if(player->HasSpell(7411)) pocet++;
if(player->HasSpell(25229)) pocet++;
if(player->HasSpell(2108)) pocet++;
if(player->HasSpell(45357)) pocet++;

       if (player->isInCombat())
       {
           player->CLOSE_GOSSIP_MENU();
           _creature->MonsterWhisper("Bohuzel, mas combat", player->GetGUID());
           return true;
       }
       else
       {
         if (pocet > 2){
         _creature->MonsterWhisper("Mas maximum profesi, bugovani se nekona!", player->GetGUID());
         }
         else{
                       player->SEND_GOSSIP_MENU(400000, _creature->GetGUID());
                        _creature->MonsterWhisper("Ahoj! Za poplatek 3 000 Archeron itemu te naucim libovolnou profesi na skill 450", player->GetGUID());
                        player->ADD_GOSSIP_ITEM( 3, "Profese"                    , GOSSIP_SENDER_MAIN, 8);

       }
       }

       player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());         
       return true;
   }

   bool OnGossipSelect(Player *player, Creature *_creature, uint32 sender, uint32 uiAction)
   {
       if (sender == GOSSIP_SENDER_MAIN)
       {
           player->PlayerTalkClass->ClearMenus();


           switch(uiAction)
           {

         case 8: //seznam profesi

               player->ADD_GOSSIP_ITEM(5, "Tailoring", GOSSIP_SENDER_MAIN, 9006);
               player->ADD_GOSSIP_ITEM(5, "Skinning", GOSSIP_SENDER_MAIN, 9007);
               player->ADD_GOSSIP_ITEM(5, "Mining", GOSSIP_SENDER_MAIN, 9008);
               player->ADD_GOSSIP_ITEM(5, "Herbalism", GOSSIP_SENDER_MAIN, 9009);
               player->ADD_GOSSIP_ITEM(5, "Alchemy", GOSSIP_SENDER_MAIN, 9011);
               player->ADD_GOSSIP_ITEM(5, "Blacksmithing", GOSSIP_SENDER_MAIN, 9012);
               player->ADD_GOSSIP_ITEM(5, "Engineering", GOSSIP_SENDER_MAIN, 9013);
               player->ADD_GOSSIP_ITEM(5, "Enchanting", GOSSIP_SENDER_MAIN, 9014);
               player->ADD_GOSSIP_ITEM(5, "Jewelcrafting", GOSSIP_SENDER_MAIN, 9015);
               player->ADD_GOSSIP_ITEM(5, "Leatherworking", GOSSIP_SENDER_MAIN, 9016);
               player->ADD_GOSSIP_ITEM(5, "Inscription", GOSSIP_SENDER_MAIN, 9017);


               player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());

     break;

case 9006://Tailoring
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (51309,false);
       player->UpdateSkill (197, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();

break;

case 9007://Skinning
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (50305,false);
       player->UpdateSkill (393, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
break;

case 9008://Mining
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (50310,false);
       player->UpdateSkill (186, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
   break;


case 9009://Herbalism
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (50300,false);
       player->UpdateSkill (182, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
break;


case 9011://Alchemy
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (51304,false);
       player->UpdateSkill (171, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
break;

case 9012://Blacksmithing
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (51300,false);
       player->UpdateSkill (164, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
break;

case 9013://Engineering
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (51306,false);
       player->UpdateSkill (202, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
break;

case 9014://Enchanting
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (51313,false);
       player->UpdateSkill (333, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
break;

case 9015://Jewelcrafting
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (51311,false);
       player->UpdateSkill (755, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
break;

case 9016://Leatherworking
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (51302,false);
       player->UpdateSkill (165, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
break;

case 9017://Inscription
      if (player->HasItemCount( 985000, 3000, false )){

       player->DestroyItemCount(985000, 3000, true, false);
       player->learnSpell (45363,false);
       player->UpdateSkill (773, 450);
      }
      else{
       _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
      }


       player->CLOSE_GOSSIP_MENU();
break;

            default:
       break;                   

  }
  }
 return true;
}
};

void AddSC_npc_proff()
{
   new npc_proff();
}   

 

 

 

 

Pro Funkcnost si budete muset vytvorit vlastni item .

 

a nebo prepisovat tyhle radky


      if (player->HasItemCount( Vase ID itemu, Pocet, false )){         // True, nebo False? Pokud se nepletu Tru hleda jestli ma item i v bance, a false ne.

Edited by lopitr
  • Upvote 3

Share this post


Link to post
Share on other sites

Žádám o přesunutí tématu do "scripting". Příště to správně zařazuj. OK :)

 

Script je špatně formátovaný, na konci ti chybí středník (pravděpodobně chyba při vkládání) a dá se to napsat líp. Používej funkce.

 

EDIT: ID itemu jsi mohl definovat a použít definici. Je to paráda pak přepisovat, když si to někdo bude chtít upravit. (ironie)

Edited by Wolf Officious

Share this post


Link to post
Share on other sites

Opravene, vazne chyba pri prepisovani.

A predefinuji to.

 

A to presunuti o to jsem chtel zadat ale nevidim tu zadneho moderatora, Tak prosim jestli budete mit chvilku.

Share this post


Link to post
Share on other sites

Trochu jsem to upravil. Ve hře to testovat nebudu, funkci by to mělo mít stejnou.. :D

 

 

#include "ScriptPCH.h"

#define VIP_ITEM_ENTRY  985000  // ID itemu, ktery je potreba k nauceni profese
#define VIP_ITEM_COUNT  3000    // Pocet itemu, ktere jsou potreba...

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

   inline void LearnSkillByScript(Player *player, Creature *_creature, uint32 iSpellToLearn, uint32 iSkillToUpdate)
   {
       if (player->HasItemCount(VIP_ITEM_ENTRY, VIP_ITEM_COUNT, false))
       {
           player->DestroyItemCount(VIP_ITEM_ENTRY, VIP_ITEM_COUNT, true, false);
           player->learnSpell(iSpellToLearn, false);
           player->UpdateSkill(iSkillToUpdate, 450);
       }
       else
       {
           _creature->MonsterWhisper("Nemas dostatek Archeron itemu", player->GetGUID());
       }
       player->CLOSE_GOSSIP_MENU();
   }

   inline bool ProfesionCountCheck(Player *player) // Vraci BOOL: TRUE = pohoda; FALSE = hrac neprosel kontrolou.
   {
       int iSpellCount = 0; 
       uint32 uIdSpellu[11] = {3908, 8613, 2575, 2366, 2259, 2018, 4036, 7411, 25229, 2108, 45357};
       //                         0     1     2     3     4     5     6     7      8     9     10
       for(int i = 0; i < 11; i++)
       {
           if(player->HasSpell(uIdSpellu[i])) iSpellCount++;
       }

       if(iSpellCount > 2)
           return false;
       else
           return true;
   }

   bool OnGossipHello(Player *player, Creature *_creature)
   {
       if (player->isInCombat())
       {
           player->CLOSE_GOSSIP_MENU();
           _creature->MonsterWhisper("Bohuzel, mas combat", player->GetGUID());
           return true;
       }

       if (!ProfesionCountCheck(player))
       {
           player->CLOSE_GOSSIP_MENU();
           _creature->MonsterWhisper("Mas maximum profesi, bugovani se nekona!", player->GetGUID());
           return true;
       }

       player->SEND_GOSSIP_MENU(400000, _creature->GetGUID());
       _creature->MonsterWhisper("Ahoj! Za poplatek 3000 Archeron itemu te naucim libovolnou profesi na skill 450", player->GetGUID());
       player->ADD_GOSSIP_ITEM( 3, "Profese",          GOSSIP_SENDER_MAIN, 8);
       player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());

       return true;
   }

   bool OnGossipSelect(Player *player, Creature *_creature, uint32 sender, uint32 uiAction)
   {
       if (sender == GOSSIP_SENDER_MAIN)
       {
           player->PlayerTalkClass->ClearMenus();

           switch(uiAction)
           {
           case 8: //Profesions
               player->ADD_GOSSIP_ITEM(5, "Tailoring",         GOSSIP_SENDER_MAIN, 9006);
               player->ADD_GOSSIP_ITEM(5, "Skinning",          GOSSIP_SENDER_MAIN, 9007);
               player->ADD_GOSSIP_ITEM(5, "Mining",            GOSSIP_SENDER_MAIN, 9008);
               player->ADD_GOSSIP_ITEM(5, "Herbalism",         GOSSIP_SENDER_MAIN, 9009);
               player->ADD_GOSSIP_ITEM(5, "Alchemy",           GOSSIP_SENDER_MAIN, 9011);
               player->ADD_GOSSIP_ITEM(5, "Blacksmithing",     GOSSIP_SENDER_MAIN, 9012);
               player->ADD_GOSSIP_ITEM(5, "Engineering",       GOSSIP_SENDER_MAIN, 9013);
               player->ADD_GOSSIP_ITEM(5, "Enchanting",        GOSSIP_SENDER_MAIN, 9014);
               player->ADD_GOSSIP_ITEM(5, "Jewelcrafting",     GOSSIP_SENDER_MAIN, 9015);
               player->ADD_GOSSIP_ITEM(5, "Leatherworking",    GOSSIP_SENDER_MAIN, 9016);
               player->ADD_GOSSIP_ITEM(5, "Inscription",       GOSSIP_SENDER_MAIN, 9017);
               player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
               break;
           case 9006://Tailoring
               LearnSkillByScript(player, _creature, 51309, 197);
               break;
           case 9007://Skinning
               LearnSkillByScript(player, _creature, 50305, 393);
               break;
           case 9008://Mining
               LearnSkillByScript(player, _creature, 50310, 186);
               break; 
           case 9009://Herbalism
               LearnSkillByScript(player, _creature, 50300, 182);
               break;
           case 9011://Alchemy
               LearnSkillByScript(player, _creature, 51304, 171);
               break;
           case 9012://Blacksmithing
               LearnSkillByScript(player, _creature, 51300, 164);
               break;
           case 9013://Engineering
               LearnSkillByScript(player, _creature, 51306, 202);
               break;
           case 9014://Enchanting
               LearnSkillByScript(player, _creature, 51313, 333);
               break;
           case 9015://Jewelcrafting
               LearnSkillByScript(player, _creature, 51311, 755);
               break;
           case 9016://Leatherworking
               LearnSkillByScript(player, _creature, 51302, 165);
               break;
           case 9017://Inscription
               LearnSkillByScript(player, _creature, 45363, 773);
               break;
           default:
               break;
           }
       }
       return true;
   }
};  // END OF class npc_proff

void AddSC_npc_proff()
{
   new npc_proff();
}

 

 

Možná to ještě trochu vychytám.. :D

Edited by Wolf Officious
  • Upvote 2

Share this post


Link to post
Share on other sites

rozdil mezi amaterem a profesionalem vidite to ? :D

 

Jinak vazne pekna prace, a funguje jak ma :)

Edited by lopitr

Share this post


Link to post
Share on other sites

nevite nekdo jak odstranit ty marky ?:) a jestli by stoho sle udelat unierzalni trainer po malých upravach?:) jinak + rep :) i wolfovi

Share this post


Link to post
Share on other sites

 

#include "ScriptPCH.h"

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

   inline void LearnSkillByScript(Player *player, Creature *_creature, uint32 iSpellToLearn, uint32 iSkillToUpdate)
   {
       player->learnSpell(iSpellToLearn, false);
       player->UpdateSkill(iSkillToUpdate, 450);
   }

   inline bool ProfesionCountCheck(Player *player) // Vraci BOOL: TRUE = pohoda; FALSE = hrac neprosel kontrolou.
   {
       int iSpellCount = 0; 
       uint32 uIdSpellu[11] = {3908, 8613, 2575, 2366, 2259, 2018, 4036, 7411, 25229, 2108, 45357};
       //                         0     1     2     3     4     5     6     7      8     9     10
       for(int i = 0; i < 11; i++)
       {
           if(player->HasSpell(uIdSpellu[i]))
               iSpellCount++;
       }

       if(iSpellCount > 2)
           return false;
       else
           return true;
   }

   bool OnGossipHello(Player *player, Creature *_creature)
   {
       if (player->isInCombat())
       {
           player->CLOSE_GOSSIP_MENU();
           _creature->MonsterWhisper("Bohuzel, mas combat", player->GetGUID());
           return true;
       }

       if (!ProfesionCountCheck(player))
       {
           player->CLOSE_GOSSIP_MENU();
           _creature->MonsterWhisper("Mas maximum profesi, bugovani se nekona!", player->GetGUID());
           return true;
       }

       player->ADD_GOSSIP_ITEM(5, "Tailoring",         GOSSIP_SENDER_MAIN, 9006);
       player->ADD_GOSSIP_ITEM(5, "Skinning",          GOSSIP_SENDER_MAIN, 9007);
       player->ADD_GOSSIP_ITEM(5, "Mining",            GOSSIP_SENDER_MAIN, 9008);
       player->ADD_GOSSIP_ITEM(5, "Herbalism",         GOSSIP_SENDER_MAIN, 9009);
       player->ADD_GOSSIP_ITEM(5, "Alchemy",           GOSSIP_SENDER_MAIN, 9011);
       player->ADD_GOSSIP_ITEM(5, "Blacksmithing",     GOSSIP_SENDER_MAIN, 9012);
       player->ADD_GOSSIP_ITEM(5, "Engineering",       GOSSIP_SENDER_MAIN, 9013);
       player->ADD_GOSSIP_ITEM(5, "Enchanting",        GOSSIP_SENDER_MAIN, 9014);
       player->ADD_GOSSIP_ITEM(5, "Jewelcrafting",     GOSSIP_SENDER_MAIN, 9015);
       player->ADD_GOSSIP_ITEM(5, "Leatherworking",    GOSSIP_SENDER_MAIN, 9016);
       player->ADD_GOSSIP_ITEM(5, "Inscription",       GOSSIP_SENDER_MAIN, 9017);
       player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());

       return true;
   }

   bool OnGossipSelect(Player *player, Creature *_creature, uint32 sender, uint32 uiAction)
   {
       if (sender != GOSSIP_SENDER_MAIN)
       {
           player->CLOSE_GOSSIP_MENU();
           return true;
       }

       player->PlayerTalkClass->ClearMenus();

       switch(uiAction)
       {
       case 9006://Tailoring
           LearnSkillByScript(player, _creature, 51309, 197);
           break;
       case 9007://Skinning
           LearnSkillByScript(player, _creature, 50305, 393);
           break;
       case 9008://Mining
           LearnSkillByScript(player, _creature, 50310, 186);
           break; 
       case 9009://Herbalism
           LearnSkillByScript(player, _creature, 50300, 182);
           break;
       case 9011://Alchemy
           LearnSkillByScript(player, _creature, 51304, 171);
           break;
       case 9012://Blacksmithing
           LearnSkillByScript(player, _creature, 51300, 164);
           break;
       case 9013://Engineering
           LearnSkillByScript(player, _creature, 51306, 202);
           break;
       case 9014://Enchanting
           LearnSkillByScript(player, _creature, 51313, 333);
           break;
       case 9015://Jewelcrafting
           LearnSkillByScript(player, _creature, 51311, 755);
           break;
       case 9016://Leatherworking
           LearnSkillByScript(player, _creature, 51302, 165);
           break;
       case 9017://Inscription
           LearnSkillByScript(player, _creature, 45363, 773);
           break;
       default:
           break;
       }

       player->CLOSE_GOSSIP_MENU();

       return true;
   }
};  // END OF class npc_proff

void AddSC_npc_proff()
{
   new npc_proff();
}

 

 

Univerzální trainer? Nevím jak to myslíš. Jde třeba zařídit hromadný naučení všech spellů a receptů který k profesi patří.

Edited by Wolf Officious
  • Upvote 2

Share this post


Link to post
Share on other sites

 

#include "ScriptPCH.h"

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

   inline void LearnSkillByScript(Player *player, Creature *_creature, uint32 iSpellToLearn, uint32 iSkillToUpdate)
   {
       player->learnSpell(iSpellToLearn, false);
       player->UpdateSkill(iSkillToUpdate, 450);
   }

   inline bool ProfesionCountCheck(Player *player) // Vraci BOOL: TRUE = pohoda; FALSE = hrac neprosel kontrolou.
   {
       int iSpellCount = 0; 
       uint32 uIdSpellu[11] = {3908, 8613, 2575, 2366, 2259, 2018, 4036, 7411, 25229, 2108, 45357};
       //                     	0 	1 	2 	3 	4 	5 	6 	7      8 	9 	10
       for(int i = 0; i < 11; i++)
       {
           if(player->HasSpell(uIdSpellu[i]))
               iSpellCount++;
       }

       if(iSpellCount > 2)
           return false;
       else
           return true;
   }

   bool OnGossipHello(Player *player, Creature *_creature)
   {
       if (player->isInCombat())
       {
           player->CLOSE_GOSSIP_MENU();
           _creature->MonsterWhisper("Bohuzel, mas combat", player->GetGUID());
           return true;
       }

       if (!ProfesionCountCheck(player))
       {
           player->CLOSE_GOSSIP_MENU();
           _creature->MonsterWhisper("Mas maximum profesi, bugovani se nekona!", player->GetGUID());
           return true;
       }

       player->ADD_GOSSIP_ITEM(5, "Tailoring",     	GOSSIP_SENDER_MAIN, 9006);
       player->ADD_GOSSIP_ITEM(5, "Skinning",          GOSSIP_SENDER_MAIN, 9007);
       player->ADD_GOSSIP_ITEM(5, "Mining",            GOSSIP_SENDER_MAIN, 9008);
       player->ADD_GOSSIP_ITEM(5, "Herbalism",     	GOSSIP_SENDER_MAIN, 9009);
       player->ADD_GOSSIP_ITEM(5, "Alchemy",       	GOSSIP_SENDER_MAIN, 9011);
       player->ADD_GOSSIP_ITEM(5, "Blacksmithing", 	GOSSIP_SENDER_MAIN, 9012);
       player->ADD_GOSSIP_ITEM(5, "Engineering",   	GOSSIP_SENDER_MAIN, 9013);
       player->ADD_GOSSIP_ITEM(5, "Enchanting",        GOSSIP_SENDER_MAIN, 9014);
       player->ADD_GOSSIP_ITEM(5, "Jewelcrafting", 	GOSSIP_SENDER_MAIN, 9015);
       player->ADD_GOSSIP_ITEM(5, "Leatherworking",    GOSSIP_SENDER_MAIN, 9016);
       player->ADD_GOSSIP_ITEM(5, "Inscription",   	GOSSIP_SENDER_MAIN, 9017);
       player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());

       return true;
   }

   bool OnGossipSelect(Player *player, Creature *_creature, uint32 sender, uint32 uiAction)
   {
       if (sender != GOSSIP_SENDER_MAIN)
       {
           player->CLOSE_GOSSIP_MENU();
           return true;
       }

       player->PlayerTalkClass->ClearMenus();

       switch(uiAction)
       {
       case 9006://Tailoring
           LearnSkillByScript(player, _creature, 51309, 197);
           break;
       case 9007://Skinning
           LearnSkillByScript(player, _creature, 50305, 393);
           break;
       case 9008://Mining
           LearnSkillByScript(player, _creature, 50310, 186);
           break; 
       case 9009://Herbalism
           LearnSkillByScript(player, _creature, 50300, 182);
           break;
       case 9011://Alchemy
           LearnSkillByScript(player, _creature, 51304, 171);
           break;
       case 9012://Blacksmithing
           LearnSkillByScript(player, _creature, 51300, 164);
           break;
       case 9013://Engineering
           LearnSkillByScript(player, _creature, 51306, 202);
           break;
       case 9014://Enchanting
           LearnSkillByScript(player, _creature, 51313, 333);
           break;
       case 9015://Jewelcrafting
           LearnSkillByScript(player, _creature, 51311, 755);
           break;
       case 9016://Leatherworking
           LearnSkillByScript(player, _creature, 51302, 165);
           break;
       case 9017://Inscription
           LearnSkillByScript(player, _creature, 45363, 773);
           break;
       default:
           break;
       }

       player->CLOSE_GOSSIP_MENU();

       return true;
   }
};  // END OF class npc_proff

void AddSC_npc_proff()
{
   new npc_proff();
}

 

 

Univerzální trainer? Nevím jak to myslíš. Jde třeba zařídit hromadný naučení všech spellů a receptů který k profesi patří.

 

no ja ro myslel tak ze jak mas to tailoring atd tak misto toho dat warrior ,priest a nauci lo by to kazdyho tu jednu class ale ne aby se warrior naucil od priesta ale jinak +rep

Share this post


Link to post
Share on other sites

Wolf pls mohol by si do toho bez mariek pls hodiť aj všetky spelly a recepty ...

Dík :rolleyes:

Edited by SkullCrack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×