@@ -34,24 +34,24 @@ AI Goals, Targets, and Factions
...
@@ -34,24 +34,24 @@ AI Goals, Targets, and Factions
use test environments!**
use test environments!**
<!-- -->
<!-- -->
```yaml
DecayingSkeleton:
DecayingSkeleton:
Mobtype: skeleton
Type:skeleton
Display: '&aa decaying skeleton'
Display:'&aadecayingskeleton'
Health: 15
Health:15
Damage: 1
Damage:1
Faction: Undead
Faction:Undead
AIGoalSelectors:
AIGoalSelectors:
- clear
-clear
- arrowattack
-arrowattack
AITargetSelectors:
AITargetSelectors:
- clear
-clear
- players
-players
Options:
Options:
FollowRange: 10
FollowRange:10
MovementSpeed: 0.2
MovementSpeed:0.2
PreventOtherDrops: true
PreventOtherDrops:true
```
- This example shows how the Skeleton AI generally works for
- This example shows how the Skeleton AI generally works for
attacking. (minus all the fluff, such as randomly walking around).
attacking. (minus all the fluff, such as randomly walking around).
...
@@ -62,25 +62,27 @@ AI Goals, Targets, and Factions
...
@@ -62,25 +62,27 @@ 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.
* 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.
* 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.
DecayingSkeleton:
```yaml
Mobtype: skeleton
DecayingSkeleton:
Display: '&aa decaying skeleton'
Type:skeleton
Health: 15
Display:'&aadecayingskeleton'
Damage: 1
Health:15
Faction: Undead
Damage:1
AIGoalSelectors:
Faction:Undead
- clear
AIGoalSelectors:
- meleeattack
-clear
AITargetSelectors:
-meleeattack
- clear
AITargetSelectors:
- hurtbytarget
-clear
- otherfactionmonsters
-hurtbytarget
Equipment:
-otherfactionmonsters
- COS_WoodSword:0
Equipment:
Options:
-COS_WoodSword HAND
FollowRange: 10
Options:
MovementSpeed: 0.2
FollowRange:10
PreventOtherDrops: true
MovementSpeed:0.2
PreventOtherDrops:true
```
- The skeleton AI now is programmed to attack other mobs, and any mobs
- 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
that attack it first. In addition, it will use the melee attack
...
@@ -115,22 +117,24 @@ Example 1: Guards attack nearby monsters
...
@@ -115,22 +117,24 @@ Example 1: Guards attack nearby monsters
<!-- -->
<!-- -->
SummonedGuard1:
```yaml
Mobtype: skeleton
SummonedGuard1:
Display: '&Ea town guard'
Type:skeleton
Health: 500
Display:'&Eatownguard'
Damage: 5
Health:500
Equipment:
Damage:5
- COS_StoneSword:0
Equipment:
Options:
-COS_StoneSword HAND
Disguise: villager
Options:
Despawn: true
Despawn:true
FollowRange: 5
FollowRange:5
AlwaysShowName: false
AlwaysShowName:false
MovementSpeed: 0.35
MovementSpeed:0.35
PreventOtherDrops: true
PreventOtherDrops:true
KnockbackResistance: 1
KnockbackResistance:1
PreventMobKillDrops: true
PreventMobKillDrops:true
Disguise:villager
```
- So if we tie this mob to a mob spawner at our gates, he's going to
- 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
go attack all of our players in the town so we need to make some
...
@@ -138,31 +142,33 @@ Example 1: Guards attack nearby monsters
...
@@ -138,31 +142,33 @@ Example 1: Guards attack nearby monsters
<!-- -->
<!-- -->
SummonedGuard1:
```yaml
Mobtype: skeleton
SummonedGuard1:
Display: '&Ea town guard'
Type:skeleton
Health: 500
Display:'&Eatownguard'
Damage: 5
Health:500
Equipment:
Damage:5
- COS_StoneSword:0
Equipment:
Faction: Guard
-COS_StoneSword HAND
AIGoalSelectors:
Faction:Guard
- clear
AIGoalSelectors:
- opendoors
-clear
- meleeattack
-opendoors
AITargetSelectors:
-meleeattack
- clear
AITargetSelectors:
- hurtbytarget
-clear
- otherfactionmonsters
-hurtbytarget
Options:
-otherfactionmonsters
Disguise: villager
Options:
Despawn: true
Despawn:true
FollowRange: 5
FollowRange:5
AlwaysShowName: false
AlwaysShowName:false
MovementSpeed: 0.35
MovementSpeed:0.35
PreventOtherDrops: true
PreventOtherDrops:true
KnockbackResistance: 1
KnockbackResistance:1
PreventMobKillDrops: true
PreventMobKillDrops:true
Disguise:Villager
```
- Now the mob will target other factions containing monsters besides
- Now the mob will target other factions containing monsters besides
his own and will target anyone that hurts him (this will keep some
his own and will target anyone that hurts him (this will keep some
...
@@ -176,28 +182,30 @@ Example 1: Guards attack nearby monsters
...
@@ -176,28 +182,30 @@ Example 1: Guards attack nearby monsters
<!-- -->
<!-- -->
DecayingSkeleton:
```yaml
Mobtype: skeleton
DecayingSkeleton:
Display: '&aa decaying skeleton'
Type:skeleton
Health: 15
Display:'&aadecayingskeleton'
Damage: 1
Health:15
Faction: Undead
Damage:1
AIGoalSelectors:
Faction:Undead
- clear
AIGoalSelectors:
- meleeattack
-clear
AITargetSelectors:
-meleeattack
- clear
AITargetSelectors:
- hurtbytarget
-clear
- players
-hurtbytarget
Equipment:
-players
- COS_RawHead:4
Equipment:
- COS_WoodSword:0
-COS_RawHead HEAD
Options:
-COS_WoodSword HAND
Despawn: true
Options:
FollowRange: 10
Despawn:true
AlwaysShowName: false
FollowRange:10
MovementSpeed: 0.2
AlwaysShowName:false
PreventOtherDrops: true
MovementSpeed:0.2
PreventOtherDrops:true
```
- Our decaying skeleton is now in the Undead faction (different then
- 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
the Guard faction) and so he will be attacked by the guard. Also, by
...
@@ -236,70 +244,72 @@ Example 2: Orcs and Goblins attack each other
...
@@ -236,70 +244,72 @@ Example 2: Orcs and Goblins attack each other
<!-- -->
<!-- -->
OrcCenturion:
```yaml
Mobtype: villagezombie
OrcCenturion:
Display: '&aan orc centurion'
Type:villagezombie
Health: 50
Display:'&aanorccenturion'
Damage: 4
Health:50
Faction: Orcs
Damage:4
AIGoalSelectors:
Faction:Orcs
- clear
AIGoalSelectors:
- opendoors
-clear
- meleeattack
-opendoors
AITargetSelectors:
-meleeattack
- clear
AITargetSelectors:
- hurtbytarget
-clear
- specificfactionmonsters Goblin
-hurtbytarget
- players
-specificfactionmonsters Goblin
Equipment:
-players
- C_DeathfistSkullcap:4
Equipment:
- C_DeathfistTunic:3
-C_DeathfistSkullcap HEAD
- C_DeathfistLeggings:2
-C_DeathfistTunic CHEST
- C_DeathfistBoots:1
-C_DeathfistLeggings LEGS
- COS_WoodSword:0
-C_DeathfistBoots FEET
Options:
-COS_WoodSword HAND
Despawn: true
Options:
FollowRange: 10
Despawn:true
AlwaysShowName: false
FollowRange:10
MovementSpeed: 0.25
AlwaysShowName:false
PreventOtherDrops: true
MovementSpeed:0.25
PreventItemPickup: true
PreventOtherDrops:true
KnockbackResistance: 0.25
PreventItemPickup:true
PreventMobKillDrops: true
KnockbackResistance:0.25
PreventMobKillDrops:true
GoblinBattlemaster:
```
Mobtype: zombie
```yaml
Display: '&aa goblin battlemaster'
GoblinBattlemaster:
Health: 80
Type:zombie
Damage: 4
Display:'&aagoblinbattlemaster'
Faction: Goblin
Health:80
AIGoalSelectors:
Damage:4
- clear
Faction:Goblin
- opendoors
AIGoalSelectors:
- meleeattack
-clear
AITargetSelectors:
-opendoors
- clear
-meleeattack
- hurtbytarget
AITargetSelectors:
- specificfactionmonsters Orcs
-clear
- players
-hurtbytarget
Equipment:
-specificfactionmonsters Orcs
- COS_BronzeHead:4
-players
- COS_BronzeChest:3
Equipment:
- COS_BronzeLegs:2
-COS_BronzeHead HEAD
- COS_BronzeFeet:1
-COS_BronzeChest CHEST
- COS_WoodAxe:0
-COS_BronzeLegs LEGS
Skills:
-COS_BronzeFeet FEET
- skill BashI ~onAttack >0 0.25
-COS_WoodAxe HAND
Options:
Skills:
Despawn: true
-skill{s=BashI} ~onAttack >0 0.25
FollowRange: 10
Options:
AlwaysShowName: false
Despawn:true
MovementSpeed: 0.25
FollowRange:10
PreventOtherDrops: true
AlwaysShowName:false
PreventItemPickup: true
MovementSpeed:0.25
KnockbackResistance: 0.4
PreventOtherDrops:true
PreventMobKillDrops: true
PreventItemPickup:true
KnockbackResistance:0.4
PreventMobKillDrops:true
```
- So there are a few things we've configured here of note.
- So there are a few things we've configured here of note.