This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: Another SmartAI question  (Read 1125 times)

Piccolodmq

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 200
    • View Profile
Another SmartAI question
« on: August 26, 2017, 07:04:05 am »
I want to make an NPC phase me to Phase 2, after I accept a quest. After this, I want another NPC to follow a path, when I talk or are near it in that phase.

After I complete the quest I want to return to Phase 2.

This the SQL I am using to get the QUEST NPC to go to Phase 2 (not working)

-- Generated by Event Horizon - SAI Editor (http://devsource-eventhorizon.tk/)

-- Captain Saynna Stormrunner
SET @ENTRY := 40139;
SET @SOURCETYPE := 0;

DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=@SOURCETYPE;
UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY LIMIT 1;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_ty pe`,`event_phase_mask`,`event_chance`,`event_flags `,`event_param1`,`event_param2`,`event_param3`,`ev ent_param4`,`action_type`,`action_param1`,`action_ param2`,`action_param3`,`action_param4`,`action_pa ram5`,`action_param6`,`target_type`,`target_param1 `,`target_param2`,`target_param3`,`target_x`,`targ et_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,@SOURCETYPE,0,0,19,0,100,0,25325,0,0,0,22, 2,0,0,0,0,0,5,1,50000,0,0.0,0.0,0.0,0.0,"set phase"),
(@ENTRY,@SOURCETYPE,1,0,19,0,100,0,25325,0,0,0,22, 2,0,0,0,0,0,5,0,0,0,0.0,0.0,0.0,0.0,"set phase"),
(@ENTRY,@SOURCETYPE,2,0,19,0,100,0,25325,0,0,0,22, 2,0,0,0,0,0,18,50000,0,0,0.0,0.0,0.0,0.0,"set phase"),
(@ENTRY,@SOURCETYPE,3,0,19,0,100,0,25325,0,0,0,22, 2,0,0,0,0,0,2,50000,0,0,0.0,0.0,0.0,0.0,"set phase"),
(@ENTRY,@SOURCETYPE,4,0,19,0,100,0,25325,0,0,0,22, 2,0,0,0,0,0,17,1,50000,0,0.0,0.0,0.0,0.0,"set phase");

----
Npc I want to follow a path (or follow me in the case of this Sql) while in phase 2 is this one = 80276

-- Arch Druid Fandral Staghelm
SET @ENTRY := 80276;
SET @SOURCETYPE := 0;

DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=@SOURCETYPE;
UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY LIMIT 1;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_ty pe`,`event_phase_mask`,`event_chance`,`event_flags `,`event_param1`,`event_param2`,`event_param3`,`ev ent_param4`,`action_type`,`action_param1`,`action_ param2`,`action_param3`,`action_param4`,`action_pa ram5`,`action_param6`,`target_type`,`target_param1 `,`target_param2`,`target_param3`,`target_x`,`targ et_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,@SOURCETYPE,0,0,25,0,100,0,0,0,0,0,11,3334 6,0,0,0,0,0,19,21348,15,0,0.0,0.0,0.0,0.0,"Shadow Council Warlock - On Reset - Cast Green Beam"),
(@ENTRY,@SOURCETYPE,1,0,1,0,100,1,0,0,0,0,11,33346 ,0,0,0,0,0,19,21348,15,0,0.0,0.0,0.0,0.0,"Shadow Council Warlock- OOC - Cast Green Beam (No repeat)"),
(@ENTRY,@SOURCETYPE,2,0,0,0,100,0,1000,2000,5000,7 000,11,9613,0,0,0,0,0,2,0,0,0,0.0,0.0,0.0,0.0,"Sha dow Council Warlock- IC - Cast Shadow Bolt"),
(@ENTRY,@SOURCETYPE,3,0,0,0,100,0,6000,8000,10000, 12000,11,37992,0,0,0,0,0,2,0,0,0,0.0,0.0,0.0,0.0," Shadow Council Warlock- IC - Cast Drain Life"),
(@ENTRY,@SOURCETYPE,4,0,19,0,100,0,25325,0,0,0,29, 0,0,0,0,0,0,21,0,0,0,0.0,0.0,0.0,0.0,"quest follow");



THe npc, I wan to take me back while there to phase 1 is this one =

-- Alysra
SET @ENTRY := 40178;
SET @SOURCETYPE := 0;

DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=@SOURCETYPE;
UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY LIMIT 1;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_ty pe`,`event_phase_mask`,`event_chance`,`event_flags `,`event_param1`,`event_param2`,`event_param3`,`ev ent_param4`,`action_type`,`action_param1`,`action_ param2`,`action_param3`,`action_param4`,`action_pa ram5`,`action_param6`,`target_type`,`target_param1 `,`target_param2`,`target_param3`,`target_x`,`targ et_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,@SOURCETYPE,0,0,19,0,100,0,25325,0,0,0,22, 1,0,0,0,0,0,17,1,50000,0,0.0,0.0,0.0,0.0,"set phase 1");

----


Any help with this? IN the part of the "follow me NPC" I tried using a dummy npc 80205 with wpoints (guid is 837778
)... so the NPC follows the guid as soon as I get to phase 2, and sees me... he starts walking.

Basically I am trying to recreate this quest fromo CATA to WOTLK.

http://www.wowhead.com/quest=25325/through-the-dream

....

Thanks for the help!

Barbz

  • Registred Member
  • LUA Script Tinker
  • *****
  • Posts: 48
    • View Profile
    • YHOOL
Re: Another SmartAI question
« Reply #1 on: August 26, 2017, 02:21:12 pm »
Not sure if you talk about phase from SAI or the phases in the world. But in SAI set phase works with phasemasks, and it's used to make different phases on NPC behaviour.

If you want to know more, make a select query where a phase is used and compare

Piccolodmq

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 200
    • View Profile
Re: Another SmartAI question
« Reply #2 on: August 27, 2017, 06:53:59 am »
I am looking at both things.  A npc that gives me a quest, and this changes the phases I am in.   And another NPC that upon contact follows a path (or the player ) to x point.