/** \~russian .
 *
 *   ""   ,   NPC.
 *
 ** \~english Critter.
 *
 * Represents players, as well as NPCs.
 *
 * \~ @ingroup Server
 */

class Critter
{
public:
    /**
     * \~russian @name  
     * \~english @name General fields
     * \~ @weight 200
     */
    //@{

    /** \~russian   .
     *
     ** \~english Critter's unique identifier.
     *
     ** \~
     * @see #GetCritter(uint)
     */
    const uint Id;

    /** \~russian    . */
    /** \~english Allows to check whether underlying object is valid. */
    const bool IsNotValid;

    /** \~russian    . */
    /** \~english Critter common animation type. */
    const uint8 CrType;

    /** \~russian ,   X,    . */
    /** \~english Critter's location on the map, X axis. */
    const uint16 HexX;

    /** \~russian ,   Y,    . */
    /** \~english Critter's location on the map, Y axis. */
    const uint16 HexY;

    /** \~russian ,   X,     . */
    /** \~english Critter's position on worldmap, X-coordinate. */
    const uint16 WorldX;

    /** \~russian ,   Y,     . */
    /** \~english Critter's position on worldmap, Y-coordinate. */
    const uint16 WorldY;

    /** \~russian ,    . */
    /** \~english Critter's direction. */
    const uint8 Dir;

    /** \~russian   .
     *
     * C. @link CritterConditions Critter basic conditions@endlink.
     *
     * \~english Current Critter's condition (see @link CritterConditions Critter basic conditions@endlink).
     */
    const uint8 Cond;

    /** \~russian   .
     *
     * . @link CritterConditions Extended critter conditions@endlink.
     *
     * \~english Critter's extended condition (see @link CritterConditions Extended critter conditions@endlink).
     */
    const uint8 CondExt;

    /** \~russian  ,    .
     *
     *  . @link CritterExtraFlags Critter extra flags@endlink.
     */
    const uint16 FlagsExt;

    /** \~russian   .     .
     *
     ** \~english Value describing role of the npc - usage depends on script.
     *
     ** \~
     * @see Map::GetNpc
     */
    int NpcRole;

    /** \~russian     #CRITTER_EVENT_SHOW_CRITTER_1  #CRITTER_EVENT_HIDE_CRITTER_1. */
    /** \~english Distance used by following events #CRITTER_EVENT_SHOW_CRITTER_1 and #CRITTER_EVENT_HIDE_CRITTER_1. */
    uint ShowCritterDist1;

    /** \~russian     #CRITTER_EVENT_SHOW_CRITTER_2  #CRITTER_EVENT_HIDE_CRITTER_2. */
    /** \~english Distance used by following events #CRITTER_EVENT_SHOW_CRITTER_2 and #CRITTER_EVENT_HIDE_CRITTER_2. */
    uint ShowCritterDist2;

    /** \~russian     #CRITTER_EVENT_SHOW_CRITTER_3  #CRITTER_EVENT_HIDE_CRITTER_3. */
    /** \~english Distance used by following events #CRITTER_EVENT_SHOW_CRITTER_3 and #CRITTER_EVENT_HIDE_CRITTER_3. */
    uint ShowCritterDist3;

    /** \~russian  ,          . */
    bool IsRuning;
	
	/** \~russian   .   . */
	const uint Life;
	
	/** \~russian   .   . */
	const uint Knockout;
	
	/** \~russian   .   . */
	const uint Dead;

    /** \~russian    .
     *
     *   .
     *
     * @see  ParamBase
     * @see  SetParameterGetBehaviour
     *
     */
    DataVal Param;

    /** \~russian     .
     *
     * @see  Param
     * @see  SetParameterChangeBehaviour
     *
     */
    DataRef ParamBase;

    //@}

    /**
     * \~russian @name   
     * \~english @name Scripts and events
     * \~ @weight 300
     */
    //@{

    /** \~russian            @a firstTime  @c true.
     *
     * @param   script   .
     *
     * @return  @c true   ; @c false   .
     *
     * @remarks      ,      .
     *
     ** \~english Assigns given script and calls initialization function with @a firstTime set to @c true.
     *
     * @param   script  Script name.
     *
     * @return  @c true in case of success; @c false otherwise.
     *
     * @remarks If the script or the funtion can not be found, the new script will not be set.
     */
    bool SetScript(string@+ script);

    /** \~russian  ID  ,    .
     *
     * . @b _scripts.fos, @b scripts.lst.
     *
     * @return ID  . 0,    .
     *
     ** \~english Retrieves the identifier of the script assigned to critter.
     *
     * See @b _scripts.fos, @b scripts.lst.
     *
     * @return Identifier of the script used by critter, 0 if no assigned.
     */
    uint GetScriptId();

    /** \~russian  -  .
     *
     * @param  eventType    (. @link CritterEvents Critter events@endlink).
     * @param  funcName    -.
     *
     ** \~english Assigns the event handler for given event.
     *
     * @param  eventType  Type of the event (see @link CritterEvents Critter events@endlink).
     * @param  funcName   Name of the function that will be attached as event handler.
     */
    void SetEvent(int eventType, string& funcName);

    //@}

    /**
     * \~russian @name  
     * \~english @name Invoking events
     * \~ @weight 295
     */

    //@{

    /** \~russian    #CRITTER_EVENT_IDLE. */
    /** \~english Invokes #CRITTER_EVENT_IDLE event. */
    void EventIdle();

    /** \~russian    #CRITTER_EVENT_FINISH. */
    /** \~english Invokes #CRITTER_EVENT_FINISH event. */
    void EventFinish(bool deleted);

