- This example shows how the Skeleton AI generally works for
attacking. (minus all the fluff, such as randomly walking around).
...
...
@@ -62,8 +62,9 @@ AI Goals, Targets, and Factions
* As you see **clear** is always first, which in this case wipes the mobs AI so you have a clean slate to work with. This is important otherwise your AI may not function the way you would expect.
* Now lets say we want the skeleton to attack other mobs instead and we want him to use a melee attack instead of a ranged attack. See below for how we accomplish this.
```yaml
DecayingSkeleton:
Mobtype: skeleton
Type:skeleton
Display:'&aadecayingskeleton'
Health:15
Damage:1
...
...
@@ -76,11 +77,12 @@ AI Goals, Targets, and Factions
-hurtbytarget
-otherfactionmonsters
Equipment:
- COS_WoodSword:0
-COS_WoodSword HAND
Options:
FollowRange:10
MovementSpeed:0.2
PreventOtherDrops:true
```
- The skeleton AI now is programmed to attack other mobs, and any mobs
that attack it first. In addition, it will use the melee attack
...
...
@@ -115,15 +117,15 @@ Example 1: Guards attack nearby monsters
<!-- -->
```yaml
SummonedGuard1:
Mobtype: skeleton
Type:skeleton
Display:'&Eatownguard'
Health:500
Damage:5
Equipment:
- COS_StoneSword:0
-COS_StoneSword HAND
Options:
Disguise: villager
Despawn:true
FollowRange:5
AlwaysShowName:false
...
...
@@ -131,6 +133,8 @@ Example 1: Guards attack nearby monsters
PreventOtherDrops:true
KnockbackResistance:1
PreventMobKillDrops:true
Disguise:villager
```
- So if we tie this mob to a mob spawner at our gates, he's going to
go attack all of our players in the town so we need to make some
...
...
@@ -138,13 +142,14 @@ Example 1: Guards attack nearby monsters
<!-- -->
```yaml
SummonedGuard1:
Mobtype: skeleton
Type:skeleton
Display:'&Eatownguard'
Health:500
Damage:5
Equipment:
- COS_StoneSword:0
-COS_StoneSword HAND
Faction:Guard
AIGoalSelectors:
-clear
...
...
@@ -155,7 +160,6 @@ Example 1: Guards attack nearby monsters
-hurtbytarget
-otherfactionmonsters
Options:
Disguise: villager
Despawn:true
FollowRange:5
AlwaysShowName:false
...
...
@@ -163,6 +167,8 @@ Example 1: Guards attack nearby monsters
PreventOtherDrops:true
KnockbackResistance:1
PreventMobKillDrops:true
Disguise:Villager
```
- Now the mob will target other factions containing monsters besides
his own and will target anyone that hurts him (this will keep some
...
...
@@ -176,8 +182,9 @@ Example 1: Guards attack nearby monsters
<!-- -->
```yaml
DecayingSkeleton:
Mobtype: skeleton
Type:skeleton
Display:'&aadecayingskeleton'
Health:15
Damage:1
...
...
@@ -190,14 +197,15 @@ Example 1: Guards attack nearby monsters
-hurtbytarget
-players
Equipment:
- COS_RawHead:4
- COS_WoodSword:0
-COS_RawHead HEAD
-COS_WoodSword HAND
Options:
Despawn:true
FollowRange:10
AlwaysShowName:false
MovementSpeed:0.2
PreventOtherDrops:true
```
- Our decaying skeleton is now in the Undead faction (different then
the Guard faction) and so he will be attacked by the guard. Also, by
...
...
@@ -236,8 +244,9 @@ Example 2: Orcs and Goblins attack each other
<!-- -->
```yaml
OrcCenturion:
Mobtype: villagezombie
Type:villagezombie
Display:'&aanorccenturion'
Health:50
Damage:4
...
...
@@ -252,11 +261,11 @@ Example 2: Orcs and Goblins attack each other
-specificfactionmonsters Goblin
-players
Equipment:
- C_DeathfistSkullcap:4
- C_DeathfistTunic:3
- C_DeathfistLeggings:2
- C_DeathfistBoots:1
- COS_WoodSword:0
-C_DeathfistSkullcap HEAD
-C_DeathfistTunic CHEST
-C_DeathfistLeggings LEGS
-C_DeathfistBoots FEET
-COS_WoodSword HAND
Options:
Despawn:true
FollowRange:10
...
...
@@ -266,9 +275,10 @@ Example 2: Orcs and Goblins attack each other
PreventItemPickup:true
KnockbackResistance:0.25
PreventMobKillDrops:true
```
```yaml
GoblinBattlemaster:
Mobtype: zombie
Type:zombie
Display:'&aagoblinbattlemaster'
Health:80
Damage:4
...
...
@@ -283,13 +293,13 @@ Example 2: Orcs and Goblins attack each other
-specificfactionmonsters Orcs
-players
Equipment:
- COS_BronzeHead:4
- COS_BronzeChest:3
- COS_BronzeLegs:2
- COS_BronzeFeet:1
- COS_WoodAxe:0
-COS_BronzeHead HEAD
-COS_BronzeChest CHEST
-COS_BronzeLegs LEGS
-COS_BronzeFeet FEET
-COS_WoodAxe HAND
Skills:
- skillBashI ~onAttack >0 0.25
-skill{s=BashI} ~onAttack >0 0.25
Options:
Despawn:true
FollowRange:10
...
...
@@ -299,7 +309,7 @@ Example 2: Orcs and Goblins attack each other
PreventItemPickup:true
KnockbackResistance:0.4
PreventMobKillDrops:true
```
- So there are a few things we've configured here of note.