[WIP] Quest: Near Miss and Close Call

Support for http://www.wowhead.com/quest=12637 and http://www.wowhead.com/quest=12638

Bloodrose doesn’t move to the Correct Spot.

[SPOILER]DELETE FROM gossip_menu_option WHERE menu_id=9714;
INSERT INTO gossip_menu_option (menu_id,id,option_icon,option_text,option_id,npc_option_npcflag,action_menu_id,action_poi_id,action_script_id,box_coded,box_money,box_text) VALUES
(9714,0,0, ‘Stefan told me you would demonstrate the purpose of this item.’,1,1,0,0,0,0,0,NULL);

UPDATE creature_template SET AIName= ‘SmartAI’ WHERE entry=28532;
DELETE FROM smart_scripts WHERE entryorguid IN (28532,2853200);
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
(28532,0,0,0,62,0,100,0,9714,0,0,0,80,2853200,0,2,0,0,0,1,0,0,0,0,0,0,0, ‘Start Script’),
(28532,0,1,0,62,0,100,0,9714,0,0,0,33,28532,0,0,0,0,0,7,0,0,0,0,0,0,0, ’ Quest Credit’),
(2853200,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘Close Gossip’),
(2853200,9,1,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Turn off Gossip and Quest Flags’),
(2853200,9,2,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bloodrose Datura Speech 1’),
(2853200,9,3,0,0,0,100,0,3000,3000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bloodrose Datura Speech 2’),
(2853200,9,4,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,10,107425,0,0,0,0,0,0, ‘Captured Drakkari Scout Speech 1’),
(2853200,9,5,0,0,0,100,0,5000,5000,0,0,1,1,0,0,0,0,0,10,107425,0,0,0,0,0,0, ‘Captured Drakkari Scout Speech 2’),
(2853200,9,6,0,0,0,100,0,3000,3000,0,0,3,28519,0,0,0,0,0,10,107425,0,0,0,0,0,0, ‘Captured Drakkari Scout Transform to Withered Troll’),
(2853200,9,7,0,0,0,100,0,3000,3000,0,0,69,5203.729980,-1313.079956,242.766998,0,0,0,8,0,0,0,0,0,0,0, ‘Bloodrose Datura move to Cage’),
(2853200,9,8,0,0,0,100,0,1000,1000,0,0,51,0,0,0,0,0,0,10,107425,0,0,0,0,0,0, ‘Trasformed Troll Dies’),
(2853200,9,9,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bloodrose Datura Speach 3’),
(2853200,9,10,0,0,0,100,0,1000,1000,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bloodrose Datura Evade’),
(2853200,9,11,0,0,0,100,0,0,0,0,0,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Turn on Gossip and Quest Flags’);

DELETE FROM creature_text WHERE entryIN (28532,28541);
INSERT INTO creature_text (entry,groupid,id,text,type,language,probability,emote,duration,sound,comment) VALUES
(28532,0,0, ‘Indeed. Watch this, $R.’,0,0,100,0,0,0, ‘Bloodrose Datura’),
(28532,1,0, ‘Here, troll… a gift!’,0,0,100,0,0,0, ‘Bloodrose Datura’),
(28541,0,0, ‘For me? Really, mon?’,0,0,100,0,0,0, ‘Captured Drakkari Scout’),
(28541,1,0, ‘It…it be beautiful!’,0,0,100,0,0,0, ‘Captured Drakkari Scout’),
(28532,2,0, ‘Ugh… disgusting!’,0,0,100,0,0,0, ‘Bloodrose Datura’);

DELETE FROM conditions WHERE SourceTypeOrReferenceId=15 AND SourceGroup =9714 AND SourceEntry =0;
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,ConditionValue3,ErrorTextId,ScriptName,Comment) VALUES
(15,9714,0,12637,9,12637,0,0,0,‘’, ‘’),
(15,9714,0,12638,9,12638,0,0,0,‘’, ‘’);

-- Quest Close Call and Near Miss (12637 and 12638)

[/SPOILER]

You should put the name of the npc in the comment field for text entries so it would be easier to know who the text belongs to /emoticons/default_smile.png

Comment fields are meant for comments, I see you haven’t used any of them…

Yes i had not added them which is why i marked it WIP, done so now.

Conditions added.

you have SAI set to an npc and yet you have no script for it… is that an oversight? #28541

Yes that was.

Don’t forget to turn gossip and questgiver flags off and back on at the end so no one can use it while script is running /emoticons/default_smile.png

Done, i moved the quest credit to The Start as i could not get credit any other way, not sure if this is correct or not.

Flags off and on Added.

Still Cant get the npc to move the the coordinates i want. Might Try Waypoint but i dont think that should be needed.

Hello.

(2853200,9,7,0,0,0,100,0,3000,3000,0,0,69,5203.729980,-1313.079956,242.766998,0,0,0,8,0,0,0,0,0,0,0, 'Bloodrose Datura move to Cage'),

should be:

(2853200,9,7,0,0,0,100,0,3000,3000,0,0,69,0,0,0,0,0,0,8,0,0,0,5203.729980,-1313.079956,242.766998,0, 'Bloodrose Datura move to Cage'),

Also you can add the orientation too.

Hope I helped. /emoticons/default_smile.png

Thats for that try, but it doesn’t work at all now.

But that is how it should be. SMART_ACTION_MOVE_TO_POINT needs to be used with TARGET_POSITION with target_x, target_y, target_z for coordinates

me->GetMotionMaster()->MovePoint(0, e.target.x, e.target.y , e.target.z);

Edit: target should be 1 or 0 and not 8. The Action will read the fields target_x, target_y, target_z independent of target type

Try this:

[CODE]-- Quest Close Call and Near Miss (12637 and 12638)
DELETE FROM gossip_menu_option WHERE menu_id=9714;
INSERT INTO gossip_menu_option (menu_id,id,option_icon,option_text,option_id,npc_option_npcflag,action_menu_id,action_poi_id,action_script_id,box_coded,box_money,box_text) VALUES
(9714,0,0, ‘Stefan told me you would demonstrate the purpose of this item.’,1,1,0,0,0,0,0,NULL);

UPDATE creature_template SET AIName= ‘SmartAI’ WHERE entry=28532;
DELETE FROM smart_scripts WHERE entryorguid IN (28532,2853200);
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
(28532,0,0,0,62,0,100,0,9714,0,0,0,80,2853200,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Start Script’),
(2853200,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘Close Gossip’),
(2853200,9,1,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Turn off Gossip and Quest Flags’),
(2853200,9,2,0,0,0,100,0,0,0,0,0,33,28532,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘Quest Credit’),
(2853200,9,3,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bloodrose Datura Speech 1’),
(2853200,9,4,0,0,0,100,0,3000,3000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bloodrose Datura Speech 2’),
(2853200,9,5,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,10,107425,28541,0,0,0,0,0, ‘Captured Drakkari Scout Speech 1’),
(2853200,9,6,0,0,0,100,0,5000,5000,0,0,1,1,0,0,0,0,0,10,107425,28541,0,0,0,0,0, ‘Captured Drakkari Scout Speech 2’),
(2853200,9,7,0,0,0,100,0,3000,3000,0,0,3,28519,0,0,0,0,0,10,107425,28541,0,0,0,0,0, ‘Captured Drakkari Scout Transform to Withered Troll’),
(2853200,9,8,0,0,0,100,0,3000,3000,0,0,69,0,0,0,0,0,0,8,0,0,0,5203.729980,-1313.079956,242.766998,0, ‘Bloodrose Datura move to Cage’),
(2853200,9,9,0,0,0,100,0,1000,1000,0,0,51,0,0,0,0,0,0,10,107425,28541,0,0,0,0,0, ‘Trasformed Troll Dies’),
(2853200,9,10,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bloodrose Datura Speach 3’),
(2853200,9,11,0,0,0,100,0,1000,1000,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Bloodrose Datura Evade’),
(2853200,9,12,0,0,0,100,0,0,0,0,0,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Turn on Gossip and Quest Flags’);

