[NPC] On Player buff

I made my fan script - Cast on Player OOC buff, but it doesn’t work. Where is my mistake? it’s Missing Buff event - cast to player with max distance 30 yards.

please help with this script. thanks anyway /emoticons/default_smile.png

SET @ENTRY := 16680; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; 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,0,0,0,16,0,100,0,20217,30,8000,8000,11,20217,0,0,0,0,0,18,30,0,0,0,0,0,0,'Cast on Player');[/sql]

Edited by Malcrom to use sql box.

iirc, SAI doesn’t work OOC…

realy? I have Event 16 missing buff with action 11 and target player 18 in radius. all this from SAI wiki… but doesn’t work /emoticons/default_sad.png by the way OOC buff Frost Armor on spawn and OOC works good, but this target to player doesn’t

P>S> Malcrom, where are you?

SAI missing buff checks on self only if im corrrect

the easiest way to implement whatever you did above is to make it a gossip and then use on_gossip_option_select with actions: cast spell and close gossip

It works.

what Event can made creature cast on player ? I have target type 18 (On player cast) so may be NPC can buff the player SMART_EVENT_OOC_LOS ? I tried - doesn’t work /emoticons/default_sad.png why this not work too SMART_EVENT_FRIENDLY_MISSING_BUFF ?

OK, maybe I have old information, or was thinking about something else…

Try this:

SET @ENTRY := 16680; UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; 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,0,0,0,16,0,100,0,20217,30,8000,8000,11,20217,3,0,0,0,0,18,30,0,0,0,0,0,0,'Cast on Player');[/sql]

doesn’t work /emoticons/default_unsure.png npc don’t cast spell on player. any ideas why ?

What faction is the NPC? If it’s 35, I don’t think it’ll see any player as a “friendly.”