What's new

The Flame Gate [Sunwell, Emucoach V6, tested... with condition]

Titesusy

Veteran Member
134
2016
4
Location
France
Hi there! Reflecting on some sql Scripting (to prepare an event), I downloaded "Event Horizon" ("event horizon sai editor 121"). It's a helpful program to help Scripting gameobjects and creatures. I used it to "open" the flame gate, at Sunwell (near to Brutallus). But there is an incovenience... We need to "enable smartAI" with Tools button (with Event horizon program: "To fix it, Click 'Tools > Enable SmartAI' (or) Press CTRL+E on your keyboard."). So I wrote with the program help this script. But to work, it need to enable smartAI with the gameobject you choose as id (by default, 50002)

Documentation with an example how to use Event Horizon program : http://devsource-eventhorizon.blogspot.fr/

Code:
-- Modifiable starting here

SET @ENTRY := 50002;
SET @DISPLAY := 1327;

-- DO NOT MODIFY starting here (or at own risks)


-- Creation of the "button" of the flame gate from Sunwell (id=188075, guid=55387)
-- First, we create a generic "button" to active the door. For misunderstood reason, 
-- then I can't activate it itself, so I use a button ^^
-- In the second Insert, we put the "button" inworld, near to the flames gate


INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `data1`, `ScriptName`) VALUES (@ENTRY, '10', @DISPLAY, 'Button Door', '0', 'SmartGameObjectAI');