    /** \~russian    #CRITTER_EVENT_DEAD. */
    /** \~english Invokes #CRITTER_EVENT_DEAD event. */
    void EventDead(Critter@ killer);

    /** \~russian    #CRITTER_EVENT_RESPAWN. */
    /** \~english Invokes #CRITTER_EVENT_RESPAWN event. */
    void EventRespawn();

    /** \~russian    #CRITTER_EVENT_SHOW_CRITTER. */
    /** \~english Invokes #CRITTER_EVENT_SHOW_CRITTER event. */
    void EventShowCritter(Critter& cr);

    /** \~russian    #CRITTER_EVENT_HIDE_CRITTER. */
    /** \~english Invokes #CRITTER_EVENT_HIDE_CRITTER event. */
    void EventHideCritter(Critter& cr);

    /** \~russian    #CRITTER_EVENT_SHOW_ITEM_ON_MAP. */
    /** \~english Invokes #CRITTER_EVENT_SHOW_ITEM_ON_MAP event. */
    void EventShowItemOnMap(Item& showItem, bool added, Critter@ dropper);

    /** \~russian    #CRITTER_EVENT_CHANGE_ITEM_ON_MAP. */
    /** \~english Invokes #CRITTER_EVENT_CHANGE_ITEM_ON_MAP event. */
    void EventChangeItemOnMap(Item& item);

    /** \~russian    #CRITTER_EVENT_HIDE_ITEM_ON_MAP. */
    /** \~english Invokes #CRITTER_EVENT_HIDE_ITEM_ON_MAP event. */
    void EventHideItemOnMap(Item& hideItem, bool removed, Critter@ picker);

    /** \~russian    #CRITTER_EVENT_ATTACKED. */
    /** \~english Invokes #CRITTER_EVENT_ATTACKED event. */
    bool EventAttacked(Critter& attacker);

    /** \~russian    #CRITTER_EVENT_STEALING. */
    /** \~english Invokes #CRITTER_EVENT_STEALING event. */
    void EventStealing(Critter& thief, bool success, Item& item, uint count);

    /** \~russian    #CRITTER_EVENT_MESSAGE. */
    /** \~english Invokes #CRITTER_EVENT_MESSAGE event. */
    void EventMessage(Critter& fromCrit, int message, int value);

    /** \~russian    #CRITTER_EVENT_ATTACK. */
    /** \~english Invokes #CRITTER_EVENT_ATTACK event. */
    bool EventAttack(Critter& target);

    /** \~russian    #CRITTER_EVENT_USE_ITEM. */
    /** \~english Invokes #CRITTER_EVENT_USE_ITEM event. */
    bool EventUseItem(Item& item, Critter@ onCritter, Item@ onItem, Scenery@ onScenery);

    /** \~russian    #CRITTER_EVENT_USE_SKILL. */
    /** \~english Invokes #CRITTER_EVENT_USE_SKILL event. */
    bool EventUseSkill(int skill, Critter@ onCritter, Item@ onItem, Scenery@ onScenery);

    /** \~russian    #CRITTER_EVENT_DROP_ITEM. */
    /** \~english Invokes #CRITTER_EVENT_DROP_ITEM event. */
    void EventDropItem(Item& item);

    /** \~russian    #CRITTER_EVENT_MOVE_ITEM. */
    /** \~english Invokes #CRITTER_EVENT_MOVE_ITEM event. */
    void EventMoveItem(Item& item, uint8 fromSlot);

    /** \~russian    #CRITTER_EVENT_KNOCKOUT. */
    /** \~english Invokes #CRITTER_EVENT_KNOCKOUT event. */
    void EventKnockout(uint anim2begin, uint anim2idle, uint anim2end, uint lostAp, uint knockDist);

    /** \~russian    #CRITTER_EVENT_SMTH_STEALING. */
    /** \~english Invokes #CRITTER_EVENT_SMTH_STEALING event. */
    void EventSmthStealing(Critter& fromCrit, Critter& thief, bool success, Item& item, uint count);

    /** \~russian    #CRITTER_EVENT_SMTH_ATTACK. */
    /** \~english Invokes #CRITTER_EVENT_SMTH_ATTACK event. */
    void EventSmthAttack(Critter& fromCrit, Critter& target);

    /** \~russian    #CRITTER_EVENT_SMTH_ATTACKED. */
    /** \~english Invokes #CRITTER_EVENT_SMTH_ATTACKED event. */
    void EventSmthAttack(Critter& fromCrit, Critter& target);

    /** \~russian    #CRITTER_EVENT_SMTH_USE_ITEM. */
    /** \~english Invokes #CRITTER_EVENT_SMTH_USE_ITEM event. */
    void EventSmthUseItem(Critter& fromCrit, Item& item, Critter@ onCritter, Item@ onItem, Scenery@ onScenery);

    /** \~russian    #CRITTER_EVENT_SMTH_USE_SKILL. */
    /** \~english Invokes #CRITTER_EVENT_SMTH_USE_SKILL event. */
    void EventSmthUseSkill(Critter& fromCrit, int skill, Critter@ onCritter, Item@ onItem, Scenery@ onScenery);

    /** \~russian    #CRITTER_EVENT_SMTH_DROP_ITEM. */
    /** \~english Invokes #CRITTER_EVENT_SMTH_DROP_ITEM event. */
    void EventSmthDropItem(Critter& fromCrit, Item& item);

    /** \~russian    #CRITTER_EVENT_SMTH_MOVE_ITEM. */
    /** \~english Invokes #CRITTER_EVENT_SMTH_MOVE_ITEM event. */
    void EventSmthMoveItem(Critter& fromCrit, Item& item, uint8 fromSlot);

