Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 1 of 1
  1. #1
    Graphics Guru

    Join Date
    Feb 2009
    Posts
    1,377
    Post Thanks / Like
    Rep Power
    22
    Reputation
    382

    [Trinity] How to Create SQL Gossip Teleport NPC (2013)


    Register to remove this ad
    Quote Originally Posted by shadowraider
    Hello, I tried to find a guide How to make teleport NPC via SQL, that will work with the latest Trinity DB. My searching was unsuccessful. So i decided to make a new one by myself.
    Quote Originally Posted by shadowraider
    I will show you how to make Teleport NPC from the scratch via SQL step-by-step.

    What we need:

    1.) Trinity Compiled Server or Repack (If you want to test the Teleport NPC by yourself)
    2.) Trinity Database (version 335.52) >>> DOWNLOAD
    3.) SQL Editor Tool - I use SQLyog, but you can also use HeidiSQL or Navicat or whatever, it doesn't really matter. >>>DOWNLOAD SQLyog
    4.) Truice - Trinity database tool for creating NPCs, Items, Quests, GObjects. >>>DOWNLOAD
    5.) Event Horizon - Smart AI creating and editing tool. Very user-friendly interface.>>>DOWNLOAD


    Okay, so let's say that you have all the things installed, your SQL server is running and you are ready to go. So we can begin.


    Step 1 - Create NPC

    At first you must create the NPC, which will teleport you. Open the Truice and connect to your database. At the top of the window which appeared, click on the "Creature" tab.

    Now at the bottom of the window click on "New Creature"

    Suddenly, a wild window with many boxes appeared. You don't need to understand them all, all you need to change is below.

    Now take a look at the numbers, which you need to change.

    1 - Entry - Use an empty entry in your database.
    2 - Name - Use name on your own.
    3 - Model ID - This is how the creature will look like. For example, display id of Medivh is 18718. You can find the NPC's display id by typing ".npc info"
    4 - Level - It doesn't really matter what level you use.
    5 - Unit Class - Set it to 1 (warrior) to prevent DB errors.
    6 - Faction - This is how the creatures reacts to each other and to players. Set both faction_A and faction_H to 35, so the creature will be friendly to both factions.
    7 - NPC Flag - Set it to 1, so the creature can use gossip.
    8 - Unit Flag - Set it to 4, so the creature will not move.
    9 - AI Name - Set it to SmartAI, so the creature can use Smart AI.
    10 - Gossip Menu ID - Set it to 60000, I will explain this later. (ID 60000 should be empty by default in DB)

    Now click in the right bottom corner at "Show Creature Template Script". Now you can manually copy-paste the script into your SQLyog or whatever you use or just click "Execute Script" in the right bottom corner and this will copy the NPC into your database. You should see a massage "Script executed successfully". If you don't, then you probably typed something wrong.

    We are done with creating NPC. Now open your SQLyog or whatever you use.

    Step 2 - Create Gossip

    1.) At first we must create, what will the creature say, when you right-click on it.
    In SQLyog or whatever you use, open npc_text table, insert a new row with ID 60000 and text0_0 write whatever you want. In SQLyog, you have to uncheck the "Set Null" in the text window to start typing.

    2.) Now open the gossip_menu table. This table connects the creature_template with the gossip. Insert a new row with entry which you wrote to truice (60000) and text_id is the id from npc_text table, so set it to 60000.
    Now the creature will say the text when you right-click on it.

    Step 3 - Create Gossip Options

    Open the gossip_menu_option table and insert new row.

    menu_id is the id from gossip_menu table, set this to 60000. If you want to create more gossip options at 1 NPC, they will all have the same number.

    id is the unique number according to each menu_id, set this to 1. If you want to create more gossip options at 1 NPC, they will all have a unique number. If you want to create next gossip option, then the number will be 2, if next, the number will be 3 and so on........



    option_icon is what the gossip_option icon will look like, here are some of them:

    Code:
    White chat bubble - 0
    Code:
    Brown bag - 1
    Flight - 2
    Book - 3
    Interaction wheel - 4
    Interaction wheel - 5
    Brown bag with yellow dot - 6
    White chat bubble with black dots - 7
    Tabard - 8
    Two swords - 9
    Yellow dot - 10
    option_text is what the gossip option says. We will create a teleport to Stormwind, so write something like "Teleport to Stormwind!"

    option_id - I can't explain this, set it to 1.

    npc_option_npcflag - Set this to 1 too.


    Now you have the gossip_option on which you can click. But since it's only option, it will don't do anything, so we need to add a teleport script to it.


    Step 3 - Create Teleport Script

    Open the Event Horizon and connect to your DB.

    1.) Write the Entry of the Teleport NPC to the upper left corner. When it loads, make sure that the text under the NPC name is green and says "Smart AI is enabled" or the teleport will dont work.

    2.) Click on Prepare New. Script Description is only for description, it does not affect how the script will work. Write something like Teleport to Stormwind!

    3.) In On Event box choose GOSSIP_SELECT (or write 62 where is 0), so the script will be execute when you click on gossip. Now the 2 options in the right part appeared. We must set on which gossip option will the script execute. Menu Id is the menu_id from gossip_menu_option table, set it to 60000. Action ID is the id from gossip_menu_option, set it to 1

    4.) In Do Action box choose TELEPORT (or write 62 where is 0), so when you click the gossip, it will teleport you. Now in the right part 1 option appeared. Map ID is the id if the map to which you want to teleport. You can find the Map ID by typing .gps in game.
    HTML Code:
    Eastern Kingdoms - 0
    Kalimdor 1
    Outland 530
    Northrend 571.


    5.) In At Target box choose ACTION INVOKER (or write 7 where is 0), so when you click the gossip, it will teleport the player who clicked on the gossip (you). Now you must write the teleport coordinates somewhere. The X Y Z coordinates + orientation will be written to the last 4 boxes in the right part (Target Tab). Take a look at THIS. The coordinates of Stormwind (Trade District) are X: -8832 Y: 630 Z: 94 Orientation: 0

    Orientation is: North - 0 West - 1,5 South - 3 East - 4,5

    6.) Now click on Save New and the script should appear in the big box with title "Teleport to Stormwind" or whatever you typed to description. The script is now saved to your DB (smart_scripts table)

    Now restart your server and try if it works. If not, then check every step you made.


    Adding More Teleports

    If you want to add more teleports to the Teleport NPC, then follow these steps.


    1.) Insert new row into gossip_menu_option , since we want create more teleports in this menu, the menu_id will be 60000.

    The id must be unique with each menu_id, so if you set "Teleport to Stormwind" id 1, then this id will be 2.

    Set text to whatever you want, it depends on the teleport destination.

    Dont forget to set the option_id and npc_option_npcflag to 1 or your gossip will not work.


    2.) Head to the Event Horizon, open the Teleport NPC if you already dont have.

    Then click on the "Teleport to Stormwind" script in the big white box, then click to Duplicate.

    Now in the "Parameters" Part, Event tab change Action ID to 2, since you want to create script for the second gossip option.

    Click on the Action tab and set the Map ID.

    Then click on Target tab and change current coordinates to desired coordinates where you want to teleport.

    Now click on the Save New, if you clicked on Duplicate before changing these datas, it should create a new script. If you did not, you will edit the current script.

    Now restart your server and try if this one works too.


    This guide was created by ShadowRaider


    › See More: [Trinity] How to Create SQL Gossip Teleport NPC (2013)
    Last edited by Wise; 12-10-13 at 10:13 PM.



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

 

 

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!
SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 07:02 AM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org