Quest Rallying the Troops (12070)

Here’s an SAI I made so the quest Rallying the Troops so that it will work. Grizzly Hill Giant now gives credit for casting Shard of Earth on him.

(Hopefully I get the format right this time)…

[CODE]
– SAI for Grizzly Hill Giant for the quest Rallying the Troops
SET @ENTRYGIANT := 26261; – Grizzly Hill Giant
UPDATE creature_template SET AIname = ‘SmartAI’ WHERE entry=@ENTRYGIANT;
DELETE FROM smart_scripts WHERE entryorguid=@ENTRYGIANT AND source_type=0;
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
(@ENTRYGIANT,0,0,0,0,1,100,0,0,0,0,0,22,2,0,0,0,0,0,0,0,0,0,0,0,0,0,‘Grizzly Hill Giant - When in combat, become ready to accept buff from item Shard of Earth by switching to event phase 2.’),
(@ENTRYGIANT,0,1,2,8,2,100,0,47394,0,0,0,33,26261,0,0,0,0,0,7,0,0,0,0,0,0,0,‘Grizzly Hill Giant - Give rallied credit to the caster (for quest Ralleying the Troops) when hit with spell 47394.’),
(@ENTRYGIANT,0,2,0,61,2,100,0,0,0,0,0,22,4,0,0,0,0,0,0,0,0,0,0,0,0,0,‘Grizzly Hill Giant - Switch to event phase 4 so that it won't be affected by spell again and be ready to do the next part.’),
(@ENTRYGIANT,0,3,4,0,4,100,0,3000,3000,3000,3000,12,26786,1,120000,0,0,0,0,0,0,0,0,0,0,0,‘Grizzly Hill Giant - In event phase 4, summon a Iron Rune Avenger after 3s in combat.’),
(@ENTRYGIANT,0,4,0,61,4,100,0,0,0,0,0,22,1,0,0,0,0,0,0,0,0,0,0,0,0,0,‘Grizzly Hill Giant - After summoning a Iron Rune Avenger, reset back to event phase 1’),
(@ENTRYGIANT,0,5,0,1,0,100,0,0,0,0,0,22,1,0,0,0,0,0,0,0,0,0,0,0,0,0,‘Grizzly Hill Giant - Whenever out-of-combat, reset to event phase 1.’);

[/sql][/CODE]

Edited by Malcrom

I’m no SAI expert, so, there may be more wrong with this, but, the first thing to jump out at me was this:

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(@ENTRYGIANT,'0','1','2','8','2','100','0','47394','0','0','0','33','26261','0','0','0','0','0','7','0','0','0','0','0','0','0','Grizzly Hill Giant - Give rallied credit to the caster (for quest Ralleying the Troops).'); 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(@ENTRYGIANT,'0','0','0','1','0','100','0','0','0','60000','60000','22','2','0','0','0','0','0','0','0','0','0','0','0','0','0','Grizzly Hill Giant - Reset and become ready to accept buff from item Shard of Earth by switching to event phase 2.'); 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(@ENTRYGIANT,'0','2','0','61','0','100','0','0','0','0','0','22','1','0','0','0','0','0','7','0','0','0','0','0','0','0','Grizzly Hill Giant - Switch back to event phase 1 so that it won\'t be affected by spell again.'); [/sql]

should be this:

[sql]
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
(@ENTRYGIANT,‘0’,‘1’,‘2’,‘8’,‘2’,‘100’,‘0’,‘47394’,‘0’,‘0’,‘0’,‘33’,‘26261’,‘0’,‘0’,‘0’,‘0’,‘0’,‘7’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘Grizzly Hill Giant - Give rallied credit to the caster (for quest Rallying the Troops).’),
(@ENTRYGIANT,‘0’,‘0’,‘0’,‘1’,‘0’,‘100’,‘0’,‘0’,‘0’,‘60000’,‘60000’,‘22’,‘2’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘Grizzly Hill Giant - Reset and become ready to accept buff from item Shard of Earth by switching to event phase 2.’),
(@ENTRYGIANT,‘0’,‘2’,‘0’,‘61’,‘0’,‘100’,‘0’,‘0’,‘0’,‘0’,‘0’,‘22’,‘1’,‘0’,‘0’,‘0’,‘0’,‘0’,‘7’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘0’,‘Grizzly Hill Giant - Switch back to event phase 1 so that it won’‘t be affected by spell again.’);
Also, numbers should not have quotes around them, but, I didn’t feel like doing that much editing…

Next time, before you post a fix, be sure to read the stickies (pinned topics) and compare yours to a few of Malcrom’s and, if you see something different, it is very likely you did something wrong.

Ah, yeah sorry. I forgot to capitalize those after dumping them from sqloyd. I’ll reedit them then.

I believe credit is to only be granted when giants are in combat.

I would like to suggest:

[CODE]

– SAI
DELETE FROM smart_scripts WHERE entryorguid IN (26261,2626100);
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
(26261,0,0,0,1,0,100,0,0,0,60000,60000,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Grizzly Hill Giant - Reset and become ready to accept buff from item Shard of Earth by switching to event phase 2.’),
(26261,0,1,0,8,2,100,0,47394,0,0,0,80,2626100,0,1,0,0,0,1,0,0,0,0,0,0,0, ‘Grizzly Hill Giant - On spellhit while in combat, run script’),
(2626100,9,0,0,0,0,100,0,0,0,0,0,33,26261,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘Grizzly Hill Giant - Give rallied credit to the caster for quest Rallying the Troops’),
(2626100,9,1,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Grizzly Hill Giant - Switch back to event phase 1 so that it won’‘t be affected by spell again.’);

[/sql][/CODE]

You didn’t combine the queries, which actually makes them faster, and easier to read.

Remove the spacing between the field names, and make it one query like Paradox said.

– Brian

what happened to the sql guidelines /emoticons/default_sad.png

Sorry /emoticons/default_sad.png , I mis-read the guidelines and so now it’s trail and error.

I’ve redone the sql again, and I also added Wispeckt’s idea. I also re-read wowhead’s comments and made it so that a Rune Avenger comes out. (He’s suppose to “pop out of the ground”, but I don’t know how to do that so I had it summon instead).

Much better /emoticons/default_smile.png

Where did you read that he is supposed to “pop out of the ground”? I have never seen a spawn on offy “pop out of the ground”…

However, it is possible with the point movement generator. Basically you would spawn him below ground and then change his Z coordinates until he was where you wanted him. I am not sure if SAI has point movement though…

– Brian

It’s probably a spell, like in this example (Submerge Visual): http://www.trinitycore.org/f/index.php?/topic/1304-wip-sai-for-crust-burster/

http://www.trinitycore.org/f/index.php?/topic/2588-sql-guidelines/ everyone is welcome to read (and follow) it

Wouldn’t this do the same?

-- SAI for Grizzly Hill Giant for the quest Rallying the Troops SET @ENTRYGIANT := 26261; -- Grizzly Hill Giant UPDATE `creature_template` SET `AIname` = 'SmartAI' WHERE `entry`=@ENTRYGIANT; DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRYGIANT AND source_type=0; 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 (@ENTRYGIANT,0,0,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grizzly Hill Giant - When in combat, become ready to accept buff from item Shard of Earth by switching to event phase 1.'), (@ENTRYGIANT,0,1,2,8,1,100,0,47394,0,0,0,33,26261,0,0,0,0,0,7,0,0,0,0,0,0,0,'Grizzly Hill Giant - Give rallied credit to the caster (for quest Ralleying the Troops) when hit with spell 47394.'), (@ENTRYGIANT,0,2,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grizzly Hill Giant - Switch to event phase 2 so that it won\'t be affected by spell again and be ready to do the next part.'), (@ENTRYGIANT,0,3,4,0,2,100,0,3000,3000,3000,3000,12,26786,1,120000,0,0,0,1,0,0,0,0,0,0,0,'Grizzly Hill Giant - In event phase 2, summon a Iron Rune Avenger after 3s in combat.'), (@ENTRYGIANT,0,4,0,61,2,100,0,0,0,0,0,78,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grizzly Hill Giant - After summoning a Iron Rune Avenger, reset script');[/sql]

Thanks for the link, Nay, and thanks Malcrom for editing! It works the same way as before, but with less lines.

I got my sources from the wowhead comment. People said a drill is suppose to come out and then the dwarves come out. I wasn’t sure how to do that, so I had it just summon the dwarf.

The drill is a spell targeted to a location.