Hello everyone. I have created a custom NPC (C++ based), that could be of use on funservers. The NPC has the ability to teleport you (malls locations added too, you can edit them anyway), advance you to level 80, maximize weapon skills, give you golds, give you some nice mounts, heal you, and remove ressurection sickness. The NPC will not talk to you if you are in combat, so the healing ability can't be used by players who are in combat (for e.g, when you duel).
What TrinityCore is required to build the script: rev. 10686+(may be compatible with older versions too, but I wouldn't recommend).
Database required to import the SQL file: Successfully imported in TDB 335.11.35, updated to revision 10681(see sql/updates folder from the cloned trinity source).Must be compatible with other Databases that support TrinityCore 10686+.
Adding the script: first, get a new clone of trinity. If you don’t know how, you can find useful info here: Main Page - TrinityCore. Make sure trinity core is ready for compile. Add “universal_teleporter.cpp” to your “scripts” project (which is included in trinitycore solution). This step is different because every IDE is different. For e.g, in VC++ 2010 you would expand “scripts” project, right click on Source Files, then Add->Existing Item. Browse “universal_teleporter.cpp” and press “add”. You can even simply add a new file to your “scripts” project, call it “universal_teleporter.cpp” (e.g), then copy the code from my “universal_teleporter.cpp” into the freshly created file. After you’ve added this file, find up “ScriptLoader.cpp”
(you can find it through the source files of project "game" from trinityCore solution). Open it, and browse this (should be at the bottom of the file):
Code:
#ifdef SCRIPTS
/* This is where custom scripts' loading functions should be declared. */
#endif
Modify it so it looks like this:
Code:
#ifdef SCRIPTS
/* This is where custom scripts' loading functions should be declared. */
void AddSc_Script_UTeleporter();
#endif
Then, right below, you will find:
Code:
void AddCustomScripts()
{
#ifdef SCRIPTS
/* This is where custom scripts should be added. */
#endif
}
Modify it so that AddCustomScripts will call AddSc_Script_UTeleporter():
Code:
void AddCustomScripts()
{
#ifdef SCRIPTS
/* This is where custom scripts should be added. */
AddSc_Script_UTeleporter();
#endif
}
And that was it. Now, you should be able to compile your project with no problems.
Ingame, type .npc add 643409 to spawn the NPC.
How to edit mall locations: this step involves to edit “universal_teleporter.cpp”. Open up the file, and search for:
Code:
case GOSSIP_ACTION_INFO_DEF + 175:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->TeleportTo(1, 7487.8f, -1542.39f, 159.899f, 3.72276f);
break;
This represents the code that handles the teleport to Horde Mall. The line of interest is obviously
Code:
pPlayer->TeleportTo(1, 7487.8f, -1542.39f, 159.899f, 3.72276f);
The first parameter is mapID (0 for Eastern kingdoms, 1 for kalimdor, etc ..). The next three parameters represents the player position, X, Y and Z, and the last one represents the player orientation. In order to get new coordinates, log in, find your new mall location, type in .gps, and the command will bring up info, like mapID, player location X, location Y, location Z, and orientation. Write these down on paper, then edit
Code:
pPlayer->TeleportTo(1, 7487.8f, -1542.39f, 159.899f, 3.72276f);
with your values: for e.g if .gps brings up: mapID = 0, X = -3411.33, Y = 983.111, Z = -451.34 and orientation = 3.44444, the line would become:
Code:
pPlayer->TeleportTo(0, -3411.33f, -983.111f, -451.34f, 3.44444f);
The code that handles teleport to Alliance mall is right below:
Code:
case GOSSIP_ACTION_INFO_DEF + 176:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->TeleportTo(1, -10746.9f, 2426.58f, 6.28456f, 1.10739f);
break;
No need for more explanation. Same rule. Replace parameters of TeleportTo with your own if you want mall location to be changed.
Remember that after modifying anything to „universal_teleporter.cpp” you must recompile the core, then copy the new worldserver.exe to your default server files.
I will constantly update this so it will be compatible with the latest TrinityCore. I will also add more features to the NPC in time. Have fun!
Changelog:
-v1.0 - Initial release
-v1.1 - Added new menus:
- you can now get the maximum riding skill using the NPC
- you can get emblems (frost/valor/...) using the NPC
- you can get honor/arena points using the NPC
-v1.2 - Added menus:
- you can now learn max. profession skills using the NPC
-v1.3 - you can learn max. profession skill for cooking/first aid using the NPC
Ingame pics of the NPC:
NPCMainMenu
picture1
picture2
picture3
picture4
picture5
picture6
picture7
picture8
picture9
>>> DOWNLOAD LATEST VERSION <<<