Ejemplo n.º 1
0
			return;


		// Ok, let's setup this chance system.
		uint32 Chance = 5;
		SpellCastTime *sd = dbcSpellCastTime.LookupEntry(pSpell->CastingTimeIndex);
		if(sd && sd->CastTime == 0) // Instant casts
		{
			Chance = 2;
		}

		if(pPlayer == (Player*)pTarget || pTarget->GetHealthPct() >= 95)
			return;

		// rewards!
		if(Rand(Chance))
		{
			pPlayer->BroadcastMessage( "You are being awarded one gold for your assistance in healing.",  EVENT_UNK, 5000, 1, 0);
			pPlayer->ModUnsigned32Value(PLAYER_FIELD_COINAGE, 10000);
		}
		return;
	}
}

void SetupHealerBadges()
{
	CREATE_HOOK(psh, PostSpellCastHook, 0xFFFFFFFF, &HandleHealingSpells)
}


Ejemplo n.º 2
0
#include "GenericBattleground.h"

void SetupGenericBGs()
{
    GenericBattleground::Initialize();
}

void GenericBattleground::Initialize()
{
    CREATE_HOOK(kp1, KillPlayerHook, AB_MAP, &GenericBattleground::OnKillPlayer)
    CREATE_HOOK(kp2, KillPlayerHook, WSG_MAP, &GenericBattleground::OnKillPlayer)
    CREATE_HOOK(kp4, KillPlayerHook, EOTS_MAP, &GenericBattleground::OnKillPlayer)
    CREATE_HOOK(af1, ArenaFinishHook, ALL_MAPS, &GenericBattleground::OnArenaFinish)
    CREATE_HOOK(af2, KillPlayerHook, ALL_MAPS, &GenericBattleground::OnKillPlayer)
}

void GenericBattleground::OnArenaFinish(Player * pPlayer, uint32 type, ArenaTeam * pTeam, bool victory, bool rated)
{
    if(!victory)
        return;

    if(pPlayer == NULL || pTeam == NULL)
        return;

    uint32 badges = 1 + type;
    if(rated)
    {
        uint32 r = RandomUInt(100);
        if(r < 15)
        {
            badges = badges * 2;