void EnterCombat(Unit * who) {
			StartEncounter(instance, me, who);
			DoScriptText(SAY_STEELBREAKER_AGGRO, me);
			DoZoneInCombat();
			DoCast(me, RAID_MODE(SPELL_HIGH_VOLTAGE, SPELL_HIGH_VOLTAGE_H));
			events.ScheduleEvent(EVENT_ENRAGE, 900000);
			DoAction(EVENT_UPDATEPHASE);
		}
Exemple #2
0
 void EnterCombat(Unit* who)
 {
     StartEncounter(instance, me, who);
     DoScriptText(SAY_BRUNDIR_AGGRO, me);
     DoZoneInCombat();
     events.ScheduleEvent(EVENT_ENRAGE, 900000);
     DoAction(EVENT_UPDATEPHASE);
 }
            void DamageTaken(Unit* /*attacker*/, uint32& damage)
            {
                if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)
                {
                    if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 1)
                        DoAction(ACTION_CLONE);
                }
                else
                {
                    if ((me->HealthBelowPctDamaged(66, damage) && _cloneCount == 2)
                        || (me->HealthBelowPctDamaged(33, damage) && _cloneCount == 1))
                        DoAction(ACTION_CLONE);
                }

                if (me->GetHealth() > damage)
                    instance->SetData(DATA_BALTHARUS_SHARED_HEALTH, me->GetHealth() - damage);
            }
Exemple #4
0
            void DamageTaken(Unit* /*attacker*/, uint32& damage)
            {
                if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
                    damage = 0;

                if (phase == COLOSSUS_PHASE_NORMAL ||
                    phase == COLOSSUS_PHASE_FIRST_ELEMENTAL_SUMMON)
                {
                    if (HealthBelowPct( phase == COLOSSUS_PHASE_NORMAL ? 50 : 5))
                    {
                        damage = 0;
                        phase = (phase == COLOSSUS_PHASE_NORMAL ? COLOSSUS_PHASE_FIRST_ELEMENTAL_SUMMON : COLOSSUS_PHASE_SECOND_ELEMENTAL_SUMMON);
                        DoAction(ACTION_FREEZE_COLOSSUS);
                        DoAction(ACTION_SUMMON_ELEMENTAL);
                    }
                }
            }
Exemple #5
0
 void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
 {
     if (!_isStonePhase && HealthBelowPct(45))
     {
         _isStonePhase = true;
         DoAction(ACTION_STONE_PHASE_START);
     }
 }
Exemple #6
0
 void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
 {
     if (!_isStonePhase && HealthBelowPct(45))
     {
         _isStonePhase = true;
         DoAction(ACTION_STONE_PHASE_START);
     }
 }
 void DamageTaken(Unit* caster, uint32& damage)
 {
     if (me->GetHealth() < damage || eggPhase)
     {
         damage = 0;
         if (!eggPhase)
             DoAction(ACTION_UNEGG);
     }
 }
Exemple #8
0
 void Reset()
 {
     _Reset();
     AcidSpray_Timer = 10000;
     PoisonSpawn_Timer = 5000;
     PoisonBolt_Timer = 7000;
     DoAction(ACTION_RESET_BROGGOK);
     instance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED);
 }
Exemple #9
0
        void Reset()
        {
            _Reset();

            phase = PHASE_NORMAL;

            me->SetSpeed(MOVE_FLIGHT, 2.8f);
            DoAction(ACTION_SET_NORMAL_EVENTS);
        }
 bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
 {
     if (menuId == MENU_OPTION_YOU_CHALLENGED_US && gossipListId == OPTION_ID_YOU_CHALLENGED_US)
     {
         CloseGossipMenuFor(player);
         DoAction(ACTION_START_RAGNAROS);
     }
     return false;
 }
Exemple #11
0
        void Reset()
        {
            _Reset();

            phase = PHASE_NORMAL;
            started=false;

            DoAction(ACTION_SET_NORMAL_EVENTS);
        }
