Example #1
0
static bool HandleBuffCommand(ChatHandler * handler, const char * args)
    {
        Player * pl = handler->GetSession()->GetPlayer();
                if(pl->isInCombat())
                {
                        pl->GetSession()->SendNotification("You can't use this in combat!");
                        return false;
                }
                if(pl->InArena())
                {
                        pl->GetSession()->SendNotification("You can't use that item in an arena match!");
                        return false;
                }
                else
                pl->AddAura(48162, pl);
                pl->AddAura(48074, pl);
                pl->AddAura(48170, pl);
                pl->AddAura(43223, pl);
                pl->AddAura(36880, pl);
                pl->AddAura(467, pl);
                pl->AddAura(69994, pl);
                pl->AddAura(48469, pl);
                handler->PSendSysMessage("You have been buffed, enjoy!");
                return true;
 
    }	
Example #2
0
bool ChatHandler::HandleAuraUpdateAdd(const char* args, WorldSession* m_session)
{
    if (!args)
        return false;

    uint32 SpellID = 0;
    int Flags = 0;
    int StackCount = 0;
    if (sscanf(args, "%u 0x%X %i", &SpellID, &Flags, &StackCount) != 3 && sscanf(args, "%u %u %i", &SpellID, &Flags, &StackCount) != 3)
        return false;

    Player* Pl = m_session->GetPlayer();
    if (Aura* AuraPtr = Pl->FindAura(SpellID))
    {
        uint8 VisualSlot = AuraPtr->m_visualSlot;
        Pl->SendAuraUpdate(AuraPtr->m_auraSlot, false);
        SystemMessage(m_session, "SMSG_AURA_UPDATE (update): VisualSlot %u - SpellID %u - Flags %i (0x%04X) - StackCount %i", VisualSlot, SpellID, Flags, Flags, StackCount);
    }
    else
    {
        SpellEntry* Sp = dbcSpell.LookupEntryForced(SpellID);
        if (!Sp)
        {
            SystemMessage(m_session, "SpellID %u is invalid.", SpellID);
            return true;
        }
        Spell* SpellPtr = sSpellFactoryMgr.NewSpell(Pl, Sp, false, NULL);
        AuraPtr = sSpellFactoryMgr.NewAura(Sp, SpellPtr->GetDuration(), Pl, Pl);
        Pl->AddAura(AuraPtr); // Serves purpose to just add the aura to our auraslots
        SystemMessage(m_session, "SMSG_AURA_UPDATE (add): VisualSlot %u - SpellID %u - Flags %i (0x%04X) - StackCount %i", AuraPtr->m_visualSlot, SpellID, Flags, Flags, StackCount);
        delete SpellPtr;
    }
    return true;
}
 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     Player* caster = GetCaster()->ToPlayer();
     /*
      * HACK: GetWorldLocation() returns real position and not transportposition.
      * ServertoClient: SMSG_MOVE_TELEPORT (0x0B39)
      * counter: 45
      * Tranpsort Guid: Full: xxxx Type: MOTransport Low: xxx
      * Transport Position X: 0 Y: 0 Z: 0 O: 0
      * Position: X: 7.305609 Y: -0.095246 Z: 34.51022 O: 0
      */
     caster->TeleportTo(GetHitCreature()->GetWorldLocation(), TELE_TO_NOT_LEAVE_TRANSPORT);
     /*
      * HACK: This aura should be added by 20212 and 20213 but can't find any SMSG_SPELL_GO. Could't find their position.
      * ServerToClient: SMSG_AURA_UPDATE (0x0072)
      * [0] CasterGUID: Full: xxxxx Type: Unit Entry: 20212 Low: xxx
      * [0] Flags: None (0)
      * [0] Caster Level: 60
      * [0] Spell ID: 66656
      * [0] Charges: 0
      * [0] Effect Mask: 1
      * [0] Slot: 37
      * Guid: Full: xxxxx Type: Player2 Low: xxxxx
      */
     caster->AddAura(SPELL_PARACHUTE, caster);
 }
Example #4
0
    //Enable\Disable Invisible mode
    static bool HandleGMVisibleCommand(ChatHandler* handler, const char* args)
    {
        if(!*args)
        {
            handler->PSendSysMessage(LANG_YOU_ARE, handler->GetSession()->GetPlayer()->isGMVisible() ?  handler->GetTrinityString(LANG_VISIBLE) : handler->GetTrinityString(LANG_INVISIBLE));
            return true;
        }

        std::string argstr = (char*)args;
        Player* pPlayer = handler->GetSession()->GetPlayer();
        if(argstr == "on")
        {
            if(pPlayer->HasAura(37800, 0))
                pPlayer->RemoveAurasDueToSpell(37800);
            handler->GetSession()->GetPlayer()->SetGMVisible(true);
            handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE);
            return true;
        } else if(argstr == "off") {
            handler->GetSession()->GetPlayer()->SetGMVisible(false);
            handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE);
            pPlayer->AddAura(37800, pPlayer);
            return true;
        }

        handler->SendSysMessage(LANG_USE_BOL);
        handler->SetSentErrorMessage(true);
        return false;
    }
