Пример #1
0
bool Player::Quick(Game_Manager* gm_, coord_def c, float focus_)
{
	if(GetStop())
		return false;
	if(berserker)
		return false;
	switch(quick_menu)
	{
	case 1:
		Special(gm_, c, focus_);
		break;
	case 2:
		Shot(gm_, c, focus_, 2);
		break;
	case 3:
		Shot(gm_, c, focus_, 3);
		break;
	case 4:
		Shot(gm_, c, focus_, 4);
		break;
	case 5:
		UseAbility(gm_, 0);
		break;
	case 6:
		UseAbility(gm_, 1);
		break;
	default:
		return false;
	}
	return true;
}
Пример #2
0
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (ResetTimer <= diff)
        {
            if (me->IsWithinDist3d(119.223f, 1035.45f, 29.4481f, 10))
            {
                EnterEvadeMode();
                return;
            }
            ResetTimer = 5000;
        } else ResetTimer -= diff;

        if (CheckAddState_Timer <= diff)
        {
            for (uint8 i = 0; i < 4; ++i)
                if (Creature *pTemp = Unit::GetCreature(*me, AddGUID[i]))
                    if (pTemp->isAlive() && !pTemp->getVictim())
                        pTemp->AI()->AttackStart(me->getVictim());

            CheckAddState_Timer = 5000;
        } else CheckAddState_Timer -= diff;

        if (DrainPower_Timer <= diff)
        {
            DoCast(me, SPELL_DRAIN_POWER, true);
            Map *map = me->GetMap();
            if (!map->IsDungeon()) return;
            Map::PlayerList const &PlayerList = map->GetPlayers();
            for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
            {
                if (Player* i_pl = i->getSource())
                    if (i_pl->isAlive())me->AddAura(44132, me); //+1% Damage for each active player on boss (+ActivePlayer_Stack)
            }
            //me->AddAura(44132, me);
            me->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL);
            DoPlaySoundToSet(me, SOUND_YELL_DRAIN_POWER);
            DrainPower_Timer = urand(40000,55000);    // must cast in 60 sec, or buff/debuff will disappear
        } else DrainPower_Timer -= diff;

        if (SpiritBolts_Timer <= diff)
        {
            if (DrainPower_Timer < 12000)    // channel 10 sec
                SpiritBolts_Timer = 13000;   // cast drain power first
            else
            {
                DoCast(me, SPELL_SPIRIT_BOLTS, true);
                me->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL);
                DoPlaySoundToSet(me, SOUND_YELL_SPIRIT_BOLTS);
                SpiritBolts_Timer = 40000;
                SiphonSoul_Timer = 10000;    // ready to drain
                PlayerAbility_Timer = 99999;
            }
        } else SpiritBolts_Timer -= diff;

        if (SiphonSoul_Timer <= diff)
        {
            Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true);
            Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
            if (!pTarget || !trigger)
            {
                EnterEvadeMode();
                return;
            }
            else
            {
                trigger->SetDisplayId(11686);
                trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                trigger->CastSpell(pTarget, SPELL_SIPHON_SOUL, true);
                trigger->GetMotionMaster()->MoveChase(me);

                //DoCast(pTarget, SPELL_SIPHON_SOUL, true);
                //me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pTarget->GetGUID());
                //me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);

                PlayerGUID = pTarget->GetGUID();
                PlayerAbility_Timer = urand(8000,10000);
                PlayerClass = pTarget->getClass() - 1;

                if (PlayerClass == 10)
                    PlayerClass = 9; // druid
                else if (PlayerClass == 4 && pTarget->HasSpell(15473))
                    PlayerClass = 5; // shadow priest

                SiphonSoul_Timer = 99999;   // buff lasts 30 sec
            }
        } else SiphonSoul_Timer -= diff;

        if (PlayerAbility_Timer <= diff)
        {
            //Unit *pTarget = Unit::GetUnit(*me, PlayerGUID);
            //if (pTarget && pTarget->isAlive())
            //{
                UseAbility();
                PlayerAbility_Timer = urand(8000,10000);
            //}
        } else PlayerAbility_Timer -= diff;

        DoMeleeAttackIfReady();
    }
Пример #3
0
            void UpdateAI(const uint32 diff)
            {
                if (!UpdateVictim())
                    return;

                if (ResetTimer <= diff)
                {
                    if (me->IsWithinDist3d(119.223f, 1035.45f, 29.4481f, 10))
                    {
                        EnterEvadeMode();
                        return;
                    }
                    ResetTimer = 5000;
                } else ResetTimer -= diff;

                if (CheckAddState_Timer <= diff)
                {
                    for (uint8 i = 0; i < 4; ++i)
                        if (Creature* temp = Unit::GetCreature(*me, AddGUID[i]))
                            if (temp->isAlive() && !temp->getVictim())
                                temp->AI()->AttackStart(me->getVictim());

                    CheckAddState_Timer = 5000;
                } else CheckAddState_Timer -= diff;

                if (DrainPower_Timer <= diff)
                {
                    DoCast(me, SPELL_DRAIN_POWER, true);
                    me->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, 0);
                    DoPlaySoundToSet(me, SOUND_YELL_DRAIN_POWER);
                    DrainPower_Timer = urand(40000, 55000);    // must cast in 60 sec, or buff/debuff will disappear
                } else DrainPower_Timer -= diff;

                if (SpiritBolts_Timer <= diff)
                {
                    if (DrainPower_Timer < 12000)    // channel 10 sec
                        SpiritBolts_Timer = 13000;   // cast drain power first
                    else
                    {
                        DoCast(me, SPELL_SPIRIT_BOLTS, false);
                        me->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, 0);
                        DoPlaySoundToSet(me, SOUND_YELL_SPIRIT_BOLTS);
                        SpiritBolts_Timer = 40000;
                        SiphonSoul_Timer = 10000;    // ready to drain
                        PlayerAbility_Timer = 99999;
                    }
                } else SpiritBolts_Timer -= diff;

                if (SiphonSoul_Timer <= diff)
                {
                    Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true);
                    Unit* trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
                    if (!target || !trigger)
                    {
                        EnterEvadeMode();
                        return;
                    }
                    else
                    {
                        trigger->SetDisplayId(11686);
                        trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                        trigger->CastSpell(target, SPELL_SIPHON_SOUL, true);
                        trigger->GetMotionMaster()->MoveChase(me);

                        //DoCast(target, SPELL_SIPHON_SOUL, true);
                        //me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, target->GetGUID());
                        //me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);

                        PlayerGUID = target->GetGUID();
                        PlayerAbility_Timer = urand(8000, 10000);
                        PlayerClass = target->getClass() - 1;

                        if (PlayerClass == CLASS_DRUID-1)
                            PlayerClass = CLASS_DRUID;
                        else if (PlayerClass == CLASS_PRIEST-1 && target->HasSpell(15473))
                            PlayerClass = CLASS_PRIEST; // shadow priest

                        SiphonSoul_Timer = 99999;   // buff lasts 30 sec
                    }
                } else SiphonSoul_Timer -= diff;

                if (PlayerAbility_Timer <= diff)
                {
                    //Unit* target = Unit::GetUnit(*me, PlayerGUID);
                    //if (target && target->isAlive())
                    //{
                        UseAbility();
                        PlayerAbility_Timer = urand(8000, 10000);
                    //}
                } else PlayerAbility_Timer -= diff;

                DoMeleeAttackIfReady();
            }
Пример #4
0
// *************************************************************************** 
// Function:    DoAbility 
// Description: Our '/doability' command 
//              Does (or lists) your abilities 
// Usage:       /doability [list|ability|#] 
// *************************************************************************** 
int CMD_DoAbility(int argc, char *argv[]) 
{ 
	if (argc<2)
	{
		printf("Syntax: %s list|<ability>",argv[0]);
		return 0;
	}

    DWORD Index, DoIndex = 0xFFFFFFFF;

    if (!stricmp(argv[1],"list") || !stricmp(argv[1], "-list")) 
	{
        WriteChatColor("Abilities:",USERCOLOR_DEFAULT);
        for (Index=4;Index<10;Index++) {
            if (EQADDR_DOABILITYLIST[Index]==0xFFFFFFFF)
			{
                WriteChatf("%d. <Empty>",Index-3);
            } 
			else if (szSkills[EQADDR_DOABILITYLIST[Index]]) 
			{
                WriteChatf("%d. %s",Index-3,szSkills[EQADDR_DOABILITYLIST[Index]]);
            } 
			else 
			{
                WriteChatf("%d. *Unknown%d",Index-3,EQADDR_DOABILITYLIST[Index]);
            }
        }
        WriteChatColor("Combat Skills:");
        for (Index=0;Index<4;Index++) 
		{
            if (EQADDR_DOABILITYLIST[Index]==0xFFFFFFFF) 
			{
                WriteChatf("%d. <Empty>",Index+7);
            } 
			else if (szSkills[EQADDR_DOABILITYLIST[Index]]) 
			{
                WriteChatf("%d. %s",Index+7,szSkills[EQADDR_DOABILITYLIST[Index]]);
            } 
			else 
			{
                WriteChatf("%d. *Unknown%d",Index+7,EQADDR_DOABILITYLIST[Index]);
            }
        }
        WriteChatColor("Combat Abiilities:",USERCOLOR_DEFAULT);
        for (Index=10;Index<18;Index++) 
		{
            if (EQADDR_DOABILITYLIST[Index]==0xFFFFFFFF) 
			{
                WriteChatf("%d. <Empty>",Index+1);
			} 
			else if (EQADDR_DOABILITYLIST[Index] > 132) 
			{ // highest number we have defined so far
				WriteChatf("%d. *Unknown%d",Index+1,EQADDR_DOABILITYLIST[Index]);
			} 
			else if (szSkills[EQADDR_DOABILITYLIST[Index]]) 
			{
				WriteChatf("%d. %s",Index+1,szSkills[EQADDR_DOABILITYLIST[Index]]);
			} 
			else 
			{
				WriteChatf("%d. *Unknown%d",Index+1,EQADDR_DOABILITYLIST[Index]);
			}
        }
        return 0;
    }

   UseAbility(argv[1]);

   return 0;
}