# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # Dynamic Teleporter ( v1.0 ) # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

Dynamic Teleporter at first glance normal GossipMenu - based - teleporter as we all know . But something is different. GossipMenu locations and teleports are recorded in the DB and then read the script , which creates menus , sub - menus and ports according to records in the database . However, the database does not search every time you open gossip , but is loaded only once and kept in memory. Gamemaster additionally have the option gossipmenu " RELOAD ~ ~ " , which reloads the items from the database .

You need to change some location ? To remove or completely remodel Teleporter ? Not a problem , handle it WHILE SERVER ! : the great right? wink : Beach : For as long as you edit DB Teleporter will still be available teleporter with old data until you perform ~ ~ RELOAD through gossip menus ( figure GM and GM enabled ) ..

So to summarize it :
adjustment menu and locations are doing in our database
no other compilations for changes
no server restart
no casting new kernel
expansion options for multiple functions ? Well , about something we will talk later ..

I hope that you are enticing enough, so let's go to work. smile

This script has ScriptName "dynamic_teleporter" and can be used not only for NPC, but also GameObject! wink
So again. The only SCRIPTNAME one single script and is useful for NPC and GameOBJECT. wink You're welcome ..: P

SQL: Dynamic_teleporter `table` (belongs to the world DB):
/*Table structure for table `dynamic_teleporter` */

CREATE TABLE `dynamic_teleporter` (
  `entry` int(11) unsigned NOT NULL,
  `menu_parent` int(11) unsigned NOT NULL DEFAULT '0',
  `menu_sub` int(11) NOT NULL DEFAULT '-1',
  `icon` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `faction` int(11) unsigned NOT NULL DEFAULT '0',
  `name` char(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `map` smallint(5) unsigned NOT NULL DEFAULT '0',
  `position_x` float NOT NULL DEFAULT '0',
  `position_y` float NOT NULL DEFAULT '0',
  `position_z` float NOT NULL DEFAULT '0',
  `position_o` float NOT NULL DEFAULT '0',
  PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;


SCRIPT: (presumed location: src / server / scripts / Custom / dynamic_teleporter.cpp)
http://pastebin.com/N3pW5J0L

Dynamic Teleporter Manager:  Create a new file: src / server / game / DynamicTeleportMgr.h
http://pastebin.com/01bp1LxJ

Create a new file: src / server / game / DynamicTeleportMgr.cpp
http://pastebin.com/srtPXURD

Update file WORLD.CPP (due to errors on Linux)
file: src / server / game / World.cpp
From roughly the beginning of the file, add include:  #include "DynamicTeleportMgr.h" // WLK - DYNAMIC TELEPORTER

Next, add a few lines almost to the end of the method void World :: SetInitialWorldSettings ()
    // Delete all characters which have been deleted X days before
    Player::DeleteOldCharacters();
+
+    // WLK - DYNAMIC TELEPORTER
+    sLog.outString("Loading Dynamic Teleporter...");
+    sDynamicTeleportMgr->Init();

    sLog.outString("WORLD: World initialized");
}



Explanation of table `dynamic_teleporter`

`entry`         
`menu_parent`   
`menu_sub`     
`icon`         
`faction`       
`name`         
`map`           
`position_x`   
`position_y`   
`position_z`   
`position_o`   


ID menu. Must be unique, it's primary key.

ID menu, to which the item belongs. Main menu always has id 0

ID menu item that invokes landing. If the value is -1, so will teleport.

ID icon that appears in the gossip menu.

ALLIANCE = 469; HORDE = 67; NEUTRAL (both) = 0

Heading. This text is displayed in the gossip menu. ID maps of target locations

Target position X

Target position Y

Target position Z

Orientation (rotation) after the teleport. (North = 0, South = 3.14159)

I'm working on teleport locations now so I'll post it here afterwards.

Mid or Feed, Dondo The Supamida!

This is cool. Nice work.

IT gives me error when recompile hmm ?