    /** \~russian    #CRITTER_EVENT_SMTH_KNOCKOUT. */
    /** \~english Invokes #CRITTER_EVENT_SMTH_KNOCKOUT event. */
    void EventSmthKnockout(Critter& fromCrit, uint anim2begin, uint anim2idle, uint anim2end, uint lostAp, uint knockDist);

    /** \~russian    #CRITTER_EVENT_BARTER. */
    /** \~english Invokes #CRITTER_EVENT_BARTER event. */
    bool EventBarter(Critter& cr, bool attach, uint barterCount);

    /** \~russian    #CRITTER_EVENT_TALK. */
    /** \~english Invokes #CRITTER_EVENT_TALK event. */
    bool EventTalk(Critter& cr, bool attach, uint talkCount);

    /** \~russian    #CRITTER_EVENT_PLANE_BEGIN. */
    /** \~english Invokes #CRITTER_EVENT_PLANE_BEGIN event. */
    bool EventPlaneBegin(NpcPlane& plane, uint childIndex, int reason, Critter@ someCr, Item@ someItem);

    /** \~russian    #CRITTER_EVENT_PLANE_END. */
    /** \~english Invokes #CRITTER_EVENT_PLANE_END event. */
    bool EventPlaneEnd(NpcPlane& plane, uint childIndex, int reason, Critter@ someCr, Item@ someItem);

    /** \~russian    #CRITTER_EVENT_PLANE_RUN. */
    /** \~english Invokes #CRITTER_EVENT_PLANE_RUN event. */
    bool EventPlaneRun(NpcPlane& plane, uint childIndex, int reason, uint& p0, uint& p1, uint& p2);

    /** \~russian    #CRITTER_EVENT_SHOW_CRITTER_1. */
    /** \~english Invokes #CRITTER_EVENT_SHOW_CRITTER_1 event. */
    void EventShowCritter1(Critter& cr);

    /** \~russian    #CRITTER_EVENT_SHOW_CRITTER_2. */
    /** \~english Invokes #CRITTER_EVENT_SHOW_CRITTER_2 event. */
    void EventShowCritter2(Critter& cr);

    /** \~russian    #CRITTER_EVENT_SHOW_CRITTER_3. */
    /** \~english Invokes #CRITTER_EVENT_SHOW_CRITTER_3 event. */
    void EventShowCritter3(Critter& cr);

    /** \~russian    #CRITTER_EVENT_HIDE_CRITTER_1. */
    /** \~english Invokes #CRITTER_EVENT_HIDE_CRITTER_1 event. */
    void EventHideCritter1(Critter& cr);

    /** \~russian    #CRITTER_EVENT_HIDE_CRITTER_2. */
    /** \~english Invokes #CRITTER_EVENT_HIDE_CRITTER_2 event. */
    void EventHideCritter2(Critter& cr);

    /** \~russian    #CRITTER_EVENT_HIDE_CRITTER_3. */
    /** \~english Invokes #CRITTER_EVENT_HIDE_CRITTER_3 event. */
    void EventHideCritter3(Critter& cr);

    /** \~russian    #CRITTER_EVENT_GLOBAL_PROCESS. */
    /** \~english Invokes #CRITTER_EVENT_GLOBAL_PROCESS event. */
    bool EventGlobalProcess(int type, Critter& cr, Item@ car, uint& x, uint& y, uint& toX, uint& toY, uint& speed, uint& encounterDescriptor, bool& waitForAnswer);

    /** \~russian    #CRITTER_EVENT_GLOBAL_INVITE. */
    /** \~english Invokes #CRITTER_EVENT_GLOBAL_INVITE event. */
    bool EventGlobalInvite(Critter& leader, Item@ car, uint encounterDescriptor, int combatMode, uint& mapId, uint16& hexX, uint16& hexY, uint8& dir);

    //@}

    /**
     * \~russian @name 
     * \~english @name Map
     *
     * \~ @weight 290
     */
    //@{

    /** \~russian     ,    .
     *
     * @return     Map.     @c null.
     *
     ** \~english Returns a handler to the map object on which the critter is located in.
     *
     * @return Handler to the Map object in case of success, otherwise  @c null.
     */
    Map@+ GetMap();

    /** \~russian   ID ,    .
     *
     * @return ID .     0.
     *
     ** \~english Retrieves the ID of the map critter is located in.
     *
     * @return Map's ID. In case of failure (e.g. critter on worldmap)   0.
     */
    uint GetMapId();

    /** \~russian  ID  ,    .
     *
     * @return ID  .     0.
     *
     ** \~english Retrieves the ID number of map proto the critter is located in.
     *
     * @return Map's proto ID. In case of failure (e.g. critter on worldmap)   0.
     */
    uint16 GetMapProtoId();

    /** \~russian           .
     *
     * @param   zoneX, zoneY      .
     *
     * @return   . . @link GlobalMapFog Global map fog@endlink.
     *
     * @see     SetFog
     *
     ** \~english Gets fog of the player's worldmap, at given coordinates.
     *
     * @param   zoneX, zoneY  Coordinates.
     *
     * @return  Fog type, see @link GlobalMapFog Global map fog@endlink.
     *
     * @see     SetFog
     */
    int GetFog(uint16 zoneX, uint16 zoneY);

    /** \~russian          .
     *
     * @param zoneX, zoneY      .
     * @param fog             . . @link GlobalMapFog Global map fog@endlink.
     *
     * @see GetFog
     *
     ** \~english Sets fog of the player's worldmap, at given coordinates.
     *
     * @param zoneX, zoneY  Coordinates.
     * @param fog           Fog type, see @link GlobalMapFog Global map fog@endlink.
     *
     * @see GetFog
     */
    void SetFog(uint16 zoneX, uint16 zoneY, int fog);

