root/trunk/src/bindings/scripts/scripts/creature/simple_ai.h

Revision 90, 2.3 kB (checked in by yumileroy, 17 years ago)

[svn] * Prevent Cheating at logout/login by players. Thank you Visagalis
* Set scripts to eol style native

Original author: KingPin?
Date: 2008-10-21 13:19:26-05:00

Line 
1/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
2* This program is free software licensed under GPL version 2
3* Please see the included DOCS/LICENSE.TXT for more information */
4
5#ifndef SC_SIMPLEAI_H
6#define SC_SIMPLEAI_H
7
8enum CastTarget
9{
10    CAST_SELF = 0,                  //Self cast
11    CAST_HOSTILE_TARGET,            //Our current target (ie: highest aggro)
12    CAST_HOSTILE_SECOND_AGGRO,      //Second highest aggro (generaly used for cleaves and some special attacks)
13    CAST_HOSTILE_LAST_AGGRO,        //Dead last on aggro (no idea what this could be used for)
14    CAST_HOSTILE_RANDOM,            //Just any random target on our threat list
15    CAST_FRIENDLY_RANDOM,           //NOT YET IMPLEMENTED
16
17    //Special cases
18    CAST_KILLEDUNIT_VICTIM,         //Only works within KilledUnit function
19    CAST_JUSTDIED_KILLER,           //Only works within JustDied function
20};
21
22struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI
23{
24    SimpleAI(Creature *c);// : ScriptedAI(c);
25
26    void Reset();
27
28    void Aggro(Unit *who);
29
30    void KilledUnit(Unit *victim);
31
32    void DamageTaken(Unit *killer, uint32 &damage);
33
34    void UpdateAI(const uint32 diff);
35
36public:
37
38    char* Aggro_Text[3];
39    bool Aggro_Say[3];
40    uint32 Aggro_Sound[3];
41
42    char* Death_Text[3];
43    bool Death_Say[3];
44    uint32 Death_Sound[3];
45    uint32 Death_Spell;
46    uint32 Death_Target_Type;
47
48    char* Kill_Text[3];
49    bool Kill_Say[3];
50    uint32 Kill_Sound[3];
51    uint32 Kill_Spell;
52    uint32 Kill_Target_Type;
53
54    struct SimpleAI_Spell
55    {
56        uint32 Spell_Id;                //Spell ID to cast
57        int32 First_Cast;               //Delay for first cast
58        uint32 Cooldown;                //Cooldown between casts
59        uint32 CooldownRandomAddition;  //Random addition to cooldown (in range from 0 - CooldownRandomAddition)
60        uint32 Cast_Target_Type;        //Target type (note that certain spells may ignore this)
61        bool InterruptPreviousCast;     //Interrupt a previous cast if this spell needs to be cast
62        bool Enabled;                   //Spell enabled or disabled (default: false)
63
64        //3 texts to many?
65        char* Text[3];
66        bool Say[3];
67        uint32 Text_Sound[3];
68    }Spell[10];
69
70protected:
71    uint32 Spell_Timer[10];
72};
73
74#endif
Note: See TracBrowser for help on using the browser.