DELETE FROM creature_text WHERE entryIN (28532,28541);
INSERT INTO creature_text (entry,groupid,id,text,type,language,probability,emote,duration,sound,comment) VALUES
(28532,0,0, ‘Indeed. Watch this, $R.’,0,0,100,0,0,0, ‘Bloodrose Datura’),
(28532,1,0, ‘Here, troll… a gift!’,0,0,100,0,0,0, ‘Bloodrose Datura’),
(28541,0,0, ‘For me? Really, mon?’,0,0,100,0,0,0, ‘Captured Drakkari Scout’),
(28541,1,0, ‘It…it be beautiful!’,0,0,100,0,0,0, ‘Captured Drakkari Scout’),
(28532,2,0, ‘Ugh… disgusting!’,0,0,100,0,0,0, ‘Bloodrose Datura’);

DELETE FROM conditions WHERE SourceTypeOrReferenceId=15 AND SourceGroup =9714 AND SourceEntry =0;
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,ConditionValue3,ErrorTextId,ScriptName,Comment) VALUES
(15,9714,0,12637,9,12637,0,0,0,‘’, ‘’),
(15,9714,0,12638,9,12638,0,0,0,‘’, ‘’);[/sql]
[/CODE]

I can’t make her even say the speech, it gets stuck after giving the quest completion, tho the script seems running (I can’t click on her for 20-30 seconds)

Testing in local on a https://github.com/TrinityCore/TrinityCore/commit/726c26000288634c6499f8ab934219642c3402c6 revision.

What am I doing wrong?

12 Say

14 Yell

16 Emote

41 Boss Emote

15 Whisper

42 Boss Whisper

something has changed in creature_text /emoticons/default_smile.png

try this

DELETE FROM `creature_text` WHERE `entry`IN (28532,28541); INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES (28532,0,0, 'Indeed. Watch this, $R.',12,0,100,0,0,0, 'Bloodrose Datura'), (28532,1,0, 'Here, troll... a gift!',12,0,100,0,0,0, 'Bloodrose Datura'), (28541,0,0, 'For me? Really, mon?',12,0,100,0,0,0, 'Captured Drakkari Scout'), (28541,1,0, 'It....it be beautiful!',12,0,100,0,0,0, 'Captured Drakkari Scout'), (28532,2,0, 'Ugh... disgusting!',12,0,100,0,0,0, 'Bloodrose Datura'); [/sql]

try this. in my experience move_to_pos doesn’t work with timed_actionlist.

if this is not the case ignore this comment /emoticons/default_wink.png

DELETE FROM `smart_scripts` WHERE `entryorguid` IN (28532,2853200); 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 (28532,0,0,0,62,0,100,0,9714,0,0,0,80,2853200,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Start Script'), (28532,0,1,0,38,0,100,0,0,1,0,0,69,0,0,0,0,0,0,8,0,0,0,5203.729980,-1313.079956,242.766998,0, 'on dataset 0 1 - Bloodrose Datura move to Cage'), -- ! -- Script (2853200,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Close Gossip'), (2853200,9,1,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Turn off Gossip and Quest Flags'), (2853200,9,2,0,0,0,100,0,0,0,0,0,33,28532,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Quest Credit'), (2853200,9,3,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bloodrose Datura Speech 1'), (2853200,9,4,0,0,0,100,0,3000,3000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bloodrose Datura Speech 2'), (2853200,9,5,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,10,107425,28541,0,0,0,0,0, 'Captured Drakkari Scout Speech 1'), (2853200,9,6,0,0,0,100,0,5000,5000,0,0,1,1,0,0,0,0,0,10,107425,28541,0,0,0,0,0, 'Captured Drakkari Scout Speech 2'), (2853200,9,7,0,0,0,100,0,3000,3000,0,0,3,28519,0,0,0,0,0,10,107425,28541,0,0,0,0,0, 'Captured Drakkari Scout Transform to Withered Troll'), (2853200,9,8,0,0,0,100,0,3000,3000,0,0,45,0,1,0,0,0,0,1,0,0,0,0,0,0,0, 'Bloodrose Datura set data 0 1'), -- ! (2853200,9,9,0,0,0,100,0,1000,1000,0,0,51,0,0,0,0,0,0,10,107425,28541,0,0,0,0,0, 'Trasformed Troll Dies'), (2853200,9,10,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bloodrose Datura Speach 3'), (2853200,9,11,0,0,0,100,0,1000,1000,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bloodrose Datura Evade'), (2853200,9,12,0,0,0,100,0,0,0,0,0,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Turn on Gossip and Quest Flags'); [/sql]

another solution is to work with waypoints - more work but should work more safely …