PDA

View Full Version : How to script in AI_Agents



BrantX
22-12-08, 06:36 PM
Welcome to BrantX's Guide on Scripting in AI_Agents!


AI_Agents is kinda like LUA except you can do alittle "less features" on it but it is more advanced for the NPC's not encounter(you can do encounters in C++) AI_Agents was Burlex's main way to script, He dislike LUA from the beginning but what do you think he runs Summitt off of? SQL Scripting. AI_Agents can be found in the database all you have to do is look for a table named "ai_agents", After that it should show all the data input stuff. This is where we begin.

First of all you'd probably be eyeing up this table


EntryThis is where you add the NPC ID.(You can add as many ai_agent fields as possible, ai_agents allows you to add and keep on adding in the entry fields incase you want to do multi-spells)

Now you should see this on the next table.


Type
Type is for what the creature will do on what the event is doing.(Event is one step down)
There are 5 codes that i know so far.
and these "codes" are


1 = Melee
2 = Ranged
3 = Flee
4 = Spell
5 = Call for Help

Next on the table you should see


EventEvent is what the creature will do during something that happens
For instance, If you made the above step(type) 4(spell) in your table You would want to make the event be 0. So what i just said is that he'll cast a spell when he enters combat. Or you can make him cast a spell when he gets hit. by making Event's table 2.
Here is a full list of Events.


0 = Enter Combat
1 = Leave Combat
2 = Damage Taken
3 = if Target Cast's Spell
4 = if Target Parried
5 = if Target Dodged
6 = if Target Blocked
7 = if Target Spell Critted
8 = if Target Died
9 = ????
10 = Unit Parried(if caster parries)
11 = UnitDodged(if caster dodges)
12 = Unit Blocked(if caster blocks)
13 = Unit Critted(if caster critted)
14 = Unit Died(if casterdied)
15 = Assists' Target Dies(multi-people)
16 = Follow-Owner(pets)
Next table should say


ChanceChance is the probability on the creature's spells(etc).
Example = Change is 100. Caster will cast it either way.
Example2 = Chance is 10. Caster will cast it on a 10% probability.
Pretty self explanitory.

Now on to


MaxcountPretty self explanitory also,
If you put 100 in the table the caster will cast it 100 times.
If you put 0 in the table the caster will cast it infinite times.

After that you'll see


Spell
This is also self explanitory,
Just put the spell ID.

Next you'll see


SpellType
How the spell is casted.



1 = Root
2 = Heal
3 = Stun
4 = Fear
5 = Silence
6 = Curse
7 = AoE-Damage
8 = Damage
9 = Summon
10 = Buff
11 = DeBuff

Next onto,


TargetTypeTargetType is what the caster will cast on.


0 = Null
1 = Random Target
2 = Target Location
3 = Creature Location
4 = Self
5 = Owner (Hunter's and Warlock's Minions cast spells on their owner)Moving on to


CooldownThis is how long the spell will have a cooldown, or how long the caster will have til he can re-cast the spell.
This is in Miliseconds so...



1 Second = 1000
2 seconds = 2000
5 Seconds = 5000
10 Seconds = 10000
20 Seconds = 20000
60 Seconds(min) = 60000

Next on to


FloatMisc1Don't know this one yet, Will update as soon as i figure it out.

and finally


Misc2Don't know this one either.

There you are! How to script in AI_Agents in ArcEmu.
I am pretty sure you guys can get the basics on how to do this and will probably get pro at it. I am not sure if Ascent is the same AI_Agent Structure as Arc but...If not i will update this and will try to merge Ascent into it. This is for ai_agents in ArcEmu.

Please give me feedback, Is it good? Was it helpful? Easy to read? Etc etc.

- BrantX

Erkael
22-12-08, 07:48 PM
Yeah! Clap Clap +rep BrantX :) Good Tutorial ;)

runiker
22-12-08, 10:17 PM
Great Tut never really knew too much about this table thank you for your help

BrantX
23-12-08, 09:56 AM
Yup, NP Guys. Glad i could help!

BrantX
24-12-08, 02:45 PM
Bawmp.

Banidictor
30-12-08, 09:07 PM
wow i learnt something new LOL

BrantX
03-01-09, 02:55 AM
wow i learnt something new LOL
lol? good for you?