View difference between Paste ID: U1ZmFfpW and WGEY73DD
SHOW: | | - or go back to the newest paste.
1
#include "ScriptPCH.h"
2
3
enum Spells
4
{
5
    SPELL_ROAR                                  = 42398,
6
	SHAKE_CAMERA								= 46853,
7
	SPELL_FREEZE								= 58534,
8
    SPELL_ENRAGE                                = 23537,
9
	SPELL_KNOCKBACK								= 46360,
10
};
11
12
13
class Yeti_Boss : public CreatureScript
14
{
15
    public:
16
17
        Yeti_Boss()
18
            : CreatureScript("Yeti_Boss")
19
        {
20
        }
21
22
        struct example_creatureAI : public ScriptedAI
23
        {
24
            
25
            example_creatureAI(Creature* creature) : ScriptedAI(creature) {}
26
			
27
            uint32 m_uiBeserkTimer;                                
28
            uint32 m_uiPhase;                                        
29-
			uint32 m_uiFrostPunchTimer;
29+
	    uint32 m_uiFrostPunchTimer;
30-
			uint32 m_uiRoarTimer;
30+
	    uint32 m_uiRoarTimer;
31
32
33
            void Reset()
34
            {
35
				m_uiPhase = 0;  
36
				m_uiFrostPunchTimer = 12000;   
37
				m_uiRoarTimer = 20000;   
38
				m_uiEnrageTimer = 180000;
39
                me->RestoreFaction();
40
            }
41
42
			void EnterCombat(Unit* unit, Player* player)
43
            {
44-
            char message[250];
44+
45-
            print(message, 250, "Yetiname glares at $N, roars, and casts Frost Punch!", player->GetGUID());
45+
46-
            player->MonsterTextEmote(message, player->GetGUID());
46+
47
			guid = pRandPlayer->GetGUID();
48
			target = &guid 
49
			DoCast(*target, SPELL_ROAR);
50
			DoCast(*target, SHAKE_CAMERA);
51
			DoCast(*target, SPELL_PUNCH);
52
			DoCast(*target, SPELL_FREEZE);
53
		        char message[250];
54
           	        print(message, 250, "Yetiname glares at $N, roars, and casts Frost Punch!", player->GetGUID());
55
            		Me->MonsterTextEmote(message, player->GetGUID());
56
			delete target;
57
            }
58
59
            void EnterEvadeMode()
60
            {
61
62
            }
63
64
            void UpdateAI(const uint32 uiDiff)
65
            {
66
67
                if (!UpdateVictim())
68
                    return;
69
70
                    if (m_uiFrostPunchTimer <= uiDiff)
71
                    {
72
						 if (Unit *pRandPlayer = SelectUnit(SELECT_TARGET_RANDOM,0))
73
						 Player * guid;
74
						 Player * target;
75
						 guid = pRandPlayer->GetGUID();
76
						 target = &guid
77
						 
78
						 char message[250];
79
						 print(message, 250, "Yetiname casts Frost Punch on $N!", *target);
80
						 Me->MonsterTextEmote(message, *target);
81
						 DoCast(*target, SPELL_PUNCH);
82
						 DoCast(*target, SPELL_FREEZE);
83
						 delete target;
84
85
                        m_uiSpell3Timer = 12000;
86
                    }
87
                    else
88
                        m_uiFrostPunchTimer -= uiDiff;
89
90
                    if (m_uiRoarTimer <= uiDiff)
91
                    {
92
                         char message[250];
93
						 print(message, 250, "Yetiname roars at $N!", *target));
94
						 player->MonsterTextEmote(message, *target);
95
96
						 if (Unit *pRandPlayer = SelectUnit(SELECT_TARGET_RANDOM,0))
97
						 Player * guid;
98
						 Player * target;
99
						 guid = pRandPlayer->GetGUID();
100
						 target = &guid 
101
						 DoCast(*target, SPELL_ROAR);
102
						 DoCast(*target, SHAKE_CAMERA);
103
						 delete target;
104
105
                        m_uiRoarTimer = 20000;
106
                    }
107
                    else
108
                        m_uiRoarTimer -= uiDiff;						
109
						
110
                    if (m_uiBeserkTimer <= uiDiff)
111
                    {
112
                        DoCast(me, SPELL_ENRAGE);
113
                    }
114
                    else
115
                        m_uiBeserkTimer -= uiDiff;
116
                
117
				DoMeleeAttackIfReady();
118
            }
119
        };
120
121
        CreatureAI* GetAI(Creature* creature) const
122
        {
123
            return new example_creatureAI(creature);
124
        }
125
};
126
127
void AddSC_Yeti_Boss()
128
{
129
    new Yeti_Boss();
130
}