SQL 6xx GameObject: Action & SmartAI

dokuro

Veteran Member
Verified Member
31
2020
8
Location
Paris
GOB-quete.jpg

An example of GameObject of type GOOBER (10) which returns are change of state to SmartAI.
This can be a chest, a door, a lever or any object but its animation depends on its displayId.
Here a Tablet which after 5s of opening will return a simple credit for the quest 30801.

SET @NAME := "Tablette de Tonnerre";
SET @GOB := 214572; # Id du gameobject
SET @DISPLAYA2 := 7356; # Apparence
SET @OUVERTURE := 5000; # temps pour activer le gameobject en ms
SET @CREDITA2 := 44921 ; # Credit optionnel pour une quete
SET @FACTION :=11; # neutre 35 - Alliance 11 - Horde 85
SET @SIZE :=1; # taille
SET @FLAGS := 32 ; # 2 locked , 32 no despawn
SET @LOCK := 1949; # type de dévérouillage déffini dans Lock.dbc
SET @QUESTID := 30801; # l'object ne sera activable que si vous avez la quete
SET @GOBRECHARGE :=10000; # temps de recharge en ms
SET @CASTBAR := "questinteract" ; # Attack,Speak,vehichleCursor,Buy,Directions,Trainer,Interact,questinteract,LootAll,Quest,Pickup,Interact, # Trainer,LootAll,mine,Point,Cast,Driver,Taxi,questinteract,crosshairs,Directions,PVP,gatherherbs,workorders,wildpetcapturable,wildpet,
# Voidstorage,architect,EngineerSkin,fishing innkeeper,GatherHerbs,inspect,item,mail,missions,openhand,openhandglowickLock,Reforge
# Repair,Driver,stablemaster,Taxi,Transmogrify,ui-cursor-move

REPLACE INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `Data0`, `Data1`, `Data2`, `Data3`, `Data4`, `Data5`, `Data6`, `Data7`, `Data8`, `Data9`, `Data10`, `Data11`, `Data12`, `Data13`, `Data14`, `Data15`, `Data16`, `Data17`, `Data18`, `Data19`, `Data20`, `Data21`, `Data22`, `Data23`, `Data24`, `Data25`, `Data26`, `Data27`, `Data28`, `Data29`, `Data30`, `Data31`, `Data32`, `unkInt32`, `AIName`, `ScriptName`, `VerifiedBuild`) VALUES
(@GOB, 10, @DISPLAYA2, @NAME, @CASTBAR, '', '', @FACTION, @FLAGS , @SIZE, @LOCK , @QUESTID, 0 , @OUVERTURE, 1, 0, @GOBRECHARGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'SmartGameObjectAI', '', -18019);

-- Tablette de Tonnerre SAI
SET @ENTRY := 214572;
UPDATE `gameobject_template` SET `AIName`="SmartGameObjectAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
(@ENTRY,1,10,0,70,0,100,0,2,0,0,0,33,@CREDITA2,0,0,0,0,0,7,0,0,0,0,0,0,0,"Les leçons du passé 30801 : credit");
 
Top