View Single Post
Old 19.04.2006, 16:01   #3
humordwarf
Архивный участник
 
Join Date: Feb 2006
Posts: 453
Default Re: [AI TUT] aggro mobs: changing aggro logic

Quote:
Originally Posted by humordwarf
example 1: what if mob desire attack players with level>40 only?
example 2: what if mob desire attack only if player not have some quest item (OwnItemCount function) hmm.. (almost same as "silence" skill =))?
example 3: what if mob desire attack orcs only ?
1.
Code:
EventHandler SEE_CREATURE(creature, myself) { 
    if ((GetLifeTime() > 7)  &&  (creature.level > 40) &&  InMyTerritory(myself.sm)) { 
        AddAttackDesire(creature); 
    } 
}
2.
Code:
EventHandler SEE_CREATURE(creature, myself) { 
    if ((GetLifeTime() > 7)  &&  (OwnItemCount(creature, MaigcItemID)!=0) &&  InMyTerritory(myself.sm)) { 
        AddAttackDesire(creature); 
    } 
}
3.
Code:
EventHandler SEE_CREATURE(creature, myself) { 
    if ((GetLifeTime() > 7)  &&  (creature.race == OrcRaceID) &&  InMyTerritory(myself.sm)) { 
        AddAttackDesire(creature); 
    } 
}
humordwarf is offline