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  
turbo-snek

Chyba pri kompilaci custom scriptu

Recommended Posts

Zdravim, delam si vendora na Tier sety pro classy. Vsechno pri kompilaci úrobehne v poradku, ale akorad mi to hazi errory.

 

 

script

 

 

/***********************************
*Name:        C++ Tier Vendor     *
*File:        npc_tier_vendor.cpp *
*Created:     Turbo-Snek          *
*Create Date: 01.11.2011          *
*Script Name: npc_tier_vendor     *
***********************************/


/*sql
INSERT INTO `creature_template` (`entry`, `heroic_entry`, `modelid_A`, `modelid_A2`, `modelid_H`, `modelid_H2`, `name`, `subname`, `IconName`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, `npcflag`, `speed`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `baseattacktime`, `rangeattacktime`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `PetSpellDataId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `RacialLeader`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`) VALUES (31100, 0, 17882, 0, 17882, 0, 'Tier Vendor', 'Snek Corporation', '', 1, 1, 1, 1, 1, 1, 0, 35, 35, 1, 1, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, 1, 0, 0, 0, 'npc_tier_vendor');
*/


#include "ScriptPCH.h"
#include "Player.h"


#define GOSSIP_SENDER_ACTION 12


bool GossipHello_npc_tier_vendor(Player *pPlayer, Creature *pCreature)
{
 if(!pPlayer->isInCombat())
 {
	 pPlayer->ADD_GOSSIP_ITEM( 10, "Druid", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
	 pPlayer->ADD_GOSSIP_ITEM( 10, "Hunter", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
	 pPlayer->ADD_GOSSIP_ITEM( 10, "Warlock", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
	 pPlayer->ADD_GOSSIP_ITEM( 10, "Mage", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
	 pPlayer->ADD_GOSSIP_ITEM( 10, "Paladin", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
	 pPlayer->ADD_GOSSIP_ITEM( 10, "Priest", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
	 pPlayer->ADD_GOSSIP_ITEM( 10, "Rogue", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
	 pPlayer->ADD_GOSSIP_ITEM( 10, "Shaman", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
	 pPlayer->ADD_GOSSIP_ITEM( 10, "Warrior", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
	 pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,pCreature->GetGUID());
	 return true;
 }
 pPlayer->GetSession()->SendNotification("Jsi v kombatu, vrat se pozdeji.");
 return false;
}



void SendSubMenu_npc_tier_vendor(Player *pPlayer, Creature *pCreature, uint32 action)
{
   switch (action)
   {
	case GOSSIP_ACTION_INFO_DEF + 1:  /*Druid*/
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 1", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 1);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 2", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 2);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 3", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 3);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 4 HEAL", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 4);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 4 MEELE DMG", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 5);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 4 SPELL DMG", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 6);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 5 HEAL", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 7);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 5 MEELE DMG", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 8);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 5 SPELL DMG", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 9);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 6 HEAL", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 10);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 6 MEELE DMG", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 11);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 6 SPELL DMG", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 12);
		pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pCreature->GetGUID());
	break;

	case GOSSIP_ACTION_INFO_DEF + 2:  /*Hunter*/
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 1", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 13);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 2", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 14);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 3", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 15);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 4", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 16);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 5", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 17);
		pPlayer->ADD_GOSSIP_ITEM( 9, "Tier 6", GOSSIP_SENDER_ACTION, GOSSIP_ACTION_INFO_DEF + 18);
		pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pCreature->GetGUID());
	break;
}
}


void SendActionMenu_npc_tier_vendor(Player *pPlayer, Creature *pCreature, uint32 action)
{
   switch (action)
   {
	/*Druid T1*/
	case GOSSIP_ACTION_INFO_DEF + 1:
		pPlayer->SendNewItem (16828, 1);
		pPlayer->SendNewItem (16830, 1);
		pPlayer->SendNewItem (16829, 1);
		pPlayer->SendNewItem (16831, 1);
		pPlayer->SendNewItem (16834, 1);
		pPlayer->SendNewItem (16835, 1);
		pPlayer->SendNewItem (16836, 1);
		pPlayer->SendNewItem (16833, 1);
		pPlayer->CLOSE_GOSSIP_MENU();
	break;
}
}



bool GossipSelect_npc_tier_vendor(Player *pPlayer, Creature *pCreature, uint32 sender, uint32 action )
{
   switch (sender)
   {
       case GOSSIP_SENDER_MAIN:            SendSubMenu_npc_tier_vendor(pPlayer, pCreature, action); break;
       case GOSSIP_SENDER_ACTION:          SendActionMenu_npc_tier_vendor(pPlayer, pCreature, action); break;
   }
   return true;
}






void AddSC_npc_tier_vendor()
{
   Script *newscript;
newscript = new Script;
newscript->Name="npc_tier_vendor";
newscript->pGossipHello = &GossipHello_npc_tier_vendor;
   newscript->pGossipSelect = &GossipSelect_npc_tier_vendor;
newscript->RegisterSelf();
}

 

 

 

 

a errory, ktere mi to hazi

 

