[Release] Custom "portal" NPCs for TrinityCore menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Venomheart's Avatar Member
    Reputation
    1
    Join Date
    Sep 2010
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Release] Custom "portal" NPCs for TrinityCore

    Since Area Triggers are hard-coded into the client (f**k off, Blizztards), instead of hunting for unused area triggers for custom teleports, I decided to create an area-based NPC that looks and functions like a portal using SmartAI scripts.

    First, the SQL code for the creature itself. Once it's in the SQL database, you can (of course) change the model.

    Code:
    INSERT INTO `creature_template` (`entry`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `faction_A`, `faction_H`, `speed_walk`, `speed_run`, `unit_class`, `unit_flags`, `AIName`) VALUES (5551218, 26496, 26496, 26496, 26496, 'Portal to Stormwind', 1, 1, 0.000001, 0.000001, 1, 6, 'SmartAI');
    SELECT `entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction_A`, `faction_H`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `dmg_multiplier`, `baseattacktime`, `rangeattacktime`, `unit_class`, `unit_flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `Health_mod`, `Mana_mod`, `Armor_mod`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `WDBVerified` FROM `creature_template` WHERE  `entry`=5551218;
    The second SQL code was the pain to figure out. It had to auto-trigger when the NPC came within a certain distance, not move and always work.

    Code:
    INSERT INTO `smart_scripts` (`entryorguid`, `event_type`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `target_param1`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (5551218, 10, 1, 2, 2, 2, 62, 8, -8474.02, 1345.12, 5.3701, 4.73895, 'Portal NPC to Stormwind Harbor');
    SELECT `entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment` FROM `smart_scripts` WHERE  `entryorguid`=5551218 AND `source_type`=0 AND `id`=0 AND `link`=0;
    The only things that would need to be changed for each new "portal" are the entry ID (which has to ALWAYS be the same as the character entry), the distance the character has to be from the "portal"/NPC (which is, in meters, 2, 2, 2), the coordinates including orientation (-8474.02, 1345.12, 5.3701, 4.73895 will put you on Stormwind Harbor on one of the docks facing Stormwind) and, if you'd like, the comments.

    Once the "portal" NPC is placed, you can change the Unit Flags in character_template to 33554432 (which makes it untargetable), .reload character_template and .respawn (or restart the server if you want to play it safe). This should work for any recent TrinityCore release.

    [Release] Custom "portal" NPCs for TrinityCore-wowscrnshot_041314_174539-jpg

    [Release] Custom "portal" NPCs for TrinityCore
  2. #2
    Valkryst's Avatar Active Member
    Reputation
    62
    Join Date
    Apr 2014
    Posts
    41
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Seems like a good release, I'm about to test it in a minute. The only issue that I can see which will arise is that there's nowhere to specify the map to teleport to.

    Edit:
    Did a bit of Googling and it seems that target_param1 is the mapID. I'm about to go test this, I'll reply back with my findings.

    Edit 2:
    After running the query below and then spawning the NPC in-game, restarting the server, and then walking beside the NPC nothing happened. I'll be trying a few different queries and that soon, I'll get back with my results.

    Code:
    SET @NPC_ENTRY_ID := 80000;SET @NPC_NAME := "Overworld to Underworld Vaults";
    SET @TELE_TO_MAP := 289;
    SET @TELE_TO_X := 186.154663;
    SET @TELE_TO_Y := 126.231956;
    SET @TELE_TO_Z := 139.876190;
    SET @TELE_TO_O := 3.164552;
    SET @PORTAL_SIZE := 4;
    
    
    INSERT INTO `creature_template` (`entry`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `faction_A`, `faction_H`, `speed_walk`, `speed_run`, `unit_class`, `unit_flags`, `AIName`) VALUES (@NPC_ENTRY_ID, 26496, 26496, 26496, 26496, @NPC_NAME, 1, 1, 0.000001, 0.000001, 1, 33554432 , 'SmartAI');
    INSERT INTO `smart_scripts` (`entryorguid`, `event_type`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `target_param1`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (@NPC_ENTRY_ID, 10, 1, @PORTAL_SIZE, @PORTAL_SIZE, @PORTAL_SIZE, 62, @TELE_TO_MAP, @TELE_TO_X, @TELE_TO_Y, @TELE_TO_Z, @TELE_TO_O, @NPC_NAME);
    Edit 3:
    After even more testing I haven't managed to get this working. The information in my first edit about target_param1 is probably incorrect, but I honestly have no idea. =/
    Last edited by Valkryst; 04-20-2014 at 08:34 PM.

Similar Threads

  1. [Release] Custom Portal Creater!
    By LordDarkling in forum WoW EMU Programs
    Replies: 54
    Last Post: 01-12-2009, 11:24 PM
  2. Make custom portals/ Warp NPC (with program)
    By controlsx2 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 05-05-2008, 06:07 AM
  3. [Release] Custom Portal Creater!
    By LordDarkling in forum World of Warcraft Bots and Programs
    Replies: 5
    Last Post: 03-28-2008, 10:28 AM
  4. [RELEASE] Insanely Useful Quest NPC For PvP/Fun Servers
    By Xeneth in forum World of Warcraft Emulator Servers
    Replies: 14
    Last Post: 01-11-2008, 01:48 PM
  5. [Release]City Teleport NPC for Antrix
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 12-18-2007, 08:38 AM
All times are GMT -5. The time now is 05:46 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search