Example #5
0
        void HandlePeriodic(AuraEffect const* aurEff)
        {
            Player* player = GetCaster()->ToPlayer();
            if (Unit* target = player->GetSelectedUnit())
            {
                if (player->IsValidAttackTarget(target))
                {
                    if (player->GetLastSelectedTarget() == target->GetGUID())
                        player->AddAura(82033, player);
                    else
                    {
                        player->SetLastSelectedTarget(target->GetGUID());
                        player->RemoveAurasDueToSpell(82033);
                        player->AddAura(82033, player);
                    }
                    return;
                }
            }

            player->SetLastSelectedTarget(ObjectGuid::Empty);
            player->RemoveAurasDueToSpell(82033);
        }
Example #6
0
        bool Execute(uint64 /*time*/, uint32 /*diff*/) override
        {
            Player* player = ObjectAccessor::FindPlayer(_guid);
            if (!player || !player->GetVehicle())
                return true;

            player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage
            float speedZ = 10.0f;
            float dist = player->GetExactDist2d(&_pos);

            player->ExitVehicle();
            player->GetMotionMaster()->MoveJump(_pos, dist, speedZ, EVENT_JUMP, true);
            return true;
        }
        bool Execute(uint64 /*time*/, uint32 /*diff*/)
        {
            Player* player = sObjectMgr->GetPlayerByLowGUID(_lowGuid);
            if (!player || !player->GetVehicle())
                return true;

            player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage
            float speedZ = 10.0f;
            float dist = player->GetExactDist2d(_x, _y);

            player->ExitVehicle();
            player->GetMotionMaster()->MoveJump(_x, _y, _z, dist, speedZ);
            return true;
        }
Example #8
0
void BattleGround::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid)
{
    m_ReviveQueue[npc_guid].push_back(player_guid);

    Player *plr = objmgr.GetPlayer(player_guid);
    if(!plr)
        return;

    plr->CastSpell(plr, SPELL_WAITING_FOR_RESURRECT, true);
    SpellEntry const *spellInfo = sSpellStore.LookupEntry( SPELL_WAITING_FOR_RESURRECT );
    if(spellInfo)
    {
        Aura *Aur = CreateAura(spellInfo, 0, NULL, plr);
        plr->AddAura(Aur);
    }
}
Example #9
0
		static bool HandleVipBuffCommand(ChatHandler * handler, const char * args)
    {
        Player * pl = handler->GetSession()->GetPlayer();
                if(pl->InArena())
                {
                        pl->GetSession()->SendNotification("Você não pode usar este comando em arena!");
                        return false;
                }
       
                pl->RemoveAurasByType(SPELL_AURA_MOUNTED);
                for(int i = 0; i < 40; i++)
                    pl->AddAura(aurasVip[i], pl);
                handler->PSendSysMessage("|cffFFFFFF[|cffFFA500Buff Vip|cffFFFFFF] |cffFF0000Você está quase imortal!");
                return true;
 
    }
Example #10
0
        static bool HandleBuffCommand(ChatHandler * handler, const char * args)
    {
        Player * pl = handler->GetSession()->GetPlayer();
                if(pl->InArena())
                {
                        pl->GetSession()->SendNotification("You can't use that item in an arena match!");
                        return false;
                }
       
                pl->RemoveAurasByType(SPELL_AURA_MOUNTED);
                for(int i = 0; i < 11; i++)
                    pl->AddAura(auras[i], pl);
                handler->PSendSysMessage("|cffB400B4You have been buffed, enjoy!");
                return true;
 
    }
Example #11
0
    /**
    * @brief Applies the Deserter Debuff to a player
    *
    * This function applies a Deserter Debuff of the given type (Instance or BG) to the
    * selected player, with the provided duration in seconds.
    *
    * @param handler The ChatHandler, passed by the system.
    * @param args The provided duration in seconds.
    * @param isInstance provided by the relaying functions, so we don't have
    * to write that much code :)
    *
    * @return true if everything was correct, false if an error occured.
    *
    * Example Usage:
    * @code
    * .deserter instance add 3600 (one hour)
    * -or-
    * .deserter bg add 3600 (one hour)
    * @endcode
    */
    static bool HandleDeserterAdd(ChatHandler* handler, char const* args, bool isInstance)
    {
        if (!*args)
            return false;

        Player* player = handler->getSelectedPlayer();
        if (!player)
        {
            handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
            handler->SetSentErrorMessage(true);
            return false;
        }
        char* timeStr = strtok((char*)args, " ");
        if (!timeStr)
        {
            handler->SendSysMessage(LANG_BAD_VALUE);
            handler->SetSentErrorMessage(true);
            return false;
        }
        uint32 time = atoi(timeStr);

        if (!time)
        {
            handler->SendSysMessage(LANG_BAD_VALUE);
            handler->SetSentErrorMessage(true);
            return false;
        }

        Aura* aura = player->AddAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER, player);

        if (!aura)
        {
            handler->SendSysMessage(LANG_BAD_VALUE);
            handler->SetSentErrorMessage(true);
            return false;
        }
        aura->SetDuration(time * IN_MILLISECONDS);

        return true;
    }
Example #12
0
    //Enable\Disable Invisible mode
    static bool HandleGMVisibleCommand(ChatHandler* handler, char const* args)
    {
        if (!*args)
        {
            handler->PSendSysMessage(LANG_YOU_ARE, handler->GetSession()->GetPlayer()->isGMVisible() ? handler->GetTrinityString(LANG_VISIBLE) : handler->GetTrinityString(LANG_INVISIBLE));
            return true;
        }

        const uint32 VISUAL_AURA = 37800;
        std::string param = (char*)args;
        Player* player = handler->GetSession()->GetPlayer();

        if (param == "on")
        {
            if (player->HasAura(VISUAL_AURA, 0))
                player->RemoveAurasDueToSpell(VISUAL_AURA);

            player->SetGMVisible(true);
            handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE);
            return true;
        }

        if (param == "off")
        {
            handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE);
            player->SetGMVisible(false);

            player->AddAura(VISUAL_AURA, player);

            return true;
        }

        handler->SendSysMessage(LANG_USE_BOL);
        handler->SetSentErrorMessage(true);
        return false;
    }
Example #13
0
bool ChatHandler::HandleAuraUpdateAdd( const char *args, WorldSession *m_session )
{
	if(!args)
		return false;

	uint32 SpellID = 0;
	int Flags = 0;
	int StackCount = 0;
	if(sscanf(args, "%u 0x%X %i", &SpellID, &Flags, &StackCount) != 3 && sscanf(args, "%u %u %i", &SpellID, &Flags, &StackCount) != 3)
		return false;

	Player * Pl = m_session->GetPlayer();
	if(Aura * AuraPtr = Pl->FindAura(SpellID))
	{
		uint8 VisualSlot = AuraPtr->m_visualSlot;
		WorldPacket data(SMSG_AURA_UPDATE, 20);
		FastGUIDPack(data, Pl->GetGUID());
		data << (uint8)VisualSlot;
		data << (uint32)SpellID;
		data << (uint8)Flags;
		data << (uint8)Pl->getLevel();
		data << (uint8)StackCount;
		if( !(Flags & AFLAG_NOT_CASTER) )
			data << WoWGuid(Pl->GetSelection());
		if(Flags & AFLAG_DURATION)
		{
			data << (uint32)AuraPtr->GetDuration();
			data << (uint32)AuraPtr->GetTimeLeft();
		}
		m_session->SendPacket(&data);
		SystemMessage(m_session, "SMSG_AURA_UPDATE (update): VisualSlot %u - SpellID %u - Flags %i (0x%04X) - StackCount %i", VisualSlot, SpellID, Flags, Flags, StackCount);
	}
	else
	{
		SpellEntry * Sp = dbcSpell.LookupEntryForced(SpellID);
		if(!Sp)
		{
			SystemMessage(m_session, "SpellID %u is invalid.", SpellID);
			return true;
		}
		Spell * SpellPtr = new Spell(Pl, Sp, false, NULL);
		AuraPtr = new Aura(Sp, SpellPtr->GetDuration(), Pl, Pl);
		Pl->AddAura(AuraPtr); // Serves purpose to just add the aura to our auraslots
		uint8 VisualSlot = Pl->FindVisualSlot(SpellID, AuraPtr->IsPositive());
		WorldPacket data(SMSG_AURA_UPDATE, 20);
		FastGUIDPack(data, Pl->GetGUID());
		data << (uint8)VisualSlot;
		data << (uint32)SpellID;
		data << (uint8)Flags;
		data << (uint8)Pl->getLevel();
		data << (uint8)StackCount;
		if( !(Flags & AFLAG_NOT_CASTER) )
			data << (uint8)0; // caster guid
		if(Flags & AFLAG_DURATION)
		{
			data << (uint32)SpellPtr->GetDuration();
			data << (uint32)SpellPtr->GetDuration();
		}
		m_session->SendPacket(&data);
		SystemMessage(m_session, "SMSG_AURA_UPDATE (add): VisualSlot %u - SpellID %u - Flags %i (0x%04X) - StackCount %i", VisualSlot, SpellID, Flags, Flags, StackCount);
		delete SpellPtr;
	}
	return true;
}