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