#ifndef CAITRIGGER_H_
#define CAITRIGGER_H_

#include "CAIObjectType.h"

// TRIGGER.IDS:

#define CAITRIGGER_NO_TRIGGER 0x0000
#define CAITRIGGER_ACQUIRED 0x0001
#define CAITRIGGER_ATTACKEDBY 0x0002
#define CAITRIGGER_HELP 0x0003
#define CAITRIGGER_JOINS 0x0004
#define CAITRIGGER_LEAVES 0x0005
#define CAITRIGGER_RECEIVEDORDER 0x0006
#define CAITRIGGER_SAID 0x0007
#define CAITRIGGER_TURNEDBY 0x0008
#define CAITRIGGER_UNUSABLE 0x0009
#define CAITRIGGER_ALIGNMENT 0x400A
#define CAITRIGGER_ALLEGIANCE 0x400B
#define CAITRIGGER_CLASS 0x400C
#define CAITRIGGER_EXISTS 0x400D
#define CAITRIGGER_GENERAL 0x400E
#define CAITRIGGER_GLOBAL 0x400F
#define CAITRIGGER_HP 0x4010
#define CAITRIGGER_HPGT 0x4011
#define CAITRIGGER_HPLT 0x4012
#define CAITRIGGER_LOS 0x4013
#define CAITRIGGER_MORALE 0x4014
#define CAITRIGGER_MORALEGT 0x4015
#define CAITRIGGER_MORALELT 0x4016
#define CAITRIGGER_RACE 0x4017
#define CAITRIGGER_RANGE 0x4018
#define CAITRIGGER_REPUTATION 0x4019
#define CAITRIGGER_REPUTATIONGT 0x401A
#define CAITRIGGER_REPUTATIONLT 0x401B
#define CAITRIGGER_SEE 0x401C
#define CAITRIGGER_SPECIFICS 0x401D
#define CAITRIGGER_TIME 0x401E
#define CAITRIGGER_TIMEOFDAY 0x401F
#define CAITRIGGER_HITBY 0x0020
#define CAITRIGGER_HOTKEY 0x0021
#define CAITRIGGER_TIMEREXPIRED 0x0022
#define CAITRIGGER_TRUE 0x4023
#define CAITRIGGER_TRIGGER 0x0024
#define CAITRIGGER_DIE 0x0025
#define CAITRIGGER_TARGETUNREACHABLE 0x0026
#define CAITRIGGER_DELAY 0x4027
#define CAITRIGGER_NUMCREATURE 0x4028
#define CAITRIGGER_NUMCREATURELT 0x4029
#define CAITRIGGER_NUMCREATUREGT 0x402A
#define CAITRIGGER_ACTIONLISTEMPTY 0x402B
#define CAITRIGGER_HPPERCENT 0x402C
#define CAITRIGGER_HPPERCENTLT 0x402D
#define CAITRIGGER_HPPERCENTGT 0x402E
#define CAITRIGGER_HEARD 0x002F
#define CAITRIGGER_FALSE 0x4030
#define CAITRIGGER_HAVESPELL 0x4031
#define CAITRIGGER_HAVEANYSPELLS 0x4032
#define CAITRIGGER_BECAMEVISIBLE 0x0033
#define CAITRIGGER_GLOBALGT 0x4034
#define CAITRIGGER_GLOBALLT 0x4035
#define CAITRIGGER_ONCREATION 0x0036
#define CAITRIGGER_STATECHECK 0x4037
#define CAITRIGGER_NOTSTATECHECK 0x4038
#define CAITRIGGER_NUMTIMESTALKEDTO 0x4039
#define CAITRIGGER_NUMTIMESTALKEDTOGT 0x403A
#define CAITRIGGER_NUMTIMESTALKEDTOLT 0x403B
#define CAITRIGGER_REACTION 0x403C
#define CAITRIGGER_REACTIONGT 0x403D
#define CAITRIGGER_REACTIONLT 0x403E
#define CAITRIGGER_GLOBALTIMEREXACT 0x403F
#define CAITRIGGER_GLOBALTIMEREXPIRED 0x4040
#define CAITRIGGER_GLOBALTIMERNOTEXPIRED 0x4041
#define CAITRIGGER_PARTYHASITEM 0x4042
#define CAITRIGGER_INPARTY 0x4043
#define CAITRIGGER_CHECKSTAT 0x4044
#define CAITRIGGER_CHECKSTATGT 0x4045
#define CAITRIGGER_CHECKSTATLT 0x4046
#define CAITRIGGER_RANDOMNUM 0x4047
#define CAITRIGGER_RANDOMNUMGT 0x4048
#define CAITRIGGER_RANDOMNUMLT 0x4049
#define CAITRIGGER_DIED 0x004A
#define CAITRIGGER_KILLED 0x004B
#define CAITRIGGER_ENTERED 0x004C
#define CAITRIGGER_GENDER 0x404D
#define CAITRIGGER_PARTYGOLD 0x404E
#define CAITRIGGER_PARTYGOLDGT 0x404F
#define CAITRIGGER_PARTYGOLDLT 0x4050
#define CAITRIGGER_DEAD 0x4051
#define CAITRIGGER_OPENED 0x0052
#define CAITRIGGER_CLOSED 0x0053
#define CAITRIGGER_DETECTED 0x0054
#define CAITRIGGER_RESET 0x0055
#define CAITRIGGER_DISARMED 0x0056
#define CAITRIGGER_UNLOCKED 0x0057
#define CAITRIGGER_HAVEUSABLEWEAPONEQUIPPED 0x4058
#define CAITRIGGER_NUMTIMESINTERACTED 0x4059
#define CAITRIGGER_NUMTIMESINTERACTEDGT 0x405A
#define CAITRIGGER_NUMTIMESINTERACTEDLT 0x405B
#define CAITRIGGER_BREAKINGPOINT 0x005C
#define CAITRIGGER_PICKPOCKETFAILED 0x005D
#define CAITRIGGER_STEALFAILED 0x005E
#define CAITRIGGER_DISARMFAILED 0x005F
#define CAITRIGGER_PICKLOCKFAILED 0x0060
#define CAITRIGGER_HASITEM 0x4061
#define CAITRIGGER_INTERACTINGWITH 0x4062
#define CAITRIGGER_INWEAPONRANGE 0x4063
#define CAITRIGGER_HASWEAPONEQUIPED 0x4064
#define CAITRIGGER_HAPPINESS 0x4065
#define CAITRIGGER_HAPPINESSGT 0x4066
#define CAITRIGGER_HAPPINESSLT 0x4067
#define CAITRIGGER_TIMEGT 0x4068
#define CAITRIGGER_TIMELT 0x4069
#define CAITRIGGER_NUMINPARTY 0x406A
#define CAITRIGGER_NUMINPARTYGT 0x406B
#define CAITRIGGER_NUMINPARTYLT 0x406C
#define CAITRIGGER_UNSELECTABLEVARIABLE 0x406D
#define CAITRIGGER_UNSELECTABLEVARIABLEGT 0x406E
#define CAITRIGGER_UNSELECTABLEVARIABLELT 0x406F
#define CAITRIGGER_CLICKED 0x0070
#define CAITRIGGER_NUMBEROFTIMESTALKEDTO 0x4039
#define CAITRIGGER_NUMDEAD 0x4071
#define CAITRIGGER_NUMDEADGT 0x4072
#define CAITRIGGER_NUMDEADLT 0x4073
#define CAITRIGGER_DETECT 0x4074
#define CAITRIGGER_CONTAINS 0x4075
#define CAITRIGGER_OPENSTATE 0x4076
#define CAITRIGGER_NUMITEMS 0x4077
#define CAITRIGGER_NUMITEMSGT 0x4078
#define CAITRIGGER_NUMITEMSLT 0x4079
#define CAITRIGGER_NUMITEMSPARTY 0x407A
#define CAITRIGGER_NUMITEMSPARTYGT 0x407B
#define CAITRIGGER_NUMITEMSPARTYLT 0x407C
#define CAITRIGGER_ISOVERME 0x407D
#define CAITRIGGER_OR 0x4089
#define CAITRIGGER_LEVEL 0x4094
#define CAITRIGGER_LEVELGT 0x4095
#define CAITRIGGER_LEVELLT 0x4096
#define CAITRIGGER_TIMERACTIVE 0x4097
#define CAITRIGGER_CLASSEX 0x4098
#define CAITRIGGER_NEARSAVEDLOCATION 0x4099
#define CAITRIGGER_INTERNAL 0x40A0
#define CAITRIGGER_INTERNALGT 0x40A1
#define CAITRIGGER_INTERNALLT 0x40A2
#define CAITRIGGER_SCHOOL 0x40A3
#define CAITRIGGER_ISWEAPONRANGED 0x40A4
#define CAITRIGGER_BITGLOBAL 0x40A5
#define CAITRIGGER_GLOBALBITGLOBAL 0x40A6
#define CAITRIGGER_CREATUREHIDDEN 0x40A7
#define CAITRIGGER_HELPEX 0x40A8
#define CAITRIGGER_NEARLOCATION 0x40A9
#define CAITRIGGER_CHECKPARTYLEVEL 0x40AA
#define CAITRIGGER_DIFFICULTY 0x40AB
#define CAITRIGGER_CHECKSPELLSTATE 0x40AD
#define CAITRIGGER_ISHEARTOFFURYMODEON 0x40AE
#define CAITRIGGER_SEQUENCE 0x40AF
#define CAITRIGGER_ONISLAND 0x40B0
#define CAITRIGGER_MODALSTATE 0x40B1
#define CAITRIGGER_SUMMONINGLIMIT 0x40B2
#define CAITRIGGER_SUMMONINGLIMITGT 0x40B3
#define CAITRIGGER_SUMMONINGLIMITLT 0x40B4
#define CAITRIGGER_TOTALITEMCNT 0x40B5
#define CAITRIGGER_TOTALITEMCNTGT 0x40B6
#define CAITRIGGER_TOTALITEMCNTLT 0x40B7
#define CAITRIGGER_PARTYLEVELVS 0x40B8
#define CAITRIGGER_PARTYLEVELVSGT 0x40B9
#define CAITRIGGER_PARTYLEVELVSLT 0x40C0
#define CAITRIGGER_TOTALITEMCNTEXCLUDE 0x40C1
#define CAITRIGGER_TOTALITEMCNTEXCLUDEGT 0x40C2
#define CAITRIGGER_TOTALITEMCNTEXCLUDELT 0x40C3
#define CAITRIGGER_CHECKPARTYAVERAGELEVEL 0x40C4
#define CAITRIGGER_ITEMISIDENTIFIED 0x40C5
#define CAITRIGGER_NEARBYDIALOG 0x40C6
#define CAITRIGGER_CHECKAREADIFFLEVEL 0x40C7
#define CAITRIGGER_HASINNATEABILITY 0x40C8
#define CAITRIGGER_TRIGGERSETGLOBAL 0x40C9
#define CAITRIGGER_NUMCREATURESGTMYLEVEL 0x40CC
#define CAITRIGGER_NUMCREATURESATMYLEVEL 0x40CB
#define CAITRIGGER_NUMCREATURESLTMYLEVEL 0x40CA
#define CAITRIGGER_SUBRACE 0x40CD
#define CAITRIGGER_KIT 0x40CE
#define CAITRIGGER_CURRENTAREAIS 0x40CF
#define CAITRIGGER_ISSCRIPTNAME 0x40D0
#define CAITRIGGER_ENTIREPARTYONMAP 0x40D1
#define CAITRIGGER_AREARESTDISABLED 0x40D2
#define CAITRIGGER_ANYPCONMAP 0x40D3
#define CAITRIGGER_CHECKDOORFLAGS 0x40D4
#define CAITRIGGER_ISCREATUREHIDDENINSHADOWS 0x40D5
#define CAITRIGGER_CHARGECOUNT 0x40D6
#define CAITRIGGER_ISACTIVE 0x40D7
#define CAITRIGGER_ISROTATION 0x40D8
#define CAITRIGGER_ISFACINGSAVEDROTATION 0x40D9
#define CAITRIGGER_FRAME 0x40DA
#define CAITRIGGER_HPLOST 0x40DB
#define CAITRIGGER_HPLOSTGT 0x40DC
#define CAITRIGGER_HPLOSTLT 0x40DD
#define CAITRIGGER_FALLENPALADIN 0x40DE
#define CAITRIGGER_ISANIMATIONID 0x40DF
#define CAITRIGGER_ISMARKEDSPELL 0x40E0
#define CAITRIGGER_SETLASTMARKEDOBJECT 0x40E1
#define CAITRIGGER_SETMARKEDSPELL 0x40E2
#define CAITRIGGER_GLOBALTIMERSTARTED 0x40E3
#define CAITRIGGER_ISTEAMBITON 0x40E4
#define CAITRIGGER_ISPLAYERNUMBER 0x40E5
#define CAITRIGGER_CHECKSKILL 0x40E6
#define CAITRIGGER_CHECKSKILLGT 0x40E7
#define CAITRIGGER_CHECKSKILLLT 0x40E8
#define CAITRIGGER_LEVELINCLASS 0x40E9
#define CAITRIGGER_LEVELINCLASSGT 0x40EA
#define CAITRIGGER_LEVELINCLASSLT 0x40EB
#define CAITRIGGER_ISCREATUREAREAFLAG 0x40EC
#define CAITRIGGER_INTRAP 0x40ED
#define CAITRIGGER_ISEXTENDEDNIGHT 0x40EE
#define CAITRIGGER_INCUTSCENEMODE 0x40EF
#define CAITRIGGER_HASITEMINSLOT 0x40F0
#define CAITRIGGER_FORCEMARKEDSPELL 0x40F1
#define CAITRIGGER_ISSPELLTARGETVALID 0x40F2
#define CAITRIGGER_ISFACINGOBJECT 0x40F3
#define CAITRIGGER_SETSPELLTARGET 0x40F4
#define CAITRIGGER_ISPATHCRITICALOBJECT 0x40F5
#define CAITRIGGER_ANYPCSEESENEMY 0x40F6
#define CAITRIGGER_PCINSTORE 0x40F7
#define CAITRIGGER_OUTOFAMMO 0x40F8

class CGameAIBase;

class CAITrigger {
public:
    static const SHORT NO_TRIGGER;
    static const SHORT HEARD;
    static const SHORT ONCREATION;
    static const SHORT RECEIVEDORDER;
    static const SHORT TIMEREXPIRED;
    static const SHORT TRIGGER;
    static const SHORT OPENED;
    static const SHORT UNLOCKED;
    static const SHORT STATUSTRIGGER;

    CAITrigger(const CAITrigger& trigger);
    CAITrigger(SHORT triggerID, const CAIObjectType& cause, LONG specificID);
    CAITrigger(SHORT triggerID, LONG specificID);
    ~CAITrigger();
    BOOL OfType(const CAITrigger& trigger) const;
    void Read(const CString& sData);
    CAITrigger& operator=(const CAITrigger& other);

    const CAIObjectType& GetCause() const;

    void Decode(CGameAIBase* caller);
    LONG GetSpecifics() const;
    void SetSpecifics(LONG specific);
    LONG GetInt1() const;
    void SetInt1(LONG value);
    LONG GetInt2() const;
    void SetInt2(LONG value);
    const CString& GetString1() const;
    const CString& GetString2() const;

    /* 0000 */ SHORT m_triggerID;
    /* 0002 */ LONG m_specificID;
    /* 0006 */ CAIObjectType m_triggerCause;
    /* 0042 */ LONG m_flags;
    /* 0046 */ LONG m_specific2;
    /* 004A */ LONG m_specific3;
    /* 004E */ CString m_string1;
    /* 0052 */ CString m_string2;
};

#endif /* CAITRIGGER_H_ */
