Repository navigation
Routine: SetTarget
Haliotro edited this page Sep 1, 2012
·
15 revisions
Makes the entity change its aggro target. Valid targets are the valid entity references for the Event type that you are in, or the value {none}.
- '{entity}.settarget.{otherentity or none}'#Let's assume that you've been tagging players that you don't want being targeted
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!'