------ Build started: Project: revision.h, Configuration: Release Win32 ------
Build log was saved at "file://c:\Oregon Core\Builds\src\genrev\revision.h.dir\Release\BuildLog.htm"
revision.h - 0 error(s), 0 warning(s)
------ Build started: Project: scripts, Configuration: Release Win32 ------
Compiling...
npc_tier_vendor.cpp
..\..\..\OC Repo\src\scripts\Custom\npc_tier_vendor.cpp(83) : error C2660: 'Player::SendNewItem' : function does not take 2 arguments
..\..\..\OC Repo\src\scripts\Custom\npc_tier_vendor.cpp(84) : error C2660: 'Player::SendNewItem' : function does not take 2 arguments
..\..\..\OC Repo\src\scripts\Custom\npc_tier_vendor.cpp(85) : error C2660: 'Player::SendNewItem' : function does not take 2 arguments
..\..\..\OC Repo\src\scripts\Custom\npc_tier_vendor.cpp(86) : error C2660: 'Player::SendNewItem' : function does not take 2 arguments
..\..\..\OC Repo\src\scripts\Custom\npc_tier_vendor.cpp(87) : error C2660: 'Player::SendNewItem' : function does not take 2 arguments
..\..\..\OC Repo\src\scripts\Custom\npc_tier_vendor.cpp(88) : error C2660: 'Player::SendNewItem' : function does not take 2 arguments
..\..\..\OC Repo\src\scripts\Custom\npc_tier_vendor.cpp(89) : error C2660: 'Player::SendNewItem' : function does not take 2 arguments
..\..\..\OC Repo\src\scripts\Custom\npc_tier_vendor.cpp(90) : error C2660: 'Player::SendNewItem' : function does not take 2 arguments
Build log was saved at "file://c:\Oregon Core\Builds\src\scripts\scripts.dir\Release\BuildLog.htm"
scripts - 8 error(s), 0 warning(s)
------ Skipped Build: Project: INSTALL, Configuration: Release Win32 ------
Project not selected to build for this solution configuration 
========== Build: 1 succeeded, 1 failed, 18 up-to-date, 1 skipped ==========

 

 

Vedel by mi tu prosim nekdo poradit? Uz jsem z toho docela dost zoufalej. Zkousel jsem to vselijak, el porad to hazelo errory tyto nebo uplne jine:D. Predem diky za kazdou radu.

 

 

Turbo-Snek

Share this post


Link to post
Share on other sites

Viděl bych to na chybu v mezeře... což by tě mělo taky napadnout, když už ti to přesně napsalo chybu...

                       pPlayer->SendNewItem (16830, 1);
                       pPlayer->SendNewItem (16829, 1);
                       pPlayer->SendNewItem (16831, 1);
                       pPlayer->SendNewItem (16834, 1);
                       pPlayer->SendNewItem (16835, 1);
                       pPlayer->SendNewItem (16836, 1);
                       pPlayer->SendNewItem (16833, 1);

 

uprav na

                       pPlayer->SendNewItem(16830, 1);
                       pPlayer->SendNewItem(16829, 1);
                       pPlayer->SendNewItem(16831, 1);
                       pPlayer->SendNewItem(16834, 1);
                       pPlayer->SendNewItem(16835, 1);
                       pPlayer->SendNewItem(16836, 1);
                       pPlayer->SendNewItem(16833, 1);

Share this post


Link to post
Share on other sites
Je mozny, ze jsem tam neco prehledl, ale neim co.

Si děláš srandu ne?

 

pPlayer->SendNewItem (16834, 1);
pPlayer->SendNewItem (int, int);
# porovnej s
void Player::SendNewItem(Item *item, uint32 count, bool received, bool created, bool broadcast)

 

Krom toho, že to používáš chybně, tak SendNewItem předmět neposílá, ani nevytváří. Posílá paket, který zobrazuje hlášku "You received item..." v chatlogu. Na vytvoření itemu se podívej do https://raw.github.com/Remake/OregonCore/master/src/game/Level3.cpp na metodu HandleAddItemCommand. To co potřebuješ je sekvence CanStoreNewItem, StoreNewItem, SendNewItem.

Share this post


Link to post
Share on other sites

Hráčům přidáváme itemy pomocí funkce

bool AddItem(uint32 itemId, uint32 count);

Takže?

                        pPlayer->AddItem(16828, 1);
                       pPlayer->AddItem(16830, 1);
                       pPlayer->AddItem(16829, 1);
                       pPlayer->AddItem(16831, 1);
                       pPlayer->AddItem(16834, 1);
                       pPlayer->AddItem(16835, 1);
                       pPlayer->AddItem(16836, 1);
                       pPlayer->AddItem(16833, 1);

:lol: chyba s mezerou prej :D

Edited by Wolf Officious
  • Upvote 1

Share this post


Link to post
Share on other sites

Wolfe, tak jsem to prepsal, ale stale to nefunguje. Tedka to pise

 

..\..\..\OC Repo\src\scripts\Custom\npc_tier_vendor.cpp(83) : error C2039: 'AddItem' : is not a member of 'Player'
       C:\Oregon Core\OC Repo\src\game\Player.h(837) : see declaration of 'Player'

Share this post


Link to post
Share on other sites

Hráčům přidáváme itemy pomocí funkce

bool AddItem(uint32 itemId, uint32 count);

 

Tady nejsi v TC, ale v OC.

file://c:\Oregon Core\...

A to tuto metodu nemá.

Share this post


Link to post
Share on other sites

Tady nejsi v TC, ale v OC.

A to tuto metodu nemá.

Tak to jsem přehlédl. Když už jsme u toho, mohl bys to tedy přesunout do správné sekce. <_<

Nicméně není problém si tam tu metodu přidat po vzoru dnešního TC. :bleh:

EDIT: Přesunuto do samostatného vlákna => http://www.wowresource.eu/index.php?showtopic=23749

Edited by Wolf Officious
  • Upvote 1

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  

×