1. Provide the EntryID of a creature that you want to script and press the 'Enter' key on your keyboard (OR) the [Load / Reload] button (blue icon).
NB: I will be using a custom NPC in this example.
DESCRIPTION:
o Source Type: Since we are scripting an npc, We will set the Source Type to CREATURE.
o ID: This is a unique number which is used to identify and link scripts for this particular EntryID.
Two scripts for the same entryID cannot have the same ID.
Fortunately, Event horizon automatically manages this value for you so you don't have to change it.
2. I assume that you have used a creature with no previous smartAI, If so then this message will show up.
3. Next, Press [ Prepare New ] or Ctrl+N on your keyboard to open the Script Editor panel.
4. So far, Event Horizon should look something like this: (Your NPC/EntryID will be different from mine)
5. In the Comment/Description field, Type a text which will help you identify your script later on.
As you can see in the example above, I have named this script "Cast Fireball".
6. In the 'Behavior Panel', Set the values exactly as shown in the screen shot below:
DEFINITIONS:
o Link: Allows you to link two or more scripts together and execute them in a sequence.
Leave it to 0 for now.
o On Event: The event which will trigger the action, UPDATE_IN_COMBAT means to repeatedly trigger this event once the creature has entered combat.
N.B: Abreviations: IC means In-Combat and OOC means out of combat.
o Do Action: The action which will be done once the event is triggered. In this case, We want the creature to cast Fireball, So select CAST from the drop down list.
o At Target: The target of the action. "VICTIM" means the action will be done on the person the creature is attacking. Another common value is "SELF" which means the creature will do the action on itself.
o Event Chance: Chance in percentage for the action to occur once the event expires.
Set it to 100 for now.
o Event Flag: This flag is used to define which instance difficulty the event will occur in.
(For now leave it to 0 which should make it trigger anywhere.)
o Phase Mask - Phases are like rules which prevents or allows a creature to use certain events/actions.
In other words, The event will only trigger if the creature is in this phase mask number.
Setting it to 0 means all or any phases.
7. Now we will edit the parameter fields for the chosen Event.
In the Parameters Panel, Let us begin with the 'Event' Tab.
Remember that parameter names will always vary based on the chosen Event, Action or Target.
Event UPDATE_IN_COMBAT(IC) has the following fields as parameters:
o InitialMin: Minimum countdown to wait before triggering the Action after the creature enters combat.
o InitialMax: Maximum countdown to wait before triggering the Action after the creature enters combat.o RepeatMin Minimum countdown to wait before repeating the Action during combat.
o RepeatMax: Maximum countdown to wait before repeating the Action during combat.
N.B: The actual number will be a random between Min and Max.
N.B: All time values in smartAI are to be given in millisecond! (1 second = 1,000 milisecond)
8. Next, We will move on to the second Parameter Tab: 'Action'
o Spell ID: The spell ID to cast once the action is triggered ( 133 is for Fireball! )
o Cast Flags: Affects the spell cast in various ways. (You can click the [...] button next to the parameter to bring up the selection list ).For now, Leave it to 0 i.e a normal cast.
9. Finally we move to the last Parameter Tab: 'Target.'
As you can see, There are no possible parameters to be filled for Target: ( VICTIM ) so we will leave them as they are.
10. Click on 'Save New' or CTRL+S on your keyboard to write your script to the database.
o Assuming that there were no errors, Your script name will now be visible in the script list for that creature entry.
11. The final step which should only be done once per entryID is to Enable SmartAI
o If SmartAI is disabled for that entryID, Event horizon will give you a warning as the screenshot below shows:
o To fix it, Click 'Tools > Enable SmartAI' (or) Press CTRL+E on your keyboard.
Make sure the ID shown in the message is the same as the entryID, Then select YES.
o Afterward, smartAI will be enabled and that NPC will use your script :)
12. Finally, Spawn the NPC and try it out.
Pictures below are copyright (c) of Blizzard Entertainment: World of Warcraft.
If I have time, I'll make another tutorial to explain phases and links.
If you want to contribute a tutorial, Send me an email (check on: http://devsource-eventhorizon.tk ) and I'll link it.














Please, send me the source code of this tool (answer here, I don't want to get my email scrapped by bots). It's so awesome but needs to be updated.
ReplyDeleteNothing better has been done after all this time.