INSERT INTO `gameobject` (`guid`, `id`, `map`, `zone`, `area`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES (328704, 50002, 580, 4075, 4140, 1, 65535, 1531.15, 533.282, 30.1337, 4.32312, 0, 0, 0.830516, -0.556995, 300, 0, 1);


-- We script the opening thanks to "Event Horizon"
-- Generated by Event Horizon - SAI Editor (http://devsource-eventhorizon.tk/)

-- Button Door
SET  [MENTION=8308]Sour[/MENTION]CETYPE := 1; -- Gameobject=1, Creature=0

DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`  [MENTION=8308]Sour[/MENTION]CETYPE;
UPDATE gameobject_template SET AIName="SmartObjectAI" WHERE entry=@ENTRY LIMIT 1;
INSERT INTO `smart_scripts` (`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`) VALUES 
(@ENTRY  [MENTION=8308]Sour[/MENTION]CETYPE,0,0,64,0,100,1,0,0,0,0,9,0,0,0,0,0,0,14,55387,188075,0,0.0,0.0,0.0,0.0,"Button for the barrier of flame");
 
Last edited:

ExO

Admin
5,119
2014
1,639
Thanks for the contribution. If you want to improve your script(s), I can give you feedback and advice if you want :)

When you use an insert query like INSERT INTO `gameobject_template`, remember always to make DELETE FROM.. before it, so that it's runable again :) (Like you did with smart_scripts below)

Also, the script returns an error:
(@ENTRY @SourCETYPE, (Missing comma, but assuming that's just a typo) :)

You also forgot a = infront of the SourceType

Improved script in all:
Code:
[/COLOR]-- Modifiable starting here

SET @ENTRY := 50002;
SET @DISPLAY := 1327;


-- DO NOT MODIFY starting here (or at own risks)




-- Creation of the "button" of the flame gate from Sunwell (id=188075, guid=55387)
-- First, we create a generic "button" to active the door. For misunderstood reason, 
-- then I can't activate it itself, so I use a button ^^
-- In the second Insert, we put the "button" inworld, near to the flames gate


SET @ENTRY := 50002;
SET @DISPLAY := 1327;
DELETE FROM `gameobject_template` WHERE `entry` = @ENTRY;
INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `data1`, `ScriptName`) VALUES (@ENTRY, '10', @DISPLAY, 'Button Door', '0', 'SmartGameObjectAI');
DELETE FROM `gameobject` WHERE `guid` = 328704;
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zone`, `area`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES (328704, 50002, 580, 4075, 4140, 1, 65535, 1531.15, 533.282, 30.1337, 4.32312, 0, 0, 0.830516, -0.556995, 300, 0, 1);


-- We script the opening thanks to "Event Horizon"
-- Generated by Event Horizon - SAI Editor (http://devsource-eventhorizon.tk/)


-- Button Door
SET  [MENTION=8308]Sour[/MENTION]CETYPE := 1; -- Gameobject=1, Creature=0
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type` = [MENTION=8308]Sour[/MENTION]CETYPE;
UPDATE gameobject_template SET AIName="SmartObjectAI" WHERE entry=@ENTRY LIMIT 1;
INSERT INTO `smart_scripts` (`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`) VALUES 

(@ENTRY, [MENTION=8308]Sour[/MENTION]CETYPE,0,0,64,0,100,1,0,0,0,0,9,0,0,0,0,0,0,14,55387,188075,0,0.0,0.0,0.0,0.0,'Button for the barrier of flame');

All in all, good progress.
 

Titesusy

Veteran Member
134
2016
4
Location
France
Thanks for your feedback Exo! But there is a small bug with your script, you set 2 times @entry and @display. (the second time is useless I think).

By the way, I take your teaching preciously! I'll try to put delete when I do insertions in tables.
 

ExO

Admin
5,119
2014
1,639
Thanks for your feedback Exo! But there is a small bug with your script, you set 2 times @entry and @display. (the second time is useless I think).

By the way, I take your teaching preciously! I'll try to put delete when I do insertions in tables.

Weird, I don't recall doing it hah, must've messed up. That's what happens when you previously worked 8 hours in a row improving the repack before a new release.

And sounds good. Keep up the good work, and I don't mind promoting to you VIP (so you can get latest versions, keep even more up to date etc), if you are interested.
 

Titesusy

Veteran Member
134
2016
4
Location
France
For the first paragraph, yes, I know, that's why there were a missed coma (you correctly noticed previously).
About the "promotion"... As you wish! But yes, I would be proud to be vip :)


EDIT : I understand the missing about the variable "sourcetype" : infact, there is an user called Sour, when we put the variable mark "@" in front of Sourcetype, the forum is thinking about the user, and it cut the variable sourcetype .... If you check your script, you'll see :) "SET CETYPE := 1" for exemple...

Then, for users, with your help Exo, maybe we can set the script as (working in world only if you enable smartAI with event horizon):

Code:
-- Modifiable starting here

SET @ENTRY := 50002;
SET @DISPLAY := 1327;


-- DO NOT MODIFY starting here (or at own risks)




-- Creation of the "button" of the flame gate from Sunwell (id=188075, guid=55387)
-- First, we create a generic "button" to active the door. For misunderstood reason, 
-- then I can't activate it itself, so I use a button ^^
-- In the second Insert, we put the "button" inworld, near to the flames gate


DELETE FROM `gameobject_template` WHERE `entry` = @ENTRY;
INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `data1`, `ScriptName`) VALUES (@ENTRY, '10', @DISPLAY, 'Button Door', '0', 'SmartGameObjectAI');
DELETE FROM `gameobject` WHERE `guid` = 328704;
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zone`, `area`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES (328704, 50002, 580, 4075, 4140, 1, 65535, 1531.15, 533.282, 30.1337, 4.32312, 0, 0, 0.830516, -0.556995, 300, 0, 1);


-- We script the opening thanks to "Event Horizon"
-- Generated by Event Horizon - SAI Editor (http://devsource-eventhorizon.tk/)


-- Button Door
SET  @ID_SOURCE := 1; -- Gameobject=1, Creature=0
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type` = @ID_SOURCE;
UPDATE gameobject_template SET AIName="SmartObjectAI" WHERE entry=@ENTRY LIMIT 1;
INSERT INTO `smart_scripts` (`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`) VALUES 

(@ENTRY, @ID_SOURCE,0,0,64,0,100,1,0,0,0,0,9,0,0,0,0,0,0,14,55387,188075,0,0.0,0.0,0.0,0.0,'Button for the barrier of flame');
 
Last edited:
Top