Jump to content
TrinityCore

How do I complete a quest objective with smart_scripts?


nubqt
 Share

Recommended Posts

I'm using smart_scripts to fix https://github.com/TrinityCore/TrinityCore/issues/20836 But at some point in that quest, the Player completes a quest objective after gossiping with an NPC. I got the whole thing working except for the objective completion.

The documentation says that SMART_EVENT_QUEST_OBJ_COMPLETION is not yet implemented but that documentation might be outdated.

Any suggestions or ideas?

Link to comment
Share on other sites

you can either give killcredit for the objective's object entry or make it blizzway by casting the credit spell by player-selfcast
 
Clue #1 obtained, spell: 79181 Hobo Information
 
Clue #2 obtained, spell: 79182 Hobo Information
 
Clue #3 obtained, spell: 79183 Hobo Information
 
Clue #4 obtained, spell: 79184 Hobo Information

Link to comment
Share on other sites

On 11/11/2017 at 3:03 AM, Rat said:

you can either give killcredit for the objective's object entry

Could you please explain how to do something like that? I'm working on a different quest now where I have to give a kill credit after selecting a particular gossip. The objective is a coded as an NPC/creature rather than a spell.

Link to comment
Share on other sites

7 hours ago, nubqt said:

Could you please explain how to do something like that? I'm working on a different quest now where I have to give a kill credit after selecting a particular gossip. The objective is a coded as an NPC/creature rather than a spell.

First option which Rat told you:

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
(object_with_gossip,1,0,1,62,0,100,0,gossip_id,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'object_with_gossip- On gossip option 0 select - Close gossip'),
(object_with_gossip,1,1,0,62,0,100,0,gossip_id,0,0,0,33,object_killcredit_id,0,0,0,0,0,7,0,0,0,0,0,0,0,'object_with_gossip- On gossip option 0 select - object_killcredit- quest');

 

Blizzlike option:

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
(object_with_gossip,1,0,1,62,0,100,0,gossip_id,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'object_with_gossip- On gossip option 0 select - Close gossip'),
(object_with_gossip,1,1,0,62,0,100,0,gossip_id,0,0,0,11, 79181 ,0,0,0,0,0,7,0,0,0,0,0,0,0,'object_with_gossip- On gossip option 0 select - cast spell 79181- killcredit quest');

In second one, the spell surely works but if it isnt, so you will have to fix it in the core I guess...

Link to comment
Share on other sites

5 hours ago, Daniel25 said:

INSERT INTO `smart_scripts` VALUES,
(object_with_gossip,1,1,0,62,0,100,0,gossip_id,0,0,0,33,object_killcredit_id,0,0,0,0,0,7,0,0,0,0,0,0,0,'object_with_gossip- On gossip option 0 select - object_killcredit- quest');

Doesn't 33 (SMART_ACTION_CALL_KILLEDMONSTER) assume that the player has already killed the NPC? In this quest I'm working on, the Player doesn't actually need to kill an NPC; it's just that the quest objective is coded as an NPC.

Just in case, the quest is Proving Pit and the `quest_objectives`.`ObjectID` is a Darkspear Jailor. But you don't have to kill it. When you click the gossip menu that objective should be marked as completed.

Thanks for the help and sorry for the questions; I'm just trying to clear all the confusion I have.

Link to comment
Share on other sites

14 hours ago, nubqt said:

Doesn't 33 (SMART_ACTION_CALL_KILLEDMONSTER) assume that the player has already killed the NPC? In this quest I'm working on, the Player doesn't actually need to kill an NPC; it's just that the quest objective is coded as an NPC.

Just in case, the quest is Proving Pit and the `quest_objectives`.`ObjectID` is a Darkspear Jailor. But you don't have to kill it. When you click the gossip menu that objective should be marked as completed.

Thanks for the help and sorry for the questions; I'm just trying to clear all the confusion I have.

That is the script used for completing a objective when in quest_objectives table the type of objective is 0 (npc) or 2 (object) and you dont need to kill it really.

When you can kill the npc you dont need the script because when you kill the npc the quest_objective will get completed withouth the script.

The script complete the quest_objective when you click the option in the gossip_menu withouth you need to kill any npc.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...