    //@}

    /**
     * \~russian @name C
     * \~english @name Statistics
     * \~ @weight 270
     */
    //@{

    /** \~russian        .
     *
     * @param  score    (. @link Scores@endlink).
     * @param  value   .
     *
     */
    void AddScore(int score, int value);

    //@}

    /**
     * \~russian @name 
     * \~english @name Inventory
     * \~ @weight 260
     */
    //@{

    /** \~russian    .
     *
     * @return      .
     *
     * @see    SetBagRefreshTime
     */
    uint GetBagRefreshTime();

    /** \~russian    .
     *
     *     0,    -:
     *   60  120  .
     *
     * @param  realMinutes      .
     *
     * @see    GetBagRefreshTime
     */
    void SetBagRefreshTime(uint realMinutes);

    /** \~russian     .
     *
     * @param  pids       ,         .
     * @param  minCounts  ,          .
     * @param  maxCounts  ,          .
     * @param  slots      ,          .
     *
     * @see    SetInternalBag
     */
    uint GetInternalBag(uint16[]@+ pids, uint[]@+ minCounts, uint[]@+ maxCounts, int[]@+ slots);

    /** \~russian     .
     *
     *      NPC  ,    @a BagId  0.
     *
     * @param  pids           ,     .
     * @param  minCounts  ,       .
     * @param  maxCounts  ,       .
     * @param  slots         ,       .
     *
     * @see    GetInternalBag
     */
    void SetInternalBag(uint16[]& pids, uint[]@+ minCounts, uint[]@+ maxCounts, int[]@+ slots);

    /** \~russian    ,    .
     *
     * @return   .
     */
    uint ItemsCount();

    /** \~russian     ,    .
     *
     * @return     .
     */
    uint ItemsWeight();

    /** \~russian     ,    .
     *
     * @return     .
     */
    uint ItemsVolume();

    /** \~russian    ,    .
     *
     * @param   protoId  ID   (.  @b ITEMPID.H).
     *
     * @return      ,   .
     */
    uint CountItem(uint16 protoId);

    /** \~russian      ,
     *                 .
     *
     * @param  protoId  ID   (.  @b ITEMPID.H).
     * @param  slot     ,     (. @link Slots@endlink).
     *                    : -1,     .
     *
     * @return     Item,   .
     *             @c null.
     */
    Item@+ GetItem(uint16 protoId, int slot);

   /** \~russian      ,
     *              .
     *
     * @param  itemId  ID  (.  @b ITEMPID.H).
     *
     * @return     Item,   .
     *             @c null.
     */
    Item@+ GetItemById(uint itemId);

    /** \~russian   ,    .
     *
     * @param  slot   ,     (. @link Slots@endlink).
     *                  : -1,     .
     * @param  items     ,    .
     *                  ,      .
     *
     * @return   .
     */
    uint GetItems(int slot, Item@[]@+ items);

    /** \~russian      ,    .
     *
     * @param   type     (. @link ItemsTypes Items types@endlink).
     * @param   items  ,       .
     *
     * @return     .
     */
    uint GetItemsByType(int type, Item@[]@+ items);

    /** \~russian       .
     *
     * @param  objId    ID .
     * @param  toSlot  ,     (. @link Slots@endlink).
     * @param  count     .
     *
     * @return @c true     , @c false    .
     */
    bool MoveItem(uint objId, uint count, uint8 toSlot);

    /** \~russian     .
     *
     * @param  protoId     (.  @b ITEMPID.H).
     * @param  count     .
     *
     * @return     Item.     @c null.
     */
    Item@+ AddItem(uint16 protoId, uint count);

    /** \~russian     .
     *
     * @param  protoId     (.  @b ITEMPID.H).
     * @param  count     .
     *
     * @return @c true     ; @c false    .
     */
    bool DeleteItem(uint16 protoId, uint count);

    /** \~russian    .
     *
     *  ,     ,     ,
     *   1   .
     *
     * @param  hexX, hexY   ,    .
     * @param  protoId        (.  @b ITEMPID.H).
     *
     * @return @c true    ,
     *         @c false       .
     */
    bool PickItem(uint16 hexX, uint16 hexY, uint16 protoId);

    /** \~russian         .
     *
     *  .   #SetFavoriteItem.
     *
     * @param  slot  .  : @c SLOT_HAND1, @c SLOT_HAND2, @c SLOT_ARMOR.
     *
     * @see    SetFavoriteItem
     */
    uint16 GetFavoriteItem(int slot);

    /** \~russian       .
     *
     * ,   ,     
     *   .
     *
     *        #MODE_NO_FAVORITE_ITEM.
     *
     * @param  slot  . . @link Slots@endlink.
     *                  : @c SLOT_HAND1, @c SLOT_HAND2, @c SLOT_ARMOR.
     * @param  pid      .
     *
     * @see    GetFavoriteItem
     */
    void SetFavoriteItem(int slot, uint16 pid);

    /** \~russian    ,     .
     *
     * @param  slot   (. @link Slots@endlink).
     *
     * @return     ProtoItem.
     *           ,   @c null.
     */
    ProtoItem@+ GetSlotProto(int slot);

    //@}

    /**
     * \~russian @name 
     * \~english @name Movement
     * \~ @weight 250
     */
    //@{

    /** \~russian    1    .
     *
     * @return @c true      ;
     *         @c false    .
     *
     * @see    MoveToDir
     */
    bool MoveRandom();

    /** \~russian    1    .
     *
     * @param  dir   .  :
     *              0  -, 1  , 2  -  ..
     *
     * @return @c true      ;
     *         @c false    .
     *
     * @see    MoveRandom
     */
    bool MoveToDir(uint8 dir);

