1 (edited by LordUsagi 2015-12-04 04:07:55)

I have recently created a branch for testing SmartAI. This is heavily backported from TrinityCore, big thanks to them for all the hard work. A big thank you to mathman for taking the time to backport this code to OregonCore. Hopefully it helps us move forward with PvE content.

This thread is THE PLACE to talk about anything related to SmartAI. ALL issues should be posted here, with a thorough description of the problem as well as a script to test.

All SmartAI scripts from TrinityCore should work out of the box, and if that is not the case then it is a bug and should be reported as such.

Here is a centralized list of all SmartAI bugs we've come across and tested scenarios that work.

Bugs

Increased Resources
Apparently, and I can't confirm, but users have reported increased lag using the SmartAI branch.

NPC Stuck
If an NPC with sSmartAI is on its way to enemy, and enemy die before it reach. NPC become stuck.

NPC text
If no NPC text present for a SmartAI script. SmartAI script will break.

Working Scripts
-- Fix D.I.S.C.O Object. Doesn't fix summoning issue though.
SET @Disco         :=190351;
UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` IN (@Disco);
DELETE FROM `smart_scripts` WHERE `entryorguid`=@Disco AND `source_type`=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 
(@Disco, 1, 0, 0, 64, 0, 100, 0, 0, 0, 0, 0, 85, 50493 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Disco - On gossip hello - cast Listening to Music');

DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (-50314, -50493, 50493);
INSERT INTO `spell_linked_spell` VALUES 
(-50314, -50493, 0, 'Disco Ball'),
(-50493, -50314, 0, 'Disco Ball(Listening to Music)'),
(50493, 50314, 0, 'Disco Ball(Listening to Music)');

Fixes Raptor Captor - Closes issues #878

-- Bloodfen Raptor SAI
DELETE FROM smart_scripts WHERE entryorguid IN (4351, 4352);
INSERT INTO smart_scripts VALUES
(4351,0,0,0,8,0,100,0,42325,0,0,0,11,42337,0,0,0,0,0,7,0,0,0,0,0,0,0,"Bloodfen Raptor - On Spellhit 'Capture Raptor' - Cast 'Raptor Capture Credit' (Phase 1) (No Repeat)"),
(4351,0,1,0,2,0,100,1,0,20,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Bloodfen Raptor - Between 0-20% Health - Say Line 0 (Phase 1) (No Repeat)"),
(4352,0,0,0,8,0,100,0,42325,0,0,0,11,42337,0,0,0,0,0,7,0,0,0,0,0,0,0,"Bloodfen Screecher - On Spellhit 'Capture Raptor' - Cast 'Raptor Capture Credit' (Phase 1) (No Repeat)"),
(4352,0,1,0,2,0,100,1,0,20,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Bloodfen Screecher - Between 0-20% Health - Say Line 0 (Phase 1) (No Repeat)");

-- Texts
DELETE FROM `creature_text` WHERE `entry` IN (4351,4352);
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(4351,0,0,"%s looks weak enough to capture.",16,0,100,0,0,0,"Bloodfen Raptor"),
(4352,0,0,"%s looks weak enough to capture.",16,0,100,0,0,0,"Bloodfen Screecher");

Fixes Razormaw - Closes issues #1111

-- Razormaw SAI fixes quest 9689 - Doesnt fix summoning tho
SET @ENTRY  := 17592;
UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`) VALUES (@ENTRY,50331648,1);
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
(@ENTRY,0,0,0,0,0,100,0,6000,6000,7000,9000,11,31279,0,0,0,0,0,2,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Swipe'),
(@ENTRY,0,1,0,0,0,100,0,26000,30000,26000,30000,11,8873,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Flame Breath'),
(@ENTRY,0,2,0,0,0,50,0,12000,12000,12000,12000,11,14100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Terrifying Roar'),
(@ENTRY,0,3,0,11,0,100,0,0,0,0,0,53,1,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - On spawn - Load Path'),
(@ENTRY,0,4,0,40,0,100,0,10,@ENTRY,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - On Reach waypoint - Remove unitflag');
-- Waypoints for Razormaw
DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY);
INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
(@ENTRY,1,-1045.958,-12583.85,111.7434, 'Razormaw'),
(@ENTRY,2,-1045.115,-12583.31,111.7434, 'Razormaw'),
(@ENTRY,3,-1213.006,-12663.19,200.4278, 'Razormaw'),
(@ENTRY,4,-1204.485,-12626.66,200.4278, 'Razormaw'),
(@ENTRY,5,-1204.906,-12599.65,188.7889, 'Razormaw'),
(@ENTRY,6,-1206.845,-12579.84,173.2892, 'Razormaw'),
(@ENTRY,7,-1203.169,-12555.49,160.956, 'Razormaw'),
(@ENTRY,8,-1201.284,-12529.25,134.3167, 'Razormaw'),
(@ENTRY,9,-1204.178,-12483.84,115.039, 'Razormaw'),
(@ENTRY,10,-1204.349,-12465.61,104.7762, 'Razormaw'),
(@ENTRY,11,-1205.651,-12460.52,97.53908, 'Razormaw');
UPDATE creature_template SET InhabitType=4, unit_flags=64 WHERE Entry=17592;
DELETE FROM `smart_scripts` WHERE `entryorguid`=17592 AND `source_type`=0 AND `id`IN(5, 6, 7);
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
(17592, 0, 5, 6, 40, 0, 100, 0, 10, 17592, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Razormaw - On Waypoint 10 Reached - Set Home Position'),
(17592, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Razormaw - On Waypoint 10 Reached - Set Agressive'),
(17592, 0, 7, 0, 11, 0, 100, 0, 0, 0, 0, 0, 18, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Razormaw - On Respawn - Add unit_flag');

lord, this is now ready to be tested fully with latest revision?? since i saw you merged the branch into the repo.?

-- Set Proper fation for Defias Raider
UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,   WHERE `entry`=6180;

UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry`=6182;
UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry`=6180;

DELETE FROM `smart_scripts` WHERE `entryorguid`=6180 AND `id` IN (3,4) 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
(6180,0,3,0,6,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,6182,100,0,0,0,0,0,'Defias Raider - On Death Set Data 1 1'),
(6180,0,4,0,11,0,100,0,0,0,0,0,49,0,0,0,0,0,0,19,6182,100,0,0,0,0,0,'Defias Raider - On Respawn - Attack Start');

DELETE FROM `smart_scripts` WHERE `entryorguid`=6182 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
(6182,0,0,1,19,0,100,0,1651,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On Accepted Quest ''The Tome of Valor'' - Say Line 0'),
(6182,0,1,2,61,0,100,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Store Target List'),
(6182,0,2,3,61,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Remove npcflag ''Quest Giver'''),
(6182,0,3,4,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Set Event Phase to 1'),
(6182,0,4,0,61,0,100,0,0,0,0,0,53,1,6182,0,0,0,2,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Start WP Movement'),
(6182,0,5,0,40,0,100,0,5,6182,0,0,80,618200,2,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On WP 5 Reached - Call TAL 618200'),
(6182,0,6,0,40,0,100,0,8,6182,0,0,80,618201,2,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On WP 8 Reached - Call TAL 618201'),
(6182,0,7,8,38,2,100,0,1,1,0,0,103,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On Data Set 1 1(phase 2) - Remove Root'),
(6182,0,8,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Say Line 1'),
(6182,0,9,0,40,2,100,0,9,6182,0,0,80,618202,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On WP 9 Reached - Call TAL 618202'),
(6182,0,10,11,38,4,100,0,1,1,0,0,103,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On Data Set 1 1(phase 3) - Remove Root'),
(6182,0,11,0,61,0,100,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Say Line 2'),
(6182,0,12,0,40,0,100,0,10,6182,0,0,80,618203,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On WP 10 Reached - Call TAL 618203'),
(6182,0,13,14,38,8,100,0,1,1,0,0,103,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On Data Set 1 1(phase 4) - Remove Root'),
(6182,0,14,0,61,0,100,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Say Line 3'),
(6182,0,15,0,40,8,100,0,11,6182,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On WP 11 Reached - Disable Run'),
(6182,0,16,0,40,8,100,0,12,6182,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On WP 12 Reached - Say Line 4'),
(6182,0,17,18,40,8,100,0,14,6182,0,0,54,3000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On WP 14 Reached - Pause WP'),
(6182,0,18,19,61,8,100,0,0,0,0,0,40,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Set Sheath to 0'),
(6182,0,19,0,61,8,100,0,0,0,0,0,5,432,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Play Emote'),
(6182,0,20,21,40,8,100,0,18,6182,0,0,15,1651,0,0,0,0,0,12,1,0,0,0,0,0,0,'Daphne Stilwell - On WP 18 Reached - Area Explored Or Event Happens'),
(6182,0,21,0,61,8,100,0,0,0,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Add npcflag ''Quest Giver'''),
(6182,0,22,0,0,0,100,0,0,0,0,0,11,6660,64,0,0,0,0,2,0,0,0,0,0,0,0,'Daphne Stilwell - In Combat - Cast spell ''Shoot'''),
(6182,0,23,24,11,0,100,0,0,0,0,0,103,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On Respawn - Remove Root'),
(6182,0,24,0,61,0,100,0,0,0,0,0,40,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Set Sheath to 0'),
(6182,0,25,26,40,0,100,0,19,6182,0,0,55,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - On WP 19 Reached - Stop WP'),
(6182,0,26,0,61,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Daphne Stilwell - Link With Previous - Evade');

DELETE FROM `smart_scripts` WHERE `entryorguid`IN (618200,618201,618202,618203) AND `source_type`=9;
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
(618200,9,0,0,0,0,100,0,0,0,0,0,103,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 0 - Set Root'),
(618200,9,1,0,0,0,100,0,0,0,0,0,54,4000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 1 - Pause WP'),
(618200,9,2,0,0,0,100,0,500,500,0,0,5,432,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 2 - Play Emote'),
(618200,9,3,0,0,0,100,0,2000,2000,0,0,71,0,0,0,0,2511,0,1,0,0,0,0,0,0,0,'Action 3 - Equip Ranged Weapon'),
(618200,9,4,0,0,0,100,0,0,0,0,0,40,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 4 - Set Sheath to 2'),
(618200,9,5,0,0,0,100,0,1000,1000,0,0,103,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 5 - Remove Root'),
(618201,9,0,0,0,0,100,0,0,0,0,0,103,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 0 - Set Root'),
(618201,9,1,0,0,0,100,0,0,0,0,0,107,0,1,0,0,0,0,0,0,0,0,0,0,0,0,'Action 1 - Summon Group 0'),
(618201,9,2,0,0,0,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 2 - Set Event Phase to 2'),
(618202,9,0,0,0,0,100,0,0,0,0,0,103,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 0 - Set Root'),
(618202,9,1,0,0,0,100,0,0,0,0,0,107,1,1,0,0,0,0,0,0,0,0,0,0,0,0,'Action 1 - Summon Group 1'),
(618202,9,2,0,0,0,100,0,0,0,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 2 - Set Event Phase to 3'),
(618203,9,0,0,0,0,100,0,0,0,0,0,103,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 0 - Set Root'),
(618203,9,1,0,0,0,100,0,0,0,0,0,107,2,1,0,0,0,0,0,0,0,0,0,0,0,0,'Action 1 - Summon Group 2'),
(618203,9,2,0,0,0,100,0,0,0,0,0,22,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Action 2 - Set Event Phase 4');

DELETE FROM `script_waypoint` WHERE `entry`=6182;
DELETE FROM `waypoints` WHERE `entry`=6182;
INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
(6182,1,-11480.7,1545.09,49.8986,''),
(6182,2,-11466.8,1530.15,50.2636,''),
(6182,3,-11465.2,1528.34,50.9544,'enter hut'),
(6182,4,-11463,1525.24,50.9377,''),
(6182,5,-11461,1526.61,50.9377,'pick up rifle'),
(6182,6,-11463,1525.24,50.9377,''),
(6182,7,-11465.2,1528.34,50.9544,''),
(6182,8,-11468.4,1535.08,50.4009,'hold, prepare for wave1'),
(6182,9,-11468.4,1535.08,50.4009,'hold, prepare for wave2'),
(6182,10,-11468.4,1535.08,50.4009,'hold, prepare for wave3'),
(6182,11,-11467.9,1532.46,50.3489,'we are done'),
(6182,12,-11466.1,1529.86,50.2094,''),
(6182,13,-11463,1525.24,50.9377,''),
(6182,14,-11461,1526.61,50.9377,'deliver rifle'),
(6182,15,-11463,1525.24,50.9377,''),
(6182,16,-11465.2,1528.34,50.9544,''),
(6182,17,-11470.3,1537.28,50.3785,''),
(6182,18,-11475.6,1548.68,50.1844,'complete quest'),
(6182,19,-11482.3,1557.41,48.6245,'');

DELETE FROM `creature_summon_groups` WHERE `summonerid`=6182;
INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES
(6182,0,0,6180,-11450.836,1569.755,54.267,4.230,4,30000),
(6182,0,0,6180,-11449.697,1569.124,54.421,4.206,4,30000),
(6182,0,0,6180,-11448.237,1568.307,54.620,4.206,4,30000),
(6182,0,1,6180,-11450.836,1569.755,54.267,4.230,4,30000),
(6182,0,1,6180,-11449.697,1569.124,54.421,4.206,4,30000),
(6182,0,1,6180,-11448.237,1568.307,54.620,4.206,4,30000),
(6182,0,1,6180,-11448.037,1570.213,54.961,4.283,4,30000),
(6182,0,2,6180,-11450.836,1569.755,54.267,4.230,4,30000),
(6182,0,2,6180,-11449.697,1569.124,54.421,4.206,4,30000),
(6182,0,2,6180,-11448.237,1568.307,54.620,4.206,4,30000),
(6182,0,2,6180,-11448.037,1570.213,54.961,4.283,4,30000),
(6182,0,2,6180,-11449.018,1570.738,54.828,4.220,4,30000);

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceGroup`=4 AND `SourceEntry`=6180;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(22,4,6180,0,0,29,0,6180,100,0,1,0,0,'','Execute SAI if only there is no Defias Raider in vicinity');

DELETE FROM creature_text WHERE entry = 6182;
INSERT INTO creature_text VALUES 
(6182,0,0,"To the house! Stay close to me, no matter what! I have my gun and ammo there!",12,0,100,0,0,0,0,"stilwell SAY_DS_START"),
(6182,1,0,"We showed that one!",12,0,100,0,0,0,0,"stilwell SAY_DS_DOWN_1"),
(6182,2,0,"One more down!",12,0,100,0,0,0,0,"stilwell SAY_DS_DOWN_2"),
(6182,3,0,"We've done it! We won!",12,0,100,0,0,0,0,"stilwell SAY_DS_DOWN_3"),
(6182,4,0,"Meet me down by the orchard--I just need to put my gun away.",12,0,100,0,0,0,0,"stilwell SAY_DS_PROLOGUE");

Tome of valor tested and works as a charm right now..

only problem is a sql error

UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,   WHERE `entry`=6180;

gave me error on console..

UPDATE `creature_template` SET  `faction_A` =  '14', `faction_H` =  '14' WHERE  `entry` =6180;

is better, some systems are bad without spacing tongue

All the scripts in this thread have been tested and confirmed working by me. I'll be making seperate commits for each one as it's double checked and brought into the main repo. SmartAI seems to be doing fine and shouldn't affect anyone in a negative way.

5 (edited by Areradon 2015-12-28 02:37:48)

Hey,

Started to fix some things.

UPDATE creature_template SET AIName = "SmartAI" WHERE entry = "17259";

DELETE FROM `smart_scripts` WHERE `entryorguid` = "17259";
INSERT INTO `smart_scripts` VALUES ('17259', '0', '0', '0', '4', '0', '10', '7', '100', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', 'Bonechewer Hungerer - On Aggro - Say Line 0 (Phase 2)');
INSERT INTO `smart_scripts` VALUES ('17259', '0', '1', '0', '0', '0', '100', '6', '1300', '8500', '10700', '17700', '11', '16244', '1', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', 'Bonechewer Hungerer - In Combat - Cast \'Demoralizing Shout\' (Phase 2)');
INSERT INTO `smart_scripts` VALUES ('17259', '0', '2', '0', '0', '0', '100', '6', '4800', '15400', '7200', '22400', '11', '6713', '0', '0', '0', '0', '0', '2', '0', '0', '0', '0', '0', '0', '0', 'Bonechewer Hungerer - In Combat - Cast \'Disarm\' (Phase 2)');
INSERT INTO `smart_scripts` VALUES ('17259', '0', '3', '0', '0', '0', '100', '6', '3500', '13700', '5400', '12500', '11', '14516', '0', '0', '0', '0', '0', '2', '0', '0', '0', '0', '0', '0', '0', 'Bonechewer Hungerer - In Combat - Cast \'Strike\' (Phase 2)');
INSERT INTO `smart_scripts` VALUES ('17259', '0', '4', '0', '2', '0', '100', '7', '0', '15', '0', '0', '25', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Bonechewer Hungerer - Between 0-15% Health - Flee For Assist (Phase 2)');


DELETE FROM `creature_text` WHERE `entry` = "17259";
INSERT INTO `creature_text` VALUES ('17259', '0', '0', 'This world is OURS!', '12', '0', '100', '0', '0', '0', '127', '0');
INSERT INTO `creature_text` VALUES ('17259', '0', '1', 'We are the true Horde!', '12', '0', '100', '0', '0', '0', '127', '0');
INSERT INTO `creature_text` VALUES ('17259', '0', '2', 'The blood is our power! ', '12', '0', '100', '0', '0', '0', '127', '0');
INSERT INTO `creature_text` VALUES ('17259', '0', '3', 'For Kargath!  For Victory!', '12', '0', '100', '0', '0', '0', '127', '0');
INSERT INTO `creature_text` VALUES ('17259', '0', '4', 'Gakarah ma!', '12', '0', '100', '0', '0', '0', '127', '0');
INSERT INTO `creature_text` VALUES ('17259', '0', '5', 'Lok\'tar Illadari!', '12', '0', '100', '0', '0', '0', '127', '0');
INSERT INTO `creature_text` VALUES ('17259', '0', '6', 'Lok narash!', '12', '0', '100', '0', '0', '0', '127', '0');

Not working text. Maybe i did something wrong? I just copied this from tc2

2015-12-27 23:30:43 CreatureTextMgr: Entry 17259, Group 0, Id 0 in table `creature_text` has incorrect TextRange 127.
2015-12-27 23:30:43 CreatureTextMgr: Entry 17259, Group 0, Id 1 in table `creature_text` has incorrect TextRange 127.
2015-12-27 23:30:43 CreatureTextMgr: Entry 17259, Group 0, Id 2 in table `creature_text` has incorrect TextRange 127.
2015-12-27 23:30:43 CreatureTextMgr: Entry 17259, Group 0, Id 3 in table `creature_text` has incorrect TextRange 127.
2015-12-27 23:30:43 CreatureTextMgr: Entry 17259, Group 0, Id 4 in table `creature_text` has incorrect TextRange 127.
2015-12-27 23:30:43 CreatureTextMgr: Entry 17259, Group 0, Id 5 in table `creature_text` has incorrect TextRange 127.
2015-12-27 23:30:43 CreatureTextMgr: Entry 17259, Group 0, Id 6 in table `creature_text` has incorrect TextRange 127.

Text range must be 0 for normal chat, 1 is zone, 2 is map i believe.

taken form the trinitycore wiki

TextRange
Value
Range
0    Normal/Default
1    Area
2    Zone
3    Map
4    World

8 (edited by Areradon 2015-12-28 15:12:41)

Okay I, why the use 127 then?  xD maybe cause of broadcast_text?

Okay found another error:

Normal/Heroic change doesnt work. on normal with entry 17259, it is working but on heroic (heroic_entry = 18053) it doesnt work.

That's definitely an issue if Heroic copies of certain entities aren't copying the script properities for SmartAI. I'll take a look after I'm done reworking grids. Thanks for testing it out!

Areradon. I've tested with a SmartAI script

-- Cabal Assassin
SET @ENTRY := 18636;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
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,0,0,0,25,0,100,6,0,0,0,0,11,30991,0,0,0,0,0,1,0,0,0,0,0,0,0,'Cast Stealth on Reset'),
(@ENTRY,0,1,0,9,0,100,6,0,8,0,0,11,30986,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Cheap Shot on Close'),
(@ENTRY,0,2,0,67,0,100,6,9000,12000,0,0,11,30992,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Backstab'),
(@ENTRY,0,3,0,0,0,100,6,2000,4500,12000,20000,11,30981,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Crippling Poison'),
(@ENTRY,0,4,0,0,0,100,6,8000,11000,22000,25000,11,36974,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Wound Poison');

I've ran both the heroic and normal versions, both inherit the SmartAI script name and both execute the script perfectly. Are you doubly sure that it is not working on your end? If so, can you provide the script?

Tested, and found a bug on my self. Its working!