Jump to content
TrinityCore

Smart_Scripts Event Player only


Vatoto
 Share

Recommended Posts

Hello!

I'm working with a Legion server 7.2.5 and I have a question regarding smart_scripts.

Little background: The npc should say something if a player is in a specific range, but only if it is a player. I have creatures walking with waypoints near this npc and they should not trigger the event.

I use the event type "SMART_EVENT_OOC_LOS" and it is working fine, but I only want to trigger it if there is a player. On the wiki is written that param5 is "0/1 Player Only" but I only have "event_param_string" in my table. I also tried to use this field with "1" or "Player only" as a value, but it doesn't work. 

Is there a work around that I can use to only trigger the event if there is a player? If it's possible I don't want to use custom scripts. 

 

I hope I was able to express myself clearly. =/

Thanks in advance for every advice/help!

 

Link to comment
Share on other sites

Use 
CONDITION_OBJECT_ENTRY_GUID        = 31,                   // TypeID           entry          guid               true if object is type TypeID and the entry is 0 or matches entry of the object or matches guid of the object

 

CONDITION_SOURCE_TYPE_SMART_EVENT 22 ID (smart_scripts.id) + 1


4 : TYPEID_PLAYER
https://trinitycore.atlassian.net/wiki/spaces/tc/pages/2130002/conditions

  • Like 1
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Jonne
      Hi guys!
      I'm trying to make Firewing Courier  more Blizz like and ad an aggro text to him.
      I can make it so that his text appear in the "General Chat" window, but I can't get the speech bubble with the text to appear above the npc's head.
      Here is my code.
      -- Firewing Courier Aggro Text
      UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=18548;
      DELETE FROM `smart_scripts` WHERE `entryorguid`=18548 AND `source_type`=0 AND `id`=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
      (18548,0,1,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Firewing Courier - On Aggro - Say Line 0");
      DELETE FROM `creature_text` WHERE `CreatureID`=18548;
      INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
      (18548,0,0,"This belongs to Firewing Point.  You'll not be putting your grubby hands on it!",12,0,100,0,0,0,15528,0,"Firewing Courier");
       
      Any help is very much appreciated 
×
×
  • Create New...