[SAI] q6124 & q6129 Curing the Sick

after some further digging and getting the correct info, i finally found the issue and have corrected my script to fix it properly.

this script does just as on retail with ONE exception now… on alliance version, when you use the salve on the sickly deer, it transforms into a cured deer… BUT is modeled dead (laying down) and moving around until it despawns… i checked the model id of the sickly and the cured deer by morphing and the models are ok… so why is the damn cured deer laying down as dead?

anybody have a clue as to what i have missed there.


-- q6124 & q6129 Curing the Sick (alliance & horde versions)
-- issue: using item changes deer to cured and does give credit... but cured animals still have sick aura
-- =======================================
SET @GAZELLE := 12296; -- Sickly Gazelle
SET @DEER := 12298; -- Sickly Deer
SET @SPELLHIT := 19512; -- Apply Salve
SET @AURA := 19502; -- Sickly Critter Aura
-- =======================================
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@GAZELLE,@DEER);
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@GAZELLE,@DEER);
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 
-- Horde Quest Support
(@GAZELLE,0,0,0,8,0,100,0,@SPELLHIT,0,0,0,28,@AURA,0,0,0,0,0,1,0,0,0,0,0,0,0, 'remove aura on spellhit'),
-- Alliance Quest Support
-- ****** issue here, when appling salve, everything works now, but, the cured deer is dead and moving around.
-- models for creature ids  883=347, 12298=10091 (models check out ok when morph on self)
(@DEER,0,0,0,8,0,100,0,@SPELLHIT,0,0,0,28,@AURA,0,0,0,0,0,1,0,0,0,0,0,0,0, 'remove aura on spellhit');
[/sql]

src\server\scripts\Spells\spell_quest.cpp Line 128

Looking at what you have done with your SAI I figured the spell was scripted in cpp because its a dummy spell. You will need to have the cpp removed and script the entry change.

so the spell has the cpp script on it then, because there is no cpp scripted on npc… thats a stickler… there should be a way to associate spell scripts some way… i obviously would never have found that.

You can remove spell_q6124_6129_apply_salve from spell_script_names. When you get the SAI complete we can remove from core and add SAI /emoticons/default_smile.png

testing… upon applying this… i find that an old problem still exists, (which is why someone added the script and didnt fix problem)… on the cured deer only (didnt affect the cured gazelles)… the cured deer spawn dead.

 DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELLHIT;

partial sai as follows:


-- =======================================
SET @GAZELLE := 12296; -- Sickly Gazelle
SET @DEER := 12298; -- Sickly Deer
SET @CURED_DEER := 12299; -- Cured Deer
SET @SPELLHIT := 19512; -- Apply Salve
SET @AURA := 19502; -- Sickly Critter Aura
-- =======================================
-- remove spell from cpp scripting
DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELLHIT;
/*INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (19512, 'spell_q6124_6129_apply_salve');*/
--
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@GAZELLE,@DEER);
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@GAZELLE,@DEER);
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@GAZELLE*100,@DEER*100);
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 
(@DEER,0,0,0,8,0,100,0,@SPELLHIT,0,0,0,80,@DEER*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'on spellhit run script'),
(@DEER*100,9,0,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'despawn'),
(@DEER*100,9,1,0,0,0,100,0,0,0,0,0,12,@CURED_DEER,1,60000,0,0,0,1,0,0,0,0,0,0,0, 'spawn Cured Deer'),
(@DEER*100,9,2,0,0,0,100,0,0,0,0,0,33,@CURED_DEER,0,0,0,0,0,7,0,0,0,0,0,0,0, 'give credit');
[/sql]

do a .npc add 12299 and npc spawns perfectly healthy and alive.

Really difficult case… For some reason this Cured Deer keeps on spawning dead, even if I use update template action_type. It has no entry in creature(_template)_addon or anything that should affect this. No idea why this NPC has unit_flag PvP though.

[CODE]-- Curing the Sick: 6124
SET @ENTRY_DEER := 12298; – Sickly Deer
SET @ENTRY_CURED_DEER := 12299; – Cured Deer
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY_DEER;
DELETE FROM smart_scripts WHERE entryorguid=@ENTRY_DEER;
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_DEER,0,0,0,8,0,100,0,@SPELLHIT,0,0,0,36,@ENTRY_CURED_DEER,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Sickly Deer - On Spellhit - Update Template’),
(@ENTRY_DEER,0,1,0,8,0,100,0,@SPELLHIT,0,0,0,33,@ENTRY_CURED_DEER,0,0,0,0,0,7,0,0,0,0,0,0,0,‘Sickly Deer - On Spellhit - Give Quest Credit’);

– Cured Deer SAI
SET @ENTRY_CURED_DEER := 12299; – Cured Deer
UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY_CURED_DEER;
DELETE FROM smart_scripts WHERE entryorguid=@ENTRY_CURED_DEER;
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_CURED_DEER,0,0,0,0,0,100,100,100,0,0,0,70,1,0,0,0,0,0,1,0,0,0,0,0,0,0,‘Cured Deer - Out Of Combat - Respawn Self’);[/sql]

Didn’t work either.

[/CODE]

Quest 6129 still seem to be broken just lasted core and database 3c1f635abd