    /** \~russian     .
     *
     * @param  dir  .  :
     *              0  -, 1  , 2  -  ..
     *
     */
    void SetDir(uint8 dir);

    /** \~russian    .
     *
     *          .
     *
     * @param  hexX, hexY    ().
     * @param  dir         ,     ,    .
     *
     * @see    GetHomePos
     */
    void SetHomePos(uint16 hexX, uint16 hexY, uint8 dir);

    /** \~russian    .
     *
     * @param  [out]  mapId       ,     
     *                                .
     * @param  [out]  hexX, hexY  ,     
     *                             .
     * @param  [out]  dir         ,     ,
     *                               ,    .
     *
     * @see    SetHomePos
     */
    void GetHomePos(uint& mapId, uint16& hexX, uint16& hexY, uint8& dir);

    /** \~russian         .
     *
     * @param   requestGroup  ,      
     *                            (@c true)    
     *                          (@c false).
     *
     * @remarks    .
     */
    bool TransitToGlobal(bool requestGroup);

    /** \~russian     .
     *
     * @param  group   ,       .
     *
     * @return @c true    ; @c false    .
     *
     * @remarks ,    ,     .
     *
     * @remarks         .  - 
     *             ,       ,   
     *              ,     , 
     *            .
     */
    bool TransitToGlobal(Critter@[]& group);

    /** \~russian        .
     *
     * @param   critterId   ,     .
     *                          .
     *
     * @return  @c true    ; @c false    .
     *
     * @remarks ,    ,     .
     */
    bool TransitToGlobalGroup(uint critterId);

    /** \~russian        .
     *
     * @param   hexX, hexY   ,     .
     * @param   dir            .
     *
     * @remarks  NPC     .
     *
     * @remarks   <tt>dir > 5</tt>,     .
     */
    bool TransitToHex(uint16 hexX, uint16 hexY, uint8 dir);

    /** \~russian     ,     .
     *
     * @param   mapId        .
     * @param   hexX, hexY   ,    .
     * @param   dir            .
     *
     * @remarks  NPC     .
     *
     * @remarks   <tt>dir > 5</tt>,     .
     */
    bool TransitToMap(uint mapId, uint16 hexX, uint16 hexY, uint8 dir);

    /** \~russian     ,        .
     *
     * @param   mapId       .
     * @param   entireNum     (   ).
     *
     * @remarks  NPC     .
     */
    bool TransitToMap(uint mapId, uint8 entireNum);

    //@}

    /**
     * \~russian @name 
     * \~english @name Talk
     * \~ @weight 240
     */
    //@{

    /** \~russian    -.
     *
     *  NPC     ,      .
     *
     * @param  howSay   . :  ,   ..
     *                 (. @link SayTypes Say types@endlink).
     * @param  text     .
     */
    void Say(uint8 howSay, string@ text);

    /** \~russian    -.
     *
     *     .  NPC     ,
     *      .
     *
     * @param  howSay    , :  ,   ..
     *                  (. @link SayTypes Say types@endlink).
     * @param  textMsg     
     *                  (. @link MsgNums Msg nums@endlink).
     * @param  strNum      .
     */
    void SayMsg(uint8 howSay, uint16 textMsg, uint strNum);

    /** \~russian    -.
     *
     *     .  NPC     ,
     *      .
     *
     * @param  howSay    , :  ,   ..
     *                  (. @link SayTypes Say types@endlink).
     * @param  textMsg      (. @link MsgNums Msg nums@endlink).
     * @param  strNum      .
     * @param  lexems    
     *                  (. <a href="http://fonline.ru/fowork/wiki/index.php/:___#@lex name@">  </a>).
     */
    void SayMsg(uint8 howSay, uint16 textMsg, uint strNum, string& lexems);

    //@}

    /**
     * \~russian @name 
     * \~english @name Locations
     * \~ @weight 230
     */
    //@{

    /** \~russian  ,        .
     *
     * @param  byId       @c true,
     *                  @a locNum     ;
     *                  @c false     .
     * @param  locNum     (.  @b _maps.fos) 
     *                   .
     *
     * @return @c true   ; @c false   .
     *
     * @see    SetKnownLoc
     * @see    UnsetKnownLoc
     */
    bool IsKnownLoc(bool byId, uint locNum);

    /** \~russian     .
     *
     * @param  byId       @c true,  @a locNum 
     *                    ,  @c false 
     *                    .
     * @param  locNum     (.  @b _maps.fos) 
     *                   .
     *
     * @return @c true    ; @c false    .
     *
     * @see    IsKnownLoc
     * @see    UnsetKnownLoc
     */
    bool SetKnownLoc(bool byId, uint locNum);

    /** \~russian     .
     *
     * @param  byId       @c true,  @a locNum 
     *                    ,  @c false 
     *                    .
     * @param  locNum     (.  @b _maps.fos) 
     *                   .
     *
     * @return @c true    , @c false    .
     *
     * @see    IsKnownLoc
     * @see    SetKnownLoc
     */
    bool UnsetKnownLoc(bool byId, uint locNum);

    //@}

    /**
     * \~russian @name 
     * \~english @name Plans
     * \~ @weight 220
     */
    //@{

    /** \~russian   NPC.
     *
     *     . C  (..   )
     *       (. NpcPlane::Priority).
     *
     * @param   plane   .
     *
     * @return  @c true    ; @c false    .
     *
     * @remarks     NpcPlane    ::CreatePlane.
     */
    bool AddPlane(NpcPlane@+ plane);

    /** \~russian     .
     *
     * @param  index      .
     *
     * @return @c true    ; @c false    .
     */
    bool ErasePlane(uint index);

