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  
MesoX

Chat Addons

Recommended Posts

měli jste někdy pocit že vám na serveru něco chybí? já také a když sem si tak prolízal ascent fórum našel sem zajímavý příspěvek na téma příkazů. Jedná se o příkazdy #event, #eventon a #eventoff. Trošku to vysvětlím:

hráčům je přístupný jen #event, když GM napíše #eventon tak hráčům se uatomaticky zpřístupní příkaz #event který je portne na místo kde GM napsalo #eventon :) #eventoff samozřejmě znepřístupní #event. Proto se ptám měli byste zájem o další podobné addony pro GM i pro hráče? pokud ano pište sem své nápady a návrhy (můžeme rozlišovat příkazy pro Blizz a pro funservery) Já měl třeba návrh na jeden příkaz pro GMka typu #guildjoin, který by je automaticky připojil do guildy "GM Team" (aby admin pořád nemusel běhat do hry když si GM udělá nový char ;) ) potom starý dobrý .pvp enter z wowemu by se dal také přepracovat na #pvpenter a #pvpleave ;) jde mi jen o to jestli máte o tohle zájem, ale nejen o to psát návrhy ale i taky trošku pomáhat, přece jen C++ se v podstatě teprve učím ;)

Share this post


Link to post
Share on other sites

Tak jsem na to narazil na codecraftu :)

 

Readme.txt

Made by Spidey

This is mainly for funservers with events. Tired of people spamming "Teleport me to event plz" in LFG? This is for you :)
Before you start an event, go to where you want your players to port to, and say #eventon.
Players can now say #event to get teleported to that location.
When you finish, say #eventoff to stop players from porting to that location.

 

EventCommands.cpp

//---------------------
// Name: Event Teleporter v2
// Author: Spidey
//---------------------

#include "StdAfx.h"
#include "Setup.h"

//If set to true, will enable players to #event while in combat
static bool bypassCombat = false;

static string evon = "#eventon";
static string evoff = "#eventoff";
static string evplr = "#event";

//Default Values
static bool eon = false;
static uint32 emapid = 0;
static float ex = 0.0f;
static float ey = 0.0f;
static float ez = 0.0f;

void EventChat(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
{
   if(Message == evon && pPlayer->GetSession()->HasGMPermissions())
   {
      eon = true;
      ex = pPlayer->GetPositionX();
      ey = pPlayer->GetPositionY();
      ez = pPlayer->GetPositionZ();
      emapid = pPlayer->GetMapId();
   }
   else if(Message == evoff && pPlayer->GetSession()->HasGMPermissions())
   {
      eon = false;
   }
   else if(Message == evplr)
   {
      if(eon)
         if(bypassCombat || !pPlayer->CombatStatus.IsInCombat())
            pPlayer->EventTeleport(emapid, ex, ey, ez);
         else
            pPlayer->BroadcastMessage("You can't port while in combat.");
      else
         pPlayer->BroadcastMessage("There's no active event at the moment.");
   }
}

void SetupEvent(ScriptMgr * mgr)
{
   mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, &EventChat);
}

Share this post


Link to post
Share on other sites

ANo tohle je už 2 měsíce staré a tohle mně na tu myšlenku přivedlo, bohužel jak vidíš zájem není dostatečný ;)

Share this post


Link to post
Share on other sites
ANo tohle je už 2 měsíce staré a tohle mně na tu myšlenku přivedlo, bohužel jak vidíš zájem není dostatečný ;)

Ja bych mel tež zajem ;)

Share this post


Link to post
Share on other sites

Tka řekněte co by v podstatě mělo dělat? příkazy ale nebudou pod tečkou aby to bylo trošku originalnější ok?

Share this post


Link to post
Share on other sites

Alpha verze scriptu ( # píšete pomocí pravýho alt + x )

 

příkaz pro všechny:

#eventstatus (pouze ukáže status eventu)

 

příkazy pro hráče:

#evententer

#eventleave

 

příkazy pro GM:

#eventstart

#eventdisable

#eventfinish

#eventend

 

Vysvětlivky:

GM napíše #eventstart oznamí se to automaticky na world (systeme message) od této chvíle mohou hráči psát #evententer (pokud se žádný hráč ještě neřipojil může GM napsat #eventdisable a tím event zruší pokud už se připojil alepsoň jeden hráč tak příkazem #eventdisable se event neukončí ale hráči se už nebudou moct teleportovat) po zkončení eventu gm napíše #eventfinish čímž zpřístupní hráčum příkaz #eventleave který je portne na jejich původní pozice před napsaním #evententer. V průběhu eventu je pro hráče #eventleave zakázaný čili musí čekat než event zkončí i pokud se jim tam nebude líbit. Stejně tak jako když nějaký event probíhá tak #evententer funguje jen určitou dobu než GM napíše #eventdisable. úplný konec eventu zapříčinní GM napsanáním #eventend (zakázaní #evententer a #eventleave)

 

/*
* Original idea from Spidey
*
* Version 0.2 By MesoX
*
* Yelly Chat Scripts
* Copyright © 2006-2008 U2 Team <http://www.undzwei.eu/> 
* And
* Copyright © 2007-2008 Yelly Team <http://yelly.wow-mexis.cz/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "StdAfx.h"
#include "Setup.h"

#define VERSION 0.2

//If set to true, will enable players to #event while in combat
static bool bypassCombat = false;

//For All
static string evstat = "#eventstatus";

// Only For GM's
static string evon = "#eventstart";
static string evoff = "#eventdisable"; // players cant teleported or event abandoned (if there arent any players)
static string evfin = "#eventfinish";
static string evend = "#eventend";

// Only For Players (not for GMs because they have their own commands ^^ )
static string evplr = "#evententer";
static string evplrl = "#eventleave";

//Default Values of GM
static bool eon = false;
static uint32 emapid = 0;
static float ex = 0.0f;
static float ey = 0.0f;
static float ez = 0.0f;

//Player positions and guid to load
static uint32 lmapid = 0;
static uint64 lguid = 0;
static float lx = 0.0f;
static float ly = 0.0f;
static float lz = 0.0f;

// Chapter
static uint32 Event = 0;

void EventChat(Player * plr, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
{
  if(Message == evon && plr->GetSession()->HasGMPermissions())
  {
     if( Event == 0 )
  {
     Event = 1;
     eon = true;
     ex = plr->GetPositionX();
     ey = plr->GetPositionY();
     ez = plr->GetPositionZ();
     emapid = plr->GetMapId();
     char msg[1024];
  snprintf(msg, 1024, "[server Event]"MSG_COLOR_BLUE" %s: Event Started! Type #evententer to teleport to event.", plr->GetName());
  sWorld.SendWorldText(msg); // send message
  }
  else
  {
	  plr->BroadcastMessage("There is some other event running, type #eventstatus for more info");
  }
  }
  else if(Message == evfin && plr->GetSession()->HasGMPermissions())
  {
     if( Event == 3 )
  {
     Event = 4;
  if(eon)
  {
     eon = false;
  }
     char msg[1024];
  snprintf(msg, 1024, "[server Event]"MSG_COLOR_BLUE" %s: Event Finished! Type #eventleave to teleport to your original position.", plr->GetName());
  sWorld.SendWorldText(msg); // send message
  }
  else if( Event == 2 )
  {
	  plr->BroadcastMessage("You must type #eventdisable first.");
  }
  else if( Event == 1)
  {
     eon = false;
  char msg[1024];
  snprintf(msg, 1024, "[server Event]"MSG_COLOR_BLUE" %s: Event abandoned.", plr->GetName());
  sWorld.SendWorldText(msg); // send message
  Event = 0; //Return to start because there arent any player
  }
  else if( Event == 4 )
  {
	  plr->BroadcastMessage("Event have been finished.");
  }
  else if( Event == 0)
  {
	  plr->BroadcastMessage("There is no active event, type #eventstart.");
  }
  }
  else if(Message == evoff && plr->GetSession()->HasGMPermissions())
  {
     if(Event == 1)
  {
     eon = false;
  char msg[1024];
  snprintf(msg, 1024, "[server Event]"MSG_COLOR_BLUE" %s: Event abandoned.", plr->GetName());
  sWorld.SendWorldText(msg); // send message
  Event = 0; //Return to start because there arent any player
  }
  else if(Event == 2)
  {
     eon = false;
     char msg[1024];
  snprintf(msg, 1024, "[server Event]"MSG_COLOR_BLUE" %s: Teleporting finished. You can't teleport now.", plr->GetName());
  sWorld.SendWorldText(msg); // send message
  Event = 3; //next chapter because there is => 1 player
  }
  else if(Event == 3)
  {
	  if(eon)
	  {
	   eon = false;
	  }
  }
  else if( Event == 0)
  {
	  plr->BroadcastMessage("There is no active event, type #eventstart."); // hmm 
  }
  else if( Event == 4)
  {
	  plr->BroadcastMessage("You must type #eventfinish to finsih event."); // only for information :-P
  }
  }
  else if(Message == evend && plr->GetSession()->HasGMPermissions())
  {
  if( Event == 4 )
  {
     Event = 0;
  if(eon)
  {
     eon = false;
  }
     char msg[1024];
  snprintf(msg, 1024, "[server Event]"MSG_COLOR_BLUE" %s: Event Ended!", plr->GetName());
  sWorld.SendWorldText(msg); // send message
  }
  else
  {
	  plr->BroadcastMessage("You can't end event now!");
  }
  }

  // For Players now...
  else if(Message == evplr && !plr->GetSession()->HasGMPermissions())
  {
     if( eon && ( Event == 1 || Event == 2 ) )
  {
     uint64 guid = WorldDatabase.Execute("SELECT guid FROM event_coords_plr WHERE guid = %u", plr->GetGUID());

        if(bypassCombat || !plr->CombatStatus.IsInCombat())
	 {
	    if( guid == NULL )
		{
	    Event = 2;
		WorldDatabase.Execute("INSERT INTO event_coords_plr VALUES (%u, %u, %i, %i, %i)", plr->GetGUID(), plr->GetMapId(), plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ());
           plr->EventTeleport(emapid, ex, ey, ez);
		}
		else
		{
		plr->BroadcastMessage("You have been already teleported.");
		}
	 }
        else
           plr->BroadcastMessage("You can't teleport while in combat.");
  }
     else if( Event == 3 )
  {
     plr->BroadcastMessage("There is some event running now.");
  }
  else if( Event == 4 )
  {
	  plr->BroadcastMessage("Event finished, now you can type #eventleave for returning to your original postition.");
  }
  else 
  {
        plr->BroadcastMessage("There's no active event at the moment.");
  }
  }
  else if(Message == evplrl && !plr->GetSession()->HasGMPermissions())
  {
   uint64 guid = WorldDatabase.Execute("SELECT guid FROM event_coords_plr WHERE guid = %u", plr->GetGUID());

   if(Event == 4)
   {
     if( guid == NULL)
     {
          plr->BroadcastMessage("You haven't any saved positions.");
     }
	 else
	 {
		lx = WorldDatabase.Execute("SELECT x FROM event_coords_plr WHERE guid = %u", plr->GetGUID());
           ly = WorldDatabase.Execute("SELECT y FROM event_coords_plr WHERE guid = %u", plr->GetGUID());
           lz = WorldDatabase.Execute("SELECT z FROM event_coords_plr WHERE guid = %u", plr->GetGUID());
           lmapid = WorldDatabase.Execute("SELECT map FROM event_coords_plr WHERE guid = %u", plr->GetGUID());
		if( lx != NULL && ly != NULL && lz != NULL && lmapid != NULL ) // For debugging
		{
			plr->EventTeleport(lmapid, lx, ly, lz);
               plr->BroadcastMessage("Thanks for attendance in this Event."); // Thanks Message
			WorldDatabase.Execute("DELETE FROM event_coords_plr WHERE guid = %u", plr->GetGUID());
		}
		else
		{
			if( guid != NULL )
			{
				plr->BroadcastMessage("There is something bad in database. Report this to any Gm. Number of error is #01"); // Untitled error 1?
			}
			else
			{
				plr->BroadcastMessage("Some error(s) occur(s) when. Report this to any Gm. Number of error is #02"); // Untitled error?
			}
		}
	 }
   }
   else if( Event == 0 ) // mother fucker...
   {
	   plr->BroadcastMessage("There's no active event at the moment.");
   }
   else if( Event == 1 && Event == 2 ) // some players are in idiotic state ^^
   {
	   if( guid == NULL )
	   {
	   plr->BroadcastMessage("There is active Event at the moment, type #evententer .");
	   }
	   else
	   {
	   plr->BroadcastMessage("There is active Event at the moment, type #eventleave and #evententer .");
	   }
   }
   else if( Event == 3 ) // there too ^^
   {
	   plr->BroadcastMessage("Some Event is running now, so you can't teleport now.");
   }
  }
  else if(Message == evstat)
  {
   plr->BroadcastMessage("Version of event scripts: v %u. By MesoX.", VERSION);

   if(plr->GetSession()->HasGMPermissions())
   {
	   if( Event == 0 )
	   {
		   plr->BroadcastMessage("There is no active event at the moment, you can type #eventstart .");
	   }
	   else if( Event == 1 )
	   {
		   plr->BroadcastMessage("There is some Event running, but within players. You can type #eventdisable for abandon");
	   }
	   else if( Event == 2 )
	   {
		   plr->BroadcastMessage("There is some Event running with player(s). You can type #eventdisable for  disabling teleporting for players");
	   }
	   else if( Event == 3 )
	   {
		   plr->BroadcastMessage("There is some Event running with player(s). You can type #eventfinish for enabling #eventleave");
	   }
	   else if( Event == 4 )
	   {
		   plr->BroadcastMessage("Event finished. Players are teleporting out now...");
	   }
   }
   else
   {
	   if( Event == 0 )
	   {
		   plr->BroadcastMessage("There is no active event at the moment.");
	   }
	   else if( Event == 1 || Event == 2)
	   {
		   plr->BroadcastMessage("There is some Event running, you can type #evententer .");
	   }
	   else if( Event == 3 )
	   {
		   plr->BroadcastMessage("There is some Event running now. You can't do anything.");
	   }
	   else if( Event == 4 )
	   {
		   plr->BroadcastMessage("Event finished. You can type #eventleave for teleport back to original position.");
	   }
   }
  }
  return;
}

void SetupEvent(ScriptMgr * mgr)
{
  mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, &EventChat);
}

/* table
CREATE TABLE IF NOT EXISTS `event_coords_plr` (
 `guid` int(10) unsigned NOT NULL default '0',
 `map` int(10) unsigned NOT NULL default '0',
 `x` float NOT NULL default '0',
 `y` float NOT NULL default '0',
 `z` float NOT NULL default '0',
 UNIQUE (`guid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Event teleport';
*/

 

P.S. nezapomente nahrat SQL tabulku ktera je naspodu scriptu, nemám čas to testovat (mám moic pomalý Pc) proto by se hdilo kdyby to někdo testnul

 

 

Changelog

v 0.2 - alpha:
* Added command #eventstatus with version info
* Added more debug Messages
* Improwed #eventstart
* Error Messages with numbers

------------------------------------------------
v 0.1 - alpha:
* Many updates from originall Spidey' post
* Many debug Messages for better bug hunting (rofl)

 

SVN: http://mmoforge.org/svn/yelly/Non-Blizzlike/

Edited by MesoX

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  

×