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  
Smrtokvitek

[C++] Apokalypsa WoW Server - NPCs

Recommended Posts

akorát je divný že pro hordu jsou v teleportérovi města které jsou pro ali a pro ali jsou hordácké .. :-/

 

 

EDIT: Dokázal by to někdo upravit aby ali města se ukazovala jen pro ali a naopak? :-(

Edited by Dremlock

Share this post


Link to post
Share on other sites

Sry za double post ale tak by si toho asi nikdo nevšiml..

 

U teleportéra:

 

Dokázal by to někdo upravit aby ali města se ukazovala jen pro ali a naopak? :-(

Share this post


Link to post
Share on other sites

Třeba něco podobnýho?

 

/* GAMEOBJECT TELEPORTER
*
* Scripter:  (c) 2010 Wolf Officious <http://www.wowresource.eu/index.php?showuser=9661>
* Locations: (c) 2010 NecroVisioN    <http://www.wowresource.eu/index.php?showuser=8127>
*
* FileName:        npc_teleporter.cpp
* Script Name:     npc_teleporter
* Core Revision:   10866
*/

#include "ScriptPCH.h"

class npc_teleporter : public CreatureScript
{
private:
   bool PlayerCheck(Player *pPlayer, Creature *_creature)
   {
       if (pPlayer->isInCombat())
       {
           pPlayer->CLOSE_GOSSIP_MENU();
           _creature->MonsterWhisper("You are in combat!", pPlayer->GetGUID());
           return false;
       }
       return true;
   }

   inline void TeleportingProcess(Player *pPlayer, uint32 map, float x, float y, float z, float o)
   {
       pPlayer->CLOSE_GOSSIP_MENU();
       pPlayer->TeleportTo(map, x, y, z, o);
   }

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

   bool OnGossipHello(Player *pPlayer, Creature *_creature)
   {
       if (!PlayerCheck(pPlayer, _creature))
           return true;

       switch(pPlayer->GetTeam())
       {
       case ALLIANCE:
           pPlayer->ADD_GOSSIP_ITEM(7, "[-->] Head cities [A]",    GOSSIP_SENDER_MAIN, 100);
           break;
       case HORDE:
           pPlayer->ADD_GOSSIP_ITEM(7, "[-->] Head cities [H]",    GOSSIP_SENDER_MAIN, 200);
           break;
       default:
           break;
       }
       pPlayer->ADD_GOSSIP_ITEM( 7, "[-->] WotLK DUNGEONS",        GOSSIP_SENDER_MAIN, 300);
       pPlayer->ADD_GOSSIP_ITEM( 7, "[-->] WotLK RAIDS",           GOSSIP_SENDER_MAIN, 400);
       pPlayer->ADD_GOSSIP_ITEM( 5, "Gurubashi Arena PvP",         GOSSIP_SENDER_MAIN, 501);
       pPlayer->ADD_GOSSIP_ITEM( 5, "Dalaran",                     GOSSIP_SENDER_MAIN, 502);
       pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());

       return true;
   }

   bool OnGossipSelect(Player *pPlayer, Creature *_creature, uint32 sender, uint32 action)
   {
       if (!PlayerCheck(pPlayer, _creature))
           return true;

       if (sender != GOSSIP_SENDER_MAIN)
           return true;

       switch(action)
       {
       /******************************/
       /*          ALLIANCE          */
       /******************************/
       case 100: //Alliance cities menu
           pPlayer->ADD_GOSSIP_ITEM( 5, "Stormwind",               GOSSIP_SENDER_MAIN, 101);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Ironforge",               GOSSIP_SENDER_MAIN, 102);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Darnassus",               GOSSIP_SENDER_MAIN, 103);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Exodar",                  GOSSIP_SENDER_MAIN, 104);
           pPlayer->ADD_GOSSIP_ITEM( 7, "[<--] MAIN MENU",         GOSSIP_SENDER_MAIN, 666);
           pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
           break;
       case 101: //Stormwind
           TeleportingProcess(pPlayer, 0, -8832.945313f, 623.305908f, 93.756119f, 0.704069f);
           break;
       case 102: //Ironforge
           TeleportingProcess(pPlayer, 0, -4920.960449f, -955.293030f, 501.755096f, 2.258313f);
           break;
       case 103: //Darnassus
           TeleportingProcess(pPlayer, 1, 9949.559570f, 2284.209961f, 1341.394165f, 1.525185f);
           break;
       case 104: //Exodar
           TeleportingProcess(pPlayer, 530, -3965.699951f, -11653.599609f, -138.843994f, 6.192861f);
           break;
       /***************************/
       /*          HORDE          */
       /***************************/
       case 200: //Horde cities menu
           pPlayer->ADD_GOSSIP_ITEM( 5, "Orgrimmar",               GOSSIP_SENDER_MAIN, 201);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Thunderbluff",            GOSSIP_SENDER_MAIN, 202);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Undercity",               GOSSIP_SENDER_MAIN, 203);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Silvermoon City",         GOSSIP_SENDER_MAIN, 204);
           pPlayer->ADD_GOSSIP_ITEM( 7, "[<--] MAIN MENU",         GOSSIP_SENDER_MAIN, 666);
           pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
           break;
       case 201: //Orgrimmar
           TeleportingProcess(pPlayer, 1, 1629.601440f, -4373.439453f, 31.293652f, 3.528754f);
           break;
       case 202: //Thunder Bluff
           TeleportingProcess(pPlayer, 1, -1277.369995f, 124.804001f, 131.287003f, 5.222740f);
           break;
       case 203: //Undercity
           TeleportingProcess(pPlayer, 0, 1584.069946f, 241.987000f, -52.153400f, 0.049647f);
           break;
       case 204: //Silvermoon City
           TeleportingProcess(pPlayer, 530, 9487.690430f, -7279.200195f, 14.286600f, 6.164780f);
           break;
       /******************************/
       /*          DUNGEONS          */
       /******************************/
       case 300: //Dungeon choice menu
           pPlayer->ADD_GOSSIP_ITEM( 5, "Utgarde Keep",            GOSSIP_SENDER_MAIN, 301);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Utgarde Pinnacle",        GOSSIP_SENDER_MAIN, 302);
           pPlayer->ADD_GOSSIP_ITEM( 5, "The Nexus",               GOSSIP_SENDER_MAIN, 303);
           pPlayer->ADD_GOSSIP_ITEM( 5, "The Oculus",              GOSSIP_SENDER_MAIN, 304);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Culling of Stratholme",   GOSSIP_SENDER_MAIN, 305);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Gundrak",                 GOSSIP_SENDER_MAIN, 306);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Azjol'Nerub",             GOSSIP_SENDER_MAIN, 307);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Ahn'kahet",               GOSSIP_SENDER_MAIN, 308);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Violet Hold",             GOSSIP_SENDER_MAIN, 309);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Halls of Stone",          GOSSIP_SENDER_MAIN, 310);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Halls of Lightning",      GOSSIP_SENDER_MAIN, 311);
           pPlayer->ADD_GOSSIP_ITEM( 7, "[<--] MAIN MENU",         GOSSIP_SENDER_MAIN, 666);
           pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
           break;
       case 301: //Utgarde Keep
           TeleportingProcess(pPlayer, 571, 1219.664917f, -4865.193848f, 41.535000f, 0.314811f);
           break;
       case 302: //Utgarde Pinnacle
           TeleportingProcess(pPlayer, 571, 1255.446289f, -4853.176270f, 216.074661f, 3.454866f);
           break;
       case 303: //The Nexus
           TeleportingProcess(pPlayer, 571, 3892.317627f, 6985.265137f, 69.725945f, 0.024484f);
           break;
       case 304: //The Oculus
           TeleportingProcess(pPlayer, 571, 3878.909912f, 6984.500000f, 107.511551f, 3.140943f);
           break;
       case 305: //Culling of Stratholme
           TeleportingProcess(pPlayer, 1, -8669.932617f, -4397.125977f, -205.574234f, 3.436879f);
           break;
       case 306: //Gundrak
           TeleportingProcess(pPlayer, 571, 6959.186035f, -4416.407715f, 451.506042f, 0.813021f);
           break;
       case 307: //Azjol'Nerub
           TeleportingProcess(pPlayer, 571, 3687.002197f, 2160.152344f, 37.126099f, 2.430617f);
           break;
       case 308: //Ahn'kahet
           TeleportingProcess(pPlayer, 571, 3642.264648f, 2034.362915f, 3.232100f, 4.319561f);
           break;
       case 309: //Violet Hold
           TeleportingProcess(pPlayer, 571, 5693.281250f, 502.955627f, 654.702993f, 4.051087f);
           break;
       case 310: //Halls of Stone
           TeleportingProcess(pPlayer, 571, 8921.278320f, -982.728149f, 1040.540405f, 1.545117f);
           break;
       case 311: //Halls of Lightning
           TeleportingProcess(pPlayer, 571, 9183.506836f, -1385.304199f, 1112.875489f, 5.517610f);
           break;
       /***************************/
       /*          RAIDS          */
       /***************************/
       case 400: //Raid choice menu
           pPlayer->ADD_GOSSIP_ITEM( 5, "Naxxramas",               GOSSIP_SENDER_MAIN, 401);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Ulduar",                  GOSSIP_SENDER_MAIN, 402);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Obsidian Sanctum",        GOSSIP_SENDER_MAIN, 403);
           pPlayer->ADD_GOSSIP_ITEM( 5, "The Eye of Ethernity",    GOSSIP_SENDER_MAIN, 404);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Onyxia's Lair",           GOSSIP_SENDER_MAIN, 405);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Vault of Archavon",       GOSSIP_SENDER_MAIN, 406);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Trial of the Crusader",   GOSSIP_SENDER_MAIN, 407);
           pPlayer->ADD_GOSSIP_ITEM( 5, "Icecrown Citadel",        GOSSIP_SENDER_MAIN, 408);
           pPlayer->ADD_GOSSIP_ITEM( 7, "[<--] MAIN MENU",         GOSSIP_SENDER_MAIN, 666);
           pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
           break;
       case 401: //Naxxramas
           TeleportingProcess(pPlayer, 571, 3669.402344f, -1259.975586f, 244.001587f, 4.232424f);
           break;
       case 402: //Ulduar
           TeleportingProcess(pPlayer, 571, 9332.218750f, -1136.00317f, 1247.385498f, 1.572278f);
           break;
       case 403: //Obsidian Sanctum
           TeleportingProcess(pPlayer, 571, 3476.185303f, 281.722626f, -119.043976f, 4.727457f);
           break;
       case 404: //The Eye of Ethernity
           TeleportingProcess(pPlayer, 571, 3859.283447f, 6988.659180f, 152.742264f, 5.664299f);
           break;
       case 405: //Onyxia's Lair
           TeleportingProcess(pPlayer, 1, -4694.693848f, -3701.385742f, 47.805836f, 4.402122f);
           break;
       case 406: //Vault of Archavon
           TeleportingProcess(pPlayer, 571, 5467.609375f, 2827.439941f, 419.949188f, 0.968485f);
           break;
       case 407: //Trial of the Crusader
           TeleportingProcess(pPlayer, 571, 8517.248047f, 721.388428f, 559.179016f, 1.606136f);
           break;
       case 408: //Icecrown Citadel
           TeleportingProcess(pPlayer, 571, 5867.302734f, 2101.300293f, 636.510193f, 2.199108f);
           break;
       /**************************/
       /*          MISC          */
       /**************************/
       case 501: //Gurubashi Arena
           TeleportingProcess(pPlayer, 0, -13272.562344f, 166.661591f, 37.025265f, 4.228953f);
           break;
       case 502: //Dalaran
           TeleportingProcess(pPlayer, 571, 5807.860332f, 588.230591f, 661.373230f, 1.667496f);
           break;
       case 666: //[<--] MAIN MENU
           OnGossipHello(pPlayer, _creature);
           break;
       default:
           break;
       }
       return true;
   }
};

void AddSC_npc_teleporter()
{
   new npc_teleporter();
}

 

..což je předělávka tohoto: http://www.wowresource.eu/index.php?showtopic=20842

 

PS: Inspiruj se tím - přepiš si to podle sebe.

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  

×