    /** \~russian  ()  .
     *
     * @param  planeType  ,   
     *                   (. @link PlanesTypes Planes types@endlink).
     *                     : -1,      .
     * @param  all          @c true,      .
     *                       @c false,     
     *                    ,     .
     *
     * @return     .
     *                .
     */
    uint ErasePlane(int planeType, bool all);

    /** \~russian   .
     *
     * @return  .
     */
    NpcPlane@+ GetCurPlane();

    /** \~russian      NPC.
     *
     * @param   planes  ,        .
     *
     * @return    .
     *
     * @remarks      ,
     *            @a planes    @c null  .
     */
    uint GetPlanes(NpcPlane@[]@+ planes);

    /** \~russian  ,      .
     *
     * @return @c true       ;
     *         @c false   .
     */
    bool IsNoPlanes();

    /** \~russian       .
     *
     * @param   identifier   .
     * @param   planes  ,        .
     *
     * @return    .
     */
    uint GetPlanes(int identifier, NpcPlane@[]@+ planes);

    /** \~russian        identifierExt.
     *
     * @param   identifierExt   identifierExt ,     .
     * @param   planes  ,        .
     *
     * @return    .
     */
    uint GetPlanesByExt(uint identifierExt, NpcPlane@[]@+ planes);

    /** \~russian        identifier  identifierExt.
     *
     * @param   identifier   identifier ,     .
     * @param   identifierExt   identifierExt ,     .
     * @param   planes  ,        .
     *
     * @return    .
     */
    uint GetPlanes(int identifier, uint identifierExt, NpcPlane@[]@+ planes);

    /** \~russian C   NPC. */
    /** \~english Drops all NPC planes. */
    void DropPlanes();

    //@}

    /**
     * \~russian @name 
     * \~english @name Notifications
     * \~ @weight 210
     */
    //@{

    /** \~russian       .
     *
     * @param   var    .
     *
     * @remarks   .
     */
    void SendQuestVar(GameVar& var);

    /** \~russian       .
     *
     * @param  combatResult  ,       .
     *                             .  
     *                          
     *                       (   .  @b combat_msg.fos).
     *
     * @remarks   .
     *
     ** \~english Sends the results of the combat to players.
     *
     * @param  combatResult Result to send. First uint should be equal the @a combatResult
     *                      length, then it should be followed by any number of records
     *                      (for their definition, look in combat_msg.fos).
     *
     * @remarks Only for players.
     */
    void SendCombatResult(uint[]& combatResult);

    /** \~russian         .
     *
     * @param   index     . . @link Params  @endlink.
     * @param   enabled     .
     *
     * @remarks -,   .
     * @remarks   .
     */
    void SetSendParam(uint index, bool enabled);

    /** \~russian    .
     *
     *      ,     
     *   ::on_message.     .
     *
     * @param  num   .
     * @param  val   .
     * @param  to   ,   
     *              (. @link InSendMessage In SendMessage@endlink).
     *
     * @see    CRITTER_EVENT_MESSAGE
     */
    void SendMessage(int num, int val, int to);

    //@}

    /**
     * \~russian @name 
     * \~english @name State
     * \~ @weight 200
     */
    //@{

    /** \~russian ,     .
     *
     * @return @c true    ; @c false    .
     *
     * @see    IsBusy
     */
    bool IsFree();

    /** \~russian ,     .
     *
     * @return @c true    ; @c false    .
     *
     * @see    IsFree
     */
    bool IsBusy();

    /** \~russian ,   .
     *
     * @return @c true    ; @c false    .
     *
     * @see    ToDead
     * @see    IsKnockout
     * @see    IsLife
     */
    bool IsDead();

    /** \~russian ,     .
     *
     * @return @c true     ; @c false    .
     *
     * @see    ToKnockout
     * @see    IsDead
     * @see    IsLife
     */
    bool IsKnockout();

    /** \~russian ,   .
     *
     * @return @c true    ; @c false    .
     *
     * @see    ToLife
     * @see    IsDead
     * @see    IsKnockout
     */
    bool IsLife();

    /** \~russian  .
     *
     * @param  anim2       
     *                   (. <b>COND_DEAD_...</b>  @link CritterConditions Critter extended conditions@endlink).
     * @param  killer      -.
     *
     * @see    IsDead
     */
    void ToDead(uint anim2, Critter@+ killer);

    /** \~russian    .
     *
     * @param   anim2begin          
     * @param   anim2idle            
     * @param   anim2end             
     * @param   lostAp              ,     .
     * @param   knockHx, knockHy  ,    .
     *
     * @return  @c true    ; @c false    .
     *
     * @remarks    ,    ,
     *             .      
     *              .
     *
     * @see     IsKnockout
     */
    bool ToKnockout(uint anim2begin, uint anim2idle, uint anim2end, uint lostAp, uint16 knockHx, uint16 knockHy);

    /** \~russian     .
     *
     *      (,  ),
     *    .
     *
     * @return @c true    ; @c false    .
     *
     * @see    IsLife
     */
    bool ToLife();

    //@}

    /**
     * \~russian @name 
     * \~english @name Animation
     * \~ @weight 190
     */
    //@{

    /** \~russian        .
     *
     *     (. @b Animation   @b _macros.fos).
     *
     *    ,    .
     *
     *      ,     - ,
     *        .
     *
     * @param  anim1            (. @b ANIM1_*  @b _animation.fos).
     * @param  anim2            (. @b ANIM2_*  @b _animation.fos).
     * @param  item            ,   .
     * @param  clearSequence   .
     *                        @c false     .
     * @param  delayPlay       <code>clearSequence == false</code>.
     *                               ( ,
     *                             ).
     *
     ** \~ @see #animation2d_process
     *     @see #animation3d_process
     */
    void Animate(uint anim1, uint anim2, Item@+ item, bool clearSequence, bool delayPlay);

