This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: (Workaround) That stupid portal problem I had?  (Read 2387 times)

NewGotham

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 14
    • View Profile
(Workaround) That stupid portal problem I had?
« on: April 14, 2014, 12:53:18 am »
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: [Select]
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: [Select]
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 (possibly MaNGOS but I haven't used them since about 2009).

Enjoy! ^_^
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

iindigo

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 198
    • View Profile
Re: (Workaround) That stupid portal problem I had?
« Reply #1 on: April 14, 2014, 02:38:46 am »
Nice workaround. For quite some time, Blizzard did something similar with the Stormwind Wizard’s Sanctum portal; when passing through, you could occasionally see a hidden NPC targeting you to cast a teleport, so the method has official precedence.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

kojak488

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 351
    • View Profile
Re: (Workaround) That stupid portal problem I had?
« Reply #2 on: April 14, 2014, 07:47:22 pm »
Area triggers are hard coded into the client?  I'm almost certain I've used areatrigger teleport in the db with the areatrigger.dbc to create area trigger portals.  They were buggy with the box sizes, but it worked.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Laduguer

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 144
    • View Profile
Re: (Workaround) That stupid portal problem I had?
« Reply #3 on: April 14, 2014, 08:55:41 pm »
This sounds very useful, thanks for sharing. Is the process as straight forward as this, or do I need to do any additional scripting?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

NewGotham

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 14
    • View Profile
Re: (Workaround) That stupid portal problem I had?
« Reply #4 on: April 14, 2014, 11:38:26 pm »
Quote from: "kojak488"
Area triggers are hard coded into the client?  I'm almost certain I've used areatrigger teleport in the db with the areatrigger.dbc to create area trigger portals.  They were buggy with the box sizes, but it worked.

There's a few "blank" ones coded into the client that the core can use but after that, you're kinda hosed. Adding portals to all the custom content (and we should ALL have CONTINENTS worth of places) would burn through several times what's available.

Quote from: "Laduguer"
This sounds very useful, thanks for sharing. Is the process as straight forward as this, or do I need to do any additional scripting?

It really is that simple - just change the coordinates (and the model, if you'd like) and you're set.

Keeping it at level 1 means it won't be aggro'd by EVERYTHING. You may need to change the faction but that's iffy - the important thing is that you can "aggro" it and any nearby NPCs DON'T aggro it. Most of them will be a certain faction template so you can use the nearby faction template to make it "friendly" to them but not to you (so it'll "aggro" and teleport you). That's essentially all it is - an aggro-based creature that teleports you instead of attacks.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Senix

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 7
    • View Profile
Re: (Workaround) That stupid portal problem I had?
« Reply #5 on: February 05, 2018, 03:18:34 pm »
its not worked :/

Jøk3r

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 544
    • View Profile
Re: (Workaround) That stupid portal problem I had?
« Reply #6 on: February 06, 2018, 07:31:16 am »
Could you please specify what isn't working?
What have you done in order to get this working?

In order to help someone, information is needed^^
I don't like Noggit... I LOVE it :D
If you have any question about Noggit, feel free to contact me. I will give my best to help you (:

Senix

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 7
    • View Profile
Re: (Workaround) That stupid portal problem I had?
« Reply #7 on: February 07, 2018, 01:33:24 pm »
The complete script is not working dude... first this script is outdated so and if i understand it right this script is for a other way to make own Dungeon Entry like blizzard with Areatrigger.dbc run - and port portal nothing to click or interact with a gossip menu.. if i run to the portal /npc with this script nothing happen...
So i cant tell you more information
But here are the creature_template and smart_scripts template maybe u can use it^^
creature_template

Quote
5551218   0   0   0   0   0   26496   0   0   0   Teleporter         0   1   1   0   1   1   1   1,14286   1   0   0   0   0   1   1   1   6   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   SmartAI   0   3   1   1   1   1   1   1   0   0   1   0   0   0      12340

smart_scripts

Quote
5551218   0   0   0   9   0   100   0   2   5   10   10   0   62   738   0   0   0   0   0   18   8   0   0   11950   11685,6   -68,3542   2,26564