Repository navigation
Routine: SetTarget
Haliotro edited this page Sep 1, 2012
·
15 revisions
Makes the entity run the given command. Viable entities include players and console.
- '{entity}.settarget.{otherentity or none}'#Assume players that you don't want being targeted have a tag value of 1 for a tag labeled noaggro.
Target: #Don't let them aggro this player!
- 'if target_tagvalue_noaggro = 1':
- 'entity.settarget.none' #First, you're removing the target's aggro altogether
- 'if nearby.player.10': #Second, you're looking for any other viable targets so that the same player doesn't keep taking and canceling the aggro
- 'if it_tagvalue_noaggro <> 1':
- 'entity.settarget.it'
Damage: #Cause a zombie to become confused and attack his own kind.
- 'switch.attacker.type':
- 'Player'
- 'if target.type.Zombie':
- 'if chance.5': #give a 5% chance to cause the zombie to attack nearby zombies
- 'if nearby.Zombie.10': #check for other nearby zombies
- 'target.settarget.it' #change target to a nearby zombie
- 'tag.target.aggrochanged': '1' #set a flag so you know that aggro was changed
- 'if target_tagvalue_aggrochanged = 1':
- 'tag.target.aggrochanged': '0' #unset the flag
- 'message.attacker':
- '&aThe zombie is now confused!'