    /** \~russian C  .
     *
     * @param  newType   .
     *                  . <a href="http://www.fonline.ru/forum/showthread.php?t=4511">      </a>.
     *
     * @return @c true    , @c false    .
     */
    bool ChangeCrType(uint newType);

    /** \~russian     
     *              (, )
     *
     * @param   index   .
     *
     * @return  @c true     ,
     *          @c false    .
     */
    bool IsAnim1(uint index);
	
	/** \~russian        (,  , ).
     *
     * @param  cond        (. COND_*  _defines.fos),      .
     * @param  anim1   .
     * @param  anim2   .
     *
     */
	void SetAnims(int cond, uint anim1, uint anim2);

    //@}

    /**
     * \~russian @name   ()
     * \~english @name Party
     * \~ @weight 180
     */
    //@{

    /** \~russian  ,       .
     *
     * @param   findType    (. @link CritterFindTypes Critter find types@endlink).
     * @param   critters   ,       .
     *
     * @return    .
     *
     * @remarks      ,
     *            @a critters    @c null  .
     * @remarks        .
     */
    uint GetFollowGroup(int findType, Critter@[]@+ critters);

    /** \~russian    ,    .
     *
     * @return   ,    ,   
     *           .     @c null.
     */
    Critter@+ GetFollowLeader();

    /** \~russian      ,    .
     *
     * @return ,   ,      .
     *              ,    @c null.
     *
     */
    Critter@[]@+ GetGlobalGroup();

    //@}

    /** \~russian @name     
     *
     *     30.
     *
     ** \~english @name Enemy stack
     *
     * Maximum size of stack  30.
     *
     ** \~ @weight 170
     */
    //@{

    /** \~russian     ID   .
     *
     * @param  critterId  ID  .
     */
    void AddEnemyInStack(uint critterId);

    /** \~russian     .
     *
     * @param  newSize    .    30.
     */
    void ChangeEnemyStackSize(uint newSize);

    /** \~russian  ,      ID   .
     *
     * @param  critterId  ID  .
     *
     * @return @c true  ; @c false   .
     */
    bool CheckEnemyInStack(uint critterId);

    /** \~russian   . */
    void ClearEnemyStack();

    /** \~russian     ID   .
     *
     * @param  critterId  ID  .
     */
    void EraseEnemyFromStack(uint critterId);

    /** \~russian   ID  ,   .
     *
     * @param  enemyStack  ,      ID  .
     */
    void GetEnemyStack(uint[]& enemyStack);

    //@}

    /**
     * \~russian @name   
     * \~english @name Holodisks
     * \~ @weight 160
     */
    //@{

    /** \~russian   -    .
     *
     * @param  holodiskNum   .
     * @see    EraseHolodiskInfo
     * @see    IsHolodiskInfo
     */
    void AddHolodiskInfo(uint holodiskNum);

    /** \~russian   -    .
     *
     * @param  holodiskNum  .
     * @see    AddHolodiskInfo
     * @see    IsHolodiskInfo
     */
    void EraseHolodiskInfo(uint holodiskNum);

    /** \~russian  ,    -    .
     *
     * @param  holodiskNum   .
     *
     * @return @c true   ; @c false   .
     *
     * @see    AddHolodiskInfo
     * @see    EraseHolodiskInfo
     */
    bool IsHolodiskInfo(uint holodiskNum);

    //@}

    /**
     * \~russian @name      .
     * \~english @name %Critter time events
     * \~ @weight 150
     */
    //@{

    /** \~russian    .
	 *
	 * @param  funcName  @ref term_func_link.
	 * @param  duration    (  )     .
	 * @param  int identifier  ,       .
	 *
	 * @return   true   .
	 *
	 * @see  @ref  critters_time_events
	 */
    bool AddTimeEvent(string& funcName, uint duration, int identifier);
	

    /** \~russian        rate.
	 *
	 * @param  funcName  @ref term_func_link.
	 * @param  duration    (  )     .
	 * @param  int identifier  ,       .
	 * @param  rate   ,     ,       rate,         .
	 *
	 * @return   true   .
	 *
	 * @see  @ref  critters_time_events
	 */
    bool AddTimeEvent(string& funcName, uint duration, int identifier, uint rate);

    /** \~russian    .
	 *
	 * @param  index   ,   .
	 * @param  newDuration      .
	 * @param  newRate     rate.
	 *
	 * @see  @ref  critters_time_events
	 */
    void ChangeTimeEvent(uint index, uint newDuration, uint newRate);

    /** \~russian        .
	 *
	 * @param  identifier      .
	 * @param  indexes   .
	 * @param  durations    .
	 * @param  rates    rate  .
	 *
	 * @return    .
	 *
	 * @see  @ref  critters_time_events
	 */
    uint GetTimeEvents(int identifier, uint[]@+ indexes, uint[]@+ durations, uint[]@+ rates);

    /** \~russian     ,      identifier   .
	 *
	 * @param  findIdentifiers    .
	 * @param  identifiers      .
	 * @param  indexes   .
	 * @param  durations    .
	 * @param  rates    rate .
	 *
	 * @return    .
	 *
	 * @see  @ref  critters_time_events
	 */
    uint GetTimeEvents(int[]& findIdentifiers, int[]@+ identifiers, uint[]@+ indexes, uint[]@+ durations, uint[]@+ rates);

    /** \~russian        .
	 *
	 * @param  index   ,   
	 *
	 * @see  @ref  critters_time_events
	 */
    void EraseTimeEvent(uint index);

    /** \~russian       .
	 *
	 * @param  identifier  ,   ,  ,   .
	 *
	 * @return    
	 *
	 * @see  @ref  critters_time_events
	 */
    uint EraseTimeEvents(int identifier);

    /** \~russian       .
	 *
	 * @param  identifiers     ,   .
	 *
	 * @return    .
	 *
	 * @see  @ref  critters_time_events
	*/
    uint EraseTimeEvents(int[]& identifiers);

    //@}

	/**
     * \~russian @name 
     * \~english @name Multihex
     *
     * \~ @weight 145
     */
    //@{
	
	/** \~russian      */
	uint GetMultihex();
	
	/** \~russian      
	 *
	 * \~russian @remarks  value  -1     - ( -   CritterType.cfg)
	 */
	void SetMultihex(int value);
	
	//@}
	
    /**
     * \~russian @name 
     * \~english @name Miscellaneous
     * \~ @weight 140
     */
    //@{

    /** \~russian    . */
    uint16 GetProtoId();

    /** \~russian  ,    NPC.
     *
     * @return @c true     NPC; @c false    .
     */
    bool IsNpc();

    /** \~russian  ,    .
     *
     * @return @c true     ; @c false    .
     */
    bool IsPlayer();

    /** \~russian      .
     *
     *       .\n
	 * \b :       @ref term_critter "",   .
	 * 
     * @param  ms   ( , 1  = 1000 ),    .
     *
     * @see    CRITTER_EVENT_IDLE
     */
    void Wait(uint ms);

    /** \~russian    .
     *
     * @param  contCr          ,    .
     * @param  contItem        -,    .
     * @param  transferType    (. @link TransferTypes Transfer types@endlink).
     */
    void ShowContainer(Critter@+ contCr, Item@+ contItem, uint8 transferType);

    /** \~russian     .
     *
     * @param   lookOnMe    @c true  ,   ,
     *                      @c false  ,   .
     * @param   findType    (. @link CritterFindTypes Critter find types@endlink).
     * @param   critters   ,       .
     *
     * @return    .
     *
     * @remarks      ,
     *            @a critters    @c null  .
     *
     * @remarks        .
     */
    uint GetCritters(bool lookOnMe, int findType, Critter@[]@+ critters);

    /** \~russian    ,   .
     *
     * @param   players   ,        .
     *
     * @return   ,   .
     *
     * @remarks    NPC.
     * @remarks    ,   -  ,
     *            @c null     @a players.
     * @remarks      NPC     .
     * @remarks        .
     */
    uint GetTalkedPlayers(Critter@[]@+ players);

    /** \~russian      -,       . */
    void DropTimers();

    /** \~russian     ,    .
     *
     *        <a href="http://fonline.ru/fowork/wiki/index.php/:   ">  </a>.
     *
     * @param   screenType    (. @link ShowScreenModes Show screen modes@endlink).
     * @param   param        .
     * @param   funcName       .
     *
     * @remarks  ( )      
     *           @c ShowScreen, ..   @c ShowScreen 
     *           .        
     *           ,      .
     */
    void ShowScreen(int screenType, uint param, string& funcName);

    /** \~russian        .
     *
     * @param  soundName     .
     * @param  sendSelf         .
     */
    void PlaySound(string& soundName, bool sendSelf);

    /** \~russian        .
     *
     * @param  soundType, soundTypeExt, soundId, soundIdExt   .
     *                        soundType 
     *                   (. @link SoundTypes Sound types@endlink).
     * @param  sendSelf        .
     */
    void PlaySound(uint8 soundType, uint8 soundTypeExt,
        uint8 soundId, uint8 soundIdExt, bool sendSelf);

    /** \~russian     .
     *
     *      (. <strong>templates.fos</strong>):
     * @code
     * void __FuncName(int param0, int param1, int param2, string@ param3, int[]@ param4);
     * @endcode
     *
     * @param  funcName             .
     * @param  p0, p1, p2, p3, p4       .
     */
    void RunClientScript(string& funcName, int p0, int p1, int p2, string@+ p3, int[]@+ p4);

    /** \~russian    ,      .
     *
     * @param lexems C   (. <a href="http://fonline.ru/fowork/wiki/index.php/:___#@lex name@">  \@lex\@</a>,    ).
     */
    void SetLexems(string@+ lexems);

    /** \~russian  ,    .
     *
     *   , ,     ,  ,  
     *  :         .
     */
    bool IsCanWalk();

    /** \~russian  ,     .
     */
    bool IsCanRun();

    /** \~russian  ,    .
     */
    bool IsCanRotate();

    /** \~russian  ,     .
     *
     *     .
     *
     */
    bool IsCanAim();

    /**     .
     *
     * @return    (. @link AccessLevels Access levels@endlink).
     */
    int GetAccess();

    /** \~russian ,     .
     *
     * @param  cr  ,   .
     *
     * @return @c true     ; @c false    .
     */
    bool IsSee(Critter& cr);

    /** \~russian ,     .
     *
     * @param  cr  ,      .
     *
     * @return @c true      ;
     *         @c false    .
     */
    bool IsSeenBy(Critter& cr);

    /** \~russian ,     .
     *
     * @param  item  ,   .
     *
     * @return @c true     ; @c false    .
     */
    bool IsSee(Item& item);

    /** \~russian   . */
    void RefreshVisible();

    /** \~russian       #critter_action.
     *
     * @param  action      (. @link CritterActions  @endlink).
     * @param  actionExt       .
     *                        .
     * @param  item       ,   .
     *
     ** \~ @see #critter_action
     */
    void Action(int action, int actionExt, Item@+ item);

    //@}
}