Exemple #12
0
 void KilledUnit(Unit* victim)
 {
     if (victim->GetTypeId() == TYPEID_PLAYER)
     {
         Talk(SAY_PLAYER_KILL);
         DoCast(SPELL_LEVEL_UP);
         _reviveGUID = victim->GetGUID();
         DoAction(ACTION_START_REVIVE);
     }
 }
 bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
 {
     if (menuId == GOSSIP_MENU_HUMMEL && gossipListId == GOSSIP_OPTION_START)
     {
         me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
         CloseGossipMenuFor(player);
         DoAction(ACTION_START_EVENT);
     }
     return false;
 }
task main()
{
	int state, event, action;
	while(true){
		if(event==NULL) event=getEvent();
		action=GetAction(state, event);
		event=DoAction(action);
		state=NewState(state, event);
	}
}
 void DamageTaken(Unit* done_by, uint32 &damage)
 {
     if (!HealthAbovePct(20))
     {
         me->GetVehicleKit()->RemoveAllPassengers();
         if (Creature *dragah = Unit::GetCreature(*me, dragahGUID))
             dragah->AI()->DoAction(ACTION_VALIONA_SHOULD_FLY_AWAY);
         DoAction(ACTION_VALIONA_SHOULD_FLY_AWAY);
     }
 }
 void EnterCombat(Unit* who)
 {
     me->setActive(true);
     StartEncounter(instance, me, who);
     DoScriptText(SAY_BRUNDIR_AGGRO, me);
     DoZoneInCombat();
     events.ScheduleEvent(EVENT_ENRAGE, 900000);
     events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(9000, 17000), 1);
     events.ScheduleEvent(EVENT_OVERLOAD, urand(60000, 80000), 1);
     DoAction(EVENT_UPDATEPHASE);
 }
 void EnterCombat(Unit* who)
 {
     me->setActive(true);
     StartEncounter(instance, me, who);
     DoScriptText(SAY_MOLGEIM_AGGRO, me);
     DoZoneInCombat();
     events.ScheduleEvent(EVENT_ENRAGE, 900000);
     events.ScheduleEvent(EVENT_SHIELD_OF_RUNES, 27000);
     events.ScheduleEvent(EVENT_RUNE_OF_POWER, 60000);
     DoAction(EVENT_UPDATEPHASE);
 }
            void Reset()
            {
                _Reset();

                //EmeraldVoid = true;
                //RubyVoid = true;
                //AmberVoid = true;

                _phase = PHASE_NORMAL;
                DoAction(ACTION_SET_NORMAL_EVENTS);
            }
Exemple #19
0
 void JustDied(Unit* /*killer*/) override
 {
     Map::PlayerList const& players = me->GetMap()->GetPlayers();
     if (!players.isEmpty())
     {
         if (Group* group = players.begin()->GetSource()->GetGroup())
             if (group->isLFGGroup())
                 sLFGMgr->FinishDungeon(group->GetGUID(), 288);
     } 
     DoAction(APOTHECARY_DIED);
 }
        void Reset()
        {
            _Reset();
            _phase = PHASE_NORMAL;

            _rubyVoid = true;
            _emeraldVoid = true;
            _amberVoid = true;

            DoAction(ACTION_SET_NORMAL_EVENTS);
        }
void CBuiltinVoteHandler::OnVoteSelect(IBaseBuiltinVote *vote, int client, unsigned int item)
{
	/* Save our old position first. */
	unsigned int *old_pos = s_CurSelectPosition;

	unsigned int old_reply = playerhelpers->SetReplyTo(SM_REPLY_CHAT);
	DoAction(vote, BuiltinVoteAction_Select, client, item);
	playerhelpers->SetReplyTo(old_reply);

	s_CurSelectPosition = old_pos;
}
 bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
 {
     uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
     ClearGossipMenuFor(player);
     if (action == GOSSIP_ACTION_INFO_DEF + 1)
     {
         CloseGossipMenuFor(player);
         PlayerGUID = player->GetGUID();
         DoAction(0);
     }
     return true;
 }
Exemple #23
0
int DropGrid::SetIndex(int n)
{
	int r = rowid;
	n = list.GetRowId(n);
	if(n >= 0)
	{
		list.SetCursor(n);
		UpdateValue();
		DoAction(n);
	}
	return r;
}
        void SummonedCreatureDespawn(Creature* summon) override
        {
            if (summon->IsAlive())
                return;

            if (summon->GetGUID() == uiFireMagusGUID)
            {
                DoAction(ACTION_MAGUS_DEAD);
                bFireMagusDead = true;
            }
            else if (summon->GetGUID() == uiFrostMagusGUID)
            {
                DoAction(ACTION_MAGUS_DEAD);
                bFrostMagusDead = true;
            }
            else if (summon->GetGUID() == uiArcaneMagusGUID)
            {
                DoAction(ACTION_MAGUS_DEAD);
                bArcaneMagusDead = true;
            }
        }
Exemple #25
0
void DropGrid::SetData(const Value& v)
{
	int row = list.Find(v, key_col);
	if(row >= 0)
	{
		list.SetCursor(row);
		UpdateValue();
		DoAction(row, data_action, false);
		Refresh();
	}
	else
		ClearValue();
}
Exemple #26
0
            void Reset()
            {
                _Reset();

                _rubyVoid = true;
                _emeraldVoid = true;
                _amberVoid = true;

                _phase = PHASE_NORMAL;
                DoAction(ACTION_SET_NORMAL_EVENTS);

                _spawntextTimer = urand (1, 60) *IN_MILLISECONDS;
            }
void AvatarButton::OnMouseUnclick(int x, int y, unsigned int button)
{
	if(button != 1)
	{
		return; //left click only!
	}

	if(isButtonDown)
	{
		isButtonDown = false;
		DoAction();
	}
}
Exemple #28
0
            void Reset()
            {
                _Reset();

                RubyVoid = true;
                EmeraldVoid = true;
                AmberVoid = true;

                _phase = PHASE_NORMAL;
                DoAction(ACTION_SET_NORMAL_EVENTS);

                SpawnTextTimer = urand (1, 60) *IN_MILLISECONDS;
            }
 void SpellHit(Unit* /*from*/, SpellInfo const* spell)
 {
     switch (spell->Id)
     {
         case SPELL_SUPERCHARGE:
             DoAction(EVENT_UPDATEPHASE);
             break;
         case SPELL_ELECTRICAL_CHARGE_TRIGGERED:
             if (!me->isInCombat())
                 me->RemoveAurasDueToSpell(SPELL_ELECTRICAL_CHARGE_TRIGGERED);
             break;
     }
 }
void CStaticMenu::HandleKeys( CRBXInput::KEYS _key, bool _pressed )
{
	if( _pressed ) return; /* handle it only if key released is */

	std::cout << DBGINFO << std::endl;

	switch( _key )
	{
		case CRBXInput::SELECT:
			{
				sel = menu_top + menu_selected;
				std::cout << DBGINFO << sel << "," << entries.size() << std::endl;
				DoAction( entries[sel] );
			}	
			break;
		case CRBXInput::UP:
			menu_selected --;
			break;
		case CRBXInput::DOWN:
			menu_selected ++;
			break;
		case CRBXInput::MENU:
//			Cleanup();
			remove = CanBeRemoved;
			break;
		default:
			break;
	}

	if( menu_selected == (long)entries.size() || menu_selected == NUM_MENU_LINES )
	{
		if( NUM_MENU_LINES < entries.size() - menu_top )
		{
			menu_top++;
		}
	
		menu_selected = (entries.size() > NUM_MENU_LINES )?NUM_MENU_LINES-1:entries.size()-1;
	}
	else
	if( menu_selected < 0 )
	{
		if( 0 < menu_top )
		{
			menu_top--;
		}
	
		menu_selected = 0;
	}


}