Welcome to AC Web.
Results 1 to 7 of 7
  1. #1

    Question Smart Script - Creature Talk On Spell Cast


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hey there...
    I'm still working on Smart_scripts and I want a creature talk,yell,emote (do something) when casts a certain spellId.

    Example: Let's say... creature casts frostbolt on player, calls event (talk), creature says: "Frostbolt!".

    Events I tried:
    Code:
    31 - SMART_EVENT_SPELLHIT_TARGET
    61 - SMART_EVENT_LINK > Ignores event chance and occurs always (I want it 25% Event Chance)
    72 - SMART_EVENT_ACTION_DONE
    73 - SMART_EVENT_ON_SPELLCLICK
    None of them worked for me. Some gave me errors.

    Any idea?

    UPDATE
    I solved this but AoE spell from creature not working, only direct cast spells.

    Any solution?
    Last edited by molinita; 02-13-2019 at 03:30 AM.

  2. #2
    SMART_EVENT_SPELLHIT_TARGET should be working. But you can just link the actions by using EVENT_LINK.

  3. #3
    Quote Originally Posted by canewadar123 View Post
    SMART_EVENT_SPELLHIT_TARGET should be working. But you can just link the actions by using EVENT_LINK.
    Can you give me an example about SMART_EVENT_SPELLHIT_TARGET? Because I tried it and did not work.

    Oh, forgot about EVENT_LINK, I used it too but it ignores event chance, I want a 25% chance for the event to occur and Event Link ignores it and occurs always.

  4. #4
    -- Trade Prince Gallywix 39582 SAI
    SET @ENTRY := 39582;
    UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
    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,0,0,0,0,0,100,0,5000,8000,12000,15000,11,7 4003,0,0,0,0,0,2,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id74003'"),
    (@ENTRY,0,1,0,0,0,100,0,10000,10000,15000,22000,11 ,74005,0,0,0,0,0,2,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id74005'"),
    (@ENTRY,0,2,0,31,0,61,0,74005,0,0,0,1,1,0,0,0,0,0, 1,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - On Target Spellhit 'Spell Id74005' - Say Line 1"),
    (@ENTRY,0,3,0,0,0,100,0,4000,9000,10000,19000,11,7 4000,0,0,0,0,0,2,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id74000'"),
    (@ENTRY,0,4,0,31,0,61,0,74000,0,0,0,1,2,0,0,0,0,0, 1,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - On Target Spellhit 'Spell Id74000' - Say Line 2"),
    (@ENTRY,0,5,0,0,0,100,0,15000,15000,25000,27000,11 ,74004,0,0,0,0,0,2,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id74004'"),
    (@ENTRY,0,6,0,31,0,61,0,74004,0,0,0,1,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - On Target Spellhit 'Spell Id74004' - Say Line 0"),
    (@ENTRY,0,7,0,0,0,100,0,10000,10000,10000,10000,11 ,81000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id81000'");

  5. #5
    Quote Originally Posted by canewadar123 View Post
    -- Trade Prince Gallywix 39582 SAI
    SET @ENTRY := 39582;
    UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
    DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
    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,0,0,0,0,0,100,0,5000,8000,12000,15000,11,7 4003,0,0,0,0,0,2,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id74003'"),
    (@ENTRY,0,1,0,0,0,100,0,10000,10000,15000,22000,11 ,74005,0,0,0,0,0,2,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id74005'"),
    (@ENTRY,0,2,0,31,0,61,0,74005,0,0,0,1,1,0,0,0,0,0, 1,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - On Target Spellhit 'Spell Id74005' - Say Line 1"),
    (@ENTRY,0,3,0,0,0,100,0,4000,9000,10000,19000,11,7 4000,0,0,0,0,0,2,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id74000'"),
    (@ENTRY,0,4,0,31,0,61,0,74000,0,0,0,1,2,0,0,0,0,0, 1,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - On Target Spellhit 'Spell Id74000' - Say Line 2"),
    (@ENTRY,0,5,0,0,0,100,0,15000,15000,25000,27000,11 ,74004,0,0,0,0,0,2,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id74004'"),
    (@ENTRY,0,6,0,31,0,61,0,74004,0,0,0,1,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - On Target Spellhit 'Spell Id74004' - Say Line 0"),
    (@ENTRY,0,7,0,0,0,100,0,10000,10000,10000,10000,11 ,81000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Trade Prince Gallywix 39582 - In Combat - Cast 'Spell Id81000'");
    So wierd, now it's working, I already tested it this way, (and the same you wrote)...
    Anyway..
    +rep, thanks you a lot cane

    - - - Updated - - -

    UPDATE
    AoE spell from creature not working this way...

    Any solution?

  6. #6
    The npc might be hit by a spell which isn't the one casted. You can try to check the dbcs with spellwork or write a corescript which prints the spellid on void SpellHitTarget(Unit* target, SpellInfo const* spell);

  7. #7

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by canewadar123 View Post
    The npc might be hit by a spell which isn't the one casted. You can try to check the dbcs with spellwork or write a corescript which prints the spellid on void SpellHitTarget(Unit* target, SpellInfo const* spell);
    Like I said here http://www.ac-web.org/forums/showthr...56#post2344556 I'm not friendly with the code...

    I'm pretty sure the spell that hits is the spell is casted (because I made it in spell.dbc), and also, It does not trigger any spell... just does apply school damage... so this should work, pretty wierd.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •