Projekt

Allgemein

Profil

Fehler #1283 » trigger script.cpp

karn, 13.06.2012 00:54

 
1
enum Quest_Data
2
{
3
    SPELL_FLAMES = 48454,
4
    SPELL_SMOKE = 48456,
5
    SPELL_BURNING_WATER = 48455,
6
    SPELL_QUEST_COMPLETE = 50290,
7
    NPC_PIRATE =  27233,
8
};
9
class fire_upon_the_waters_helper : public CreatureScript
10
{
11
    public:
12
        fire_upon_the_waters_helper() : CreatureScript("fire_upon_the_waters_helper") { }
13

    
14
        struct fire_upon_the_waters_helperAI : public NullCreatureAI
15
        {
16
            fire_upon_the_waters_helperAI(Creature* creature) : NullCreatureAI(creature) { }
17

    
18

    
19
            void SpellHit(Unit* caster, SpellInfo const* spell)
20
            {
21
                if (spell->Id == SPELL_BURNING_WATER)
22
                {
23
                    caster->CastSpell(caster, SPELL_QUEST_COMPLETE, true);
24
                    me->AddAura(SPELL_SMOKE,me);
25
                    me->AddAura(SPELL_FLAMES,me);
26
                    for(int i=0;i<10;i++)
27
                    {
28
                        if(Creature* pirate = me->FindNearestCreature(NPC_PIRATE, 30.0f, true))
29
                            me->Kill(pirate,true);                        
30
                    }                            
31
                }
32
            }
33
        };
34

    
35
        CreatureAI* GetAI(Creature* creature) const
36
        {
37
            return new fire_upon_the_waters_helperAI(creature);
38
        }
39
};
(2-2/3)