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  
Hkarta

[BG/Arena Tournament] Beastmaster NPC

Recommended Posts

2 Pacient: Deff je v pohodě, jen se po přechodu na novej patch (kterej jsem provedl tak nějak omylem, nevšiml jsem si přechodu a pak už se mi to nechtělo vracet) dodrbalo pár spellů. A ty už pomalu zase začínaj fungovat.

Share this post


Link to post
Share on other sites

Nechcem Off topic..ale toto musím napísať.

Keď si odišiel..server ešte išiel v poho..ale patche a všetko možné sa proste zastavilo server iba

bez teba stagnuje..Ako kedyže ty nerobíš pre deff toľko tak stoho nie je taký server ako je! ako nič proti Mara-ovi ..ale

ten nevie nič!..a že Realm admin..

Share this post


Link to post
Share on other sites

Máš tam 2x #include <cstring>

 

EDIT: +REP, to je jasný ;)

 

EDIT2: Dovolil jsem si to upravit pro TC rev. 8848 (či-li na poslední revizi pro patch 3.3.3a)

 

Upravil jsem jeden include (ScriptedPch.h zaměněno za ScriptPCH.h) a způsob výpisu chyby do logu (použití sLog.outError místo error_log). Dále jsem pak trochu upravil strukturu kódu. :D

 

 

#include "ScriptPCH.h"
#include "ScriptMgr.h"
#include <cstring>
#include "Pet.h"
#include "Formulas.h"

void CreatePet( Player *player, Creature * m_creature, uint32 entry )
{
   if(player->getClass() != CLASS_HUNTER)
   {
       m_creature->MonsterWhisper("You are not hunter! Your order have been rejected.", player->GetGUID());
       player->PlayerTalkClass->CloseGossip();
       return;
   }

   if(player->GetPet())
   {
       m_creature->MonsterWhisper("First you must drop your pet!", player->GetGUID());
       player->PlayerTalkClass->CloseGossip();
       return;
   }

   Creature *creatureTarget = m_creature->SummonCreature(entry, player->GetPositionX(), player->GetPositionY()+2, player->GetPositionZ(), player->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 500);

   if(!creatureTarget)
       return;

   Pet* pet = player->CreateTamedPetFrom(creatureTarget, 0);

   if(!pet)
       return;

   creatureTarget->setDeathState(JUST_DIED);
   creatureTarget->RemoveCorpse();
   creatureTarget->SetHealth(0);
   pet->SetPower(POWER_HAPPINESS, 1048000);
   pet->SetUInt32Value(UNIT_FIELD_LEVEL, 79);
   pet->GetMap()->Add((Creature*)pet);
   pet->SetUInt32Value(UNIT_FIELD_LEVEL, 80);

   if(!pet->InitStatsForLevel(80))
       sLog.outError("Pet Create fail: no init stats for entry %u", entry);

   pet->UpdateAllStats();
   player->SetMinion(pet, true);
   pet->SavePetToDB(PET_SAVE_AS_CURRENT);
   pet->InitTalentForLevel();
   player->PetSpellInitialize();
   player->PlayerTalkClass->CloseGossip();
   m_creature->MonsterWhisper("Pet added. You might want to feed it and name it somehow.", player->GetGUID());
}

bool GossipHello_at_beastmaster( Player *player, Creature *_Creature )
{
   if(player->getClass() != CLASS_HUNTER)
   {
       _Creature->MonsterWhisper("You are not hunter!", player->GetGUID());
       return true;
   }

   player->ADD_GOSSIP_ITEM(4, "Get new pet", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 30);

   if (player->CanTameExoticPets())
   {
       player->ADD_GOSSIP_ITEM(4, "Get new exotic pet", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 50);
   }

   player->ADD_GOSSIP_ITEM(2, "Take me to stable", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_STABLEPET);
   player->ADD_GOSSIP_ITEM(6, "Sell me some food", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR);
   player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());

   return true;
}

bool GossipSelect_at_beastmaster( Player *player, Creature *_Creature, uint32 sender, uint32 action )
{
   switch(action)
   {
   case GOSSIP_ACTION_INFO_DEF + 100:
       player->ADD_GOSSIP_ITEM(4, "Get new pet", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 30);
       if (player->CanTameExoticPets())
       {
           player->ADD_GOSSIP_ITEM(4, "Get new exotic pet", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 50);
       }
       player->ADD_GOSSIP_ITEM(2, "Take me to stable", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_STABLEPET);
       player->ADD_GOSSIP_ITEM(6, "Sell me some food", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR);
       player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());
       break;
   case GOSSIP_ACTION_INFO_DEF + 30:
       player->ADD_GOSSIP_ITEM(2, "<< Back to main menu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 100);
       player->ADD_GOSSIP_ITEM(4, "Next page >>", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31);
       player->ADD_GOSSIP_ITEM(6, "Bat", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 18);
       player->ADD_GOSSIP_ITEM(6, "Bear", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
       player->ADD_GOSSIP_ITEM(6, "Boar", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
       player->ADD_GOSSIP_ITEM(6, "Cat", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
       player->ADD_GOSSIP_ITEM(6, "Carrion Bird", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
       player->ADD_GOSSIP_ITEM(6, "Crab", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
       player->ADD_GOSSIP_ITEM(6, "Crocolisk", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
       player->ADD_GOSSIP_ITEM(6, "Dragonhawk", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 17);
       player->ADD_GOSSIP_ITEM(6, "Gorilla", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
       player->ADD_GOSSIP_ITEM(6, "Hound", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
       player->ADD_GOSSIP_ITEM(6, "Hyena", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
       player->ADD_GOSSIP_ITEM(6, "Moth", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
       player->ADD_GOSSIP_ITEM(6, "Owl", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
       player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());
       break;
   case GOSSIP_ACTION_INFO_DEF + 31:  
       player->ADD_GOSSIP_ITEM(2, "<< Back to main menu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 100);
       player->ADD_GOSSIP_ITEM(4, "<< Previous page", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 30);
       player->ADD_GOSSIP_ITEM(6, "Raptor", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 20);
       player->ADD_GOSSIP_ITEM(6, "Ravager", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 19);
       player->ADD_GOSSIP_ITEM(6, "Strider", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
       player->ADD_GOSSIP_ITEM(6, "Scorpid", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
       player->ADD_GOSSIP_ITEM(6, "Spider", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 16);
       player->ADD_GOSSIP_ITEM(6, "Serpent", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);  
       player->ADD_GOSSIP_ITEM(6, "Turtle", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
       player->ADD_GOSSIP_ITEM(6, "Wasp", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
       player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());
       break;
   case GOSSIP_ACTION_INFO_DEF + 50:  
       player->ADD_GOSSIP_ITEM(2, "<< Back to main menu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 100);
       player->ADD_GOSSIP_ITEM(6, "Chimaera", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 51);
       player->ADD_GOSSIP_ITEM(6, "Core Hound", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 52);
       player->ADD_GOSSIP_ITEM(6, "Devilsaur", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 53);
       player->ADD_GOSSIP_ITEM(6, "Rhino", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 54);
       player->ADD_GOSSIP_ITEM(6, "Silithid", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 55);
       player->ADD_GOSSIP_ITEM(6, "Worm", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 56);  
       player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());
       break;
   case GOSSIP_OPTION_STABLEPET:
       player->GetSession()->SendStablePet(_Creature->GetGUID());
       break; 
   case GOSSIP_OPTION_VENDOR:
       player->SEND_VENDORLIST( _Creature->GetGUID());
       break;
   case GOSSIP_ACTION_INFO_DEF + 51: //chimera
       CreatePet(player, _Creature, 21879);
       break;
   case GOSSIP_ACTION_INFO_DEF + 52: //core hound
       CreatePet(player, _Creature, 21108);
       break;
   case GOSSIP_ACTION_INFO_DEF + 53: //Devilsaur
       CreatePet(player, _Creature, 20931);
       break;
   case GOSSIP_ACTION_INFO_DEF + 54: //rhino
       CreatePet(player, _Creature, 30445);
       break;
   case GOSSIP_ACTION_INFO_DEF + 55: //silithid
       CreatePet(player, _Creature, 5460);
       break;
   case GOSSIP_ACTION_INFO_DEF + 56: //Worm
       CreatePet(player, _Creature, 30148);
       break;
   case GOSSIP_ACTION_INFO_DEF + 16: //Spider
       CreatePet(player, _Creature, 2349);
       break;
   case GOSSIP_ACTION_INFO_DEF + 17: //Dragonhawk
       CreatePet(player, _Creature, 27946);
       break;
   case GOSSIP_ACTION_INFO_DEF + 18: //Bat
       CreatePet(player, _Creature, 28233);
       break;
   case GOSSIP_ACTION_INFO_DEF + 19: //Ravager
       CreatePet(player, _Creature, 17199);
       break;
   case GOSSIP_ACTION_INFO_DEF + 20: //Raptor
       CreatePet(player, _Creature, 14821);
       break;
   case GOSSIP_ACTION_INFO_DEF + 21: //Serpent
       CreatePet(player, _Creature, 28358);
       break;
   case GOSSIP_ACTION_INFO_DEF + 1:  //bear
       CreatePet(player, _Creature, 29319);
       break;
   case GOSSIP_ACTION_INFO_DEF + 2:  //Boar
       CreatePet(player, _Creature, 29996);
       break;
   case GOSSIP_ACTION_INFO_DEF + 3:  //Bug
       CreatePet(player, _Creature, 28085);
       break;
   case GOSSIP_ACTION_INFO_DEF + 4:  //cat
       CreatePet(player, _Creature, 28097);
       break;
   case GOSSIP_ACTION_INFO_DEF + 5:  //carrion
       CreatePet(player, _Creature, 26838);
       break;
   case GOSSIP_ACTION_INFO_DEF + 6:  //crab
       CreatePet(player, _Creature, 24478);
       break;   
   case GOSSIP_ACTION_INFO_DEF + 7:  //crocolisk
       CreatePet(player, _Creature, 1417);
       break;  
   case GOSSIP_ACTION_INFO_DEF + 8:  //gorila
       CreatePet(player, _Creature, 28213);
       break;
   case GOSSIP_ACTION_INFO_DEF + 9:  //hound
       CreatePet(player, _Creature, 29452);
       break;
   case GOSSIP_ACTION_INFO_DEF + 10: //hynea
       CreatePet(player, _Creature, 13036);
       break;
   case GOSSIP_ACTION_INFO_DEF + 11: //Moth
       CreatePet(player, _Creature, 27421);
       break;
   case GOSSIP_ACTION_INFO_DEF + 12: //owl
       CreatePet(player, _Creature, 23136);
       break;
   case GOSSIP_ACTION_INFO_DEF + 13: //strider
       CreatePet(player, _Creature, 22807);
       break;
   case GOSSIP_ACTION_INFO_DEF + 14: //scorpid
       CreatePet(player, _Creature, 9698);
       break;
   case GOSSIP_ACTION_INFO_DEF + 15: //turtle
       CreatePet(player, _Creature, 25482);
       break;
   }
   return true;
}

void AddSC_at_beastmaster()
{
   Script *newscript;
   newscript = new Script;
   newscript->Name="at_beastmaster";
   newscript->pGossipHello = &GossipHello_at_beastmaster;
   newscript->pGossipSelect = &GossipSelect_at_beastmaster;
   newscript->RegisterSelf();
}

 

 

EDIT3: typo :D

 

EDIT4: Vám se to nelíbí jo? :ermm::crybaby:

 

Jde zkompilovat i na revizi TC 9174 (pro 3.3.5a) - InGame jsem to nezkoušel, to nechám už na každém z vás. :)

Edited by Wolf Officious
  • Upvote 3

Share this post


Link to post
Share on other sites

Supr; jinak nápad na vylepšení aby to šlo použít i pro jiné než instant servery; všechna místa kde je napevno použit level 80 pro peta stačí nahradit něčím jako player->GetLevel(); případně player->GetLevel() - 1;

(funguje to pak suprově - zkoušel jsem to na deffender funu)

Edited by Hkarta

Share this post


Link to post
Share on other sites

A co třeba includovat config a číst maximální povolený level?

 

EDIT: No, to je vlastně blbost.

Edited by Wolf Officious

Share this post


Link to post
Share on other sites

Ty kompiluješ na linuxu? :o:D (má totiž oproti windows case-sensitive file system (etc4,...)).

Ale napravím to. :D Díky za upozornění. ;)

 

EDIT: typo

Edited by Wolf Officious

Share this post


Link to post
Share on other sites

Upraveno pro TC rev. 10668 (přepis pro nový scriptovací systém - vlastní třída, bla bla bla..)

 

:diablo:ZDROJÁK:diablo:

 

#include "ScriptPCH.h"

class npc_at_beastmaster : public CreatureScript
{
private:
   void CreatePet(Player *player, Creature * m_creature, uint32 entry)
   {
       uint32 level = player->getLevel();

       if(player->getClass() != CLASS_HUNTER)
       {
           m_creature->MonsterWhisper("You are not hunter! Your order have been rejected.", player->GetGUID());
           player->CLOSE_GOSSIP_MENU();
           return;
       }

       if(player->GetPet())
       {
           m_creature->MonsterWhisper("First you must drop your pet!", player->GetGUID());
           player->CLOSE_GOSSIP_MENU();
           return;
       }

       Creature *creatureTarget = m_creature->SummonCreature(entry, player->GetPositionX(), player->GetPositionY()+2, player->GetPositionZ(), player->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 500);

       if(!creatureTarget)
           return;

       Pet* pet = player->CreateTamedPetFrom(creatureTarget, 0);

       if(!pet)
           return;

       creatureTarget->setDeathState(JUST_DIED);
       creatureTarget->RemoveCorpse();
       creatureTarget->SetHealth(0);
       pet->SetPower(POWER_HAPPINESS, 1048000);
       pet->GetMap()->Add((Creature*)pet);
       pet->SetUInt32Value(UNIT_FIELD_LEVEL, uint32(player->getLevel()));

       if(!pet->InitStatsForLevel(pet->getLevel()))
           sLog.outError("Pet Create fail: no init stats for entry %u", entry);

       pet->UpdateAllStats();
       player->SetMinion(pet, true);
       pet->SavePetToDB(PET_SAVE_AS_CURRENT);
       pet->InitTalentForLevel();
       player->PetSpellInitialize();
       player->CLOSE_GOSSIP_MENU();
       m_creature->MonsterWhisper("Pet added. You might want to feed it and name it somehow.", player->GetGUID());
   }

public:
   npc_at_beastmaster() : CreatureScript("npc_at_beastmaster") { }

   bool OnGossipHello(Player *player, Creature *_Creature)
   {
       if(player->getClass() != CLASS_HUNTER)
       {
           _Creature->MonsterWhisper("You are not hunter!", player->GetGUID());
           return true;
       }

       player->ADD_GOSSIP_ITEM(4, "Get new pet", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 30);

       if (player->CanTameExoticPets())
       {
           player->ADD_GOSSIP_ITEM(4, "Get new exotic pet", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 50);
       }

       player->ADD_GOSSIP_ITEM(2, "Take me to stable", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_STABLEPET);
       player->ADD_GOSSIP_ITEM(6, "Sell me some food", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR);
       player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());

       return true;
   }

   bool OnGossipSelect(Player *player, Creature *_Creature, uint32 sender, uint32 action)
   {
       switch(action)
       {
       case GOSSIP_ACTION_INFO_DEF + 100:
           player->ADD_GOSSIP_ITEM(4, "Get new pet", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 30);
           if (player->CanTameExoticPets())
           {
               player->ADD_GOSSIP_ITEM(4, "Get new exotic pet", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 50);
           }
           player->ADD_GOSSIP_ITEM(2, "Take me to stable", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_STABLEPET);
           player->ADD_GOSSIP_ITEM(6, "Sell me some food", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR);
           player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());
           break;
       case GOSSIP_ACTION_INFO_DEF + 30:
           player->ADD_GOSSIP_ITEM(2, "<< Back to main menu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 100);
           player->ADD_GOSSIP_ITEM(4, "Next page >>", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31);
           player->ADD_GOSSIP_ITEM(6, "Bat", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 18);
           player->ADD_GOSSIP_ITEM(6, "Bear", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
           player->ADD_GOSSIP_ITEM(6, "Boar", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
           player->ADD_GOSSIP_ITEM(6, "Cat", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
           player->ADD_GOSSIP_ITEM(6, "Carrion Bird", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
           player->ADD_GOSSIP_ITEM(6, "Crab", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
           player->ADD_GOSSIP_ITEM(6, "Crocolisk", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
           player->ADD_GOSSIP_ITEM(6, "Dragonhawk", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 17);
           player->ADD_GOSSIP_ITEM(6, "Gorilla", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
           player->ADD_GOSSIP_ITEM(6, "Hound", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
           player->ADD_GOSSIP_ITEM(6, "Hyena", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
           player->ADD_GOSSIP_ITEM(6, "Moth", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
           player->ADD_GOSSIP_ITEM(6, "Owl", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
           player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());
           break;
       case GOSSIP_ACTION_INFO_DEF + 31:  
           player->ADD_GOSSIP_ITEM(2, "<< Back to main menu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 100);
           player->ADD_GOSSIP_ITEM(4, "<< Previous page", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 30);
           player->ADD_GOSSIP_ITEM(6, "Raptor", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 20);
           player->ADD_GOSSIP_ITEM(6, "Ravager", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 19);
           player->ADD_GOSSIP_ITEM(6, "Strider", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
           player->ADD_GOSSIP_ITEM(6, "Scorpid", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
           player->ADD_GOSSIP_ITEM(6, "Spider", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 16);
           player->ADD_GOSSIP_ITEM(6, "Serpent", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);  
           player->ADD_GOSSIP_ITEM(6, "Turtle", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
           player->ADD_GOSSIP_ITEM(6, "Wasp", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
           player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());
           break;
       case GOSSIP_ACTION_INFO_DEF + 50:  
           player->ADD_GOSSIP_ITEM(2, "<< Back to main menu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 100);
           player->ADD_GOSSIP_ITEM(6, "Chimaera", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 51);
           player->ADD_GOSSIP_ITEM(6, "Core Hound", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 52);
           player->ADD_GOSSIP_ITEM(6, "Devilsaur", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 53);
           player->ADD_GOSSIP_ITEM(6, "Rhino", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 54);
           player->ADD_GOSSIP_ITEM(6, "Silithid", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 55);
           player->ADD_GOSSIP_ITEM(6, "Worm", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 56);  
           player->SEND_GOSSIP_MENU(1,_Creature->GetGUID());
           break;
       case GOSSIP_OPTION_STABLEPET:
           player->GetSession()->SendStablePet(_Creature->GetGUID());
           break; 
       case GOSSIP_OPTION_VENDOR:
           player->SEND_VENDORLIST( _Creature->GetGUID());
           break;
       case GOSSIP_ACTION_INFO_DEF + 51: //chimera
           CreatePet(player, _Creature, 21879);
           break;
       case GOSSIP_ACTION_INFO_DEF + 52: //core hound
           CreatePet(player, _Creature, 21108);
           break;
       case GOSSIP_ACTION_INFO_DEF + 53: //Devilsaur
           CreatePet(player, _Creature, 20931);
           break;
       case GOSSIP_ACTION_INFO_DEF + 54: //rhino
           CreatePet(player, _Creature, 30445);
           break;
       case GOSSIP_ACTION_INFO_DEF + 55: //silithid
           CreatePet(player, _Creature, 5460);
           break;
       case GOSSIP_ACTION_INFO_DEF + 56: //Worm
           CreatePet(player, _Creature, 30148);
           break;
       case GOSSIP_ACTION_INFO_DEF + 16: //Spider
           CreatePet(player, _Creature, 2349);
           break;
       case GOSSIP_ACTION_INFO_DEF + 17: //Dragonhawk
           CreatePet(player, _Creature, 27946);
           break;
       case GOSSIP_ACTION_INFO_DEF + 18: //Bat
           CreatePet(player, _Creature, 28233);
           break;
       case GOSSIP_ACTION_INFO_DEF + 19: //Ravager
           CreatePet(player, _Creature, 17199);
           break;
       case GOSSIP_ACTION_INFO_DEF + 20: //Raptor
           CreatePet(player, _Creature, 14821);
           break;
       case GOSSIP_ACTION_INFO_DEF + 21: //Serpent
           CreatePet(player, _Creature, 28358);
           break;
       case GOSSIP_ACTION_INFO_DEF + 1:  //bear
           CreatePet(player, _Creature, 29319);
           break;
       case GOSSIP_ACTION_INFO_DEF + 2:  //Boar
           CreatePet(player, _Creature, 29996);
           break;
       case GOSSIP_ACTION_INFO_DEF + 3:  //Bug
           CreatePet(player, _Creature, 28085);
           break;
       case GOSSIP_ACTION_INFO_DEF + 4:  //cat
           CreatePet(player, _Creature, 28097);
           break;
       case GOSSIP_ACTION_INFO_DEF + 5:  //carrion
           CreatePet(player, _Creature, 26838);
           break;
       case GOSSIP_ACTION_INFO_DEF + 6:  //crab
           CreatePet(player, _Creature, 24478);
           break;   
       case GOSSIP_ACTION_INFO_DEF + 7:  //crocolisk
           CreatePet(player, _Creature, 1417);
           break;  
       case GOSSIP_ACTION_INFO_DEF + 8:  //gorila
           CreatePet(player, _Creature, 28213);
           break;
       case GOSSIP_ACTION_INFO_DEF + 9:  //hound
           CreatePet(player, _Creature, 29452);
           break;
       case GOSSIP_ACTION_INFO_DEF + 10: //hynea
           CreatePet(player, _Creature, 13036);
           break;
       case GOSSIP_ACTION_INFO_DEF + 11: //Moth
           CreatePet(player, _Creature, 27421);
           break;
       case GOSSIP_ACTION_INFO_DEF + 12: //owl
           CreatePet(player, _Creature, 23136);
           break;
       case GOSSIP_ACTION_INFO_DEF + 13: //strider
           CreatePet(player, _Creature, 22807);
           break;
       case GOSSIP_ACTION_INFO_DEF + 14: //scorpid
           CreatePet(player, _Creature, 9698);
           break;
       case GOSSIP_ACTION_INFO_DEF + 15: //turtle
           CreatePet(player, _Creature, 25482);
           break;
       }
       return true;
   }
};

void AddSC_npc_at_beastmaster()
{
   new npc_at_beastmaster();
}

 

 

POZOR! Název scriptu (který se píše k NPC do DB) jsem změnil na: npc_at_beastmaster (aby to bylo jednotnější..)

EDIT: Pet bude mít level podle levelu hráče.

Edited by Wolf Officious
  • Upvote 3

Share this post


Link to post
Share on other sites

BUMP!

 

Pozor, na novější revizích se musí upravit řádek

            sLog.outError("Pet Create fail: no init stats for entry %u", entry);

takto:

            sLog->outError("Pet Create fail: no init stats for entry %u", entry);

místo tečky . je tam ->

Viz.: http://www.wowresource.eu/index.php?showtopic=23243

  • Upvote 1

Share this post


Link to post
Share on other sites

Zdravím

 

Pri kompilaci tohoto scriptu mi hodi error

"11>..\..\..\..\TC START\src\server\scripts\Custom\beastmaster.cpp(38) : error C2039: 'Add' : is not a member of 'Map'

11> C:\TC START\src\server\game\Maps\Map.h(229) : see declaration of 'Map'

11>..\..\..\..\TC START\src\server\scripts\Custom\beastmaster.cpp(137) : error C2039: 'SEND_VENDORLIST' : is not a member of 'Player'

11>        C:\TC START\src\server\game\Entities\Player\Player.h(1076) : see declaration of 'Player' "

mam vse udelane podle navodu, mam aktualni revku TC ;)

prosim o pomoc, diky

Edited by Pandaria

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  

×