Help me please with Reward on "Attack assist" menu

User Tag List

Results 1 to 3 of 3
  1. #1
    darksoke's Avatar Member
    Reputation
    5
    Join Date
    May 2013
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help me please with Reward on "Attack assist"

    actualy what i need is a script wich give gold to healars/helpers after someone killed an player in BG all will be rewarded with gold even healars and the others who attacked the victim .. i tried to convert this mangoos script to work for trinity but i get toons of errors and actually this is what i need
    Code:
    void Player::HandlePvPKill()
    {
        if (!IsInWorld())
            return;
     
        const uint32 RewardGold = sWorld.getConfig(CONFIG_UINT32_PVPGOLD_BASE);
        const uint32 MaxReward = sWorld.getConfig(CONFIG_UINT32_MAX_PVPGOLD) * RewardGold;
        uint32 InCombatPlayers = 0;
        Player* MaxD    = 0;
        uint32 MaxDmg   = 0;
        Team HellFireOwner = sWorld.GetHellFireOwner();
     
        float TotalHealth = 0;
     
        DHMap::const_iterator aitr;
        DHMap::const_iterator dbitr = m_Damagers.begin();
        DHMap::const_iterator deitr = m_Damagers.end();
     
        for (aitr = dbitr; aitr != deitr; ++aitr)
            TotalHealth += aitr->second; // Sums up the total damage made to the victim.
        for (aitr = dbitr; aitr != deitr; ++aitr)
        {
            ++InCombatPlayers;
            Player* pAttacker = sObjectMgr.GetPlayer(aitr->first);
            float   Damage    = aitr->second;
     
            if (!pAttacker || !pAttacker->IsInWorld() || pAttacker == this)
                continue;
     
            if (Damage > MaxDmg)
            {
                MaxD        = pAttacker;
                MaxDmg      = Damage;
            }
     
            if (!pAttacker->IsPvPFarm(this))
            {
                uint32 Reward = RewardGold * (Damage / TotalHealth)*((pAttacker->GetKillStreak() / 10) + 1.0f);
                if (GetTeam() != pAttacker->GetTeam() && pAttacker->GetTeam() == HellFireOwner)
                    Reward *= 2;
                if (Reward > MaxReward)
                    Reward = MaxReward;
     
                uint32 NewMoney = pAttacker->GetMoney() + (Reward * pAttacker->GetBoosterMod(DONATION_BOOST_GOLD));
                if (NewMoney < MAX_MONEY_AMOUNT)
                    pAttacker->SetMoney(NewMoney);
     
                pAttacker->IncreaseKillStreak();
     
                pAttacker->SendChatMessage("%s[PvP System]%s You got awarded %.2f gold for damaging %s", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, Reward/10000.f, GetNameLink().c_str());
     
                float TotalHealing = 0;
     
                DHMap::const_iterator hitr;
                DHMap::const_iterator hbitr = pAttacker->m_Healers.begin();
                DHMap::const_iterator heitr = pAttacker->m_Healers.begin();
     
                for (hitr = hbitr; hitr != heitr; ++hitr)
                    TotalHealing += hitr->second; // Sums up the total healing made to the attacker.
                for (hitr = hbitr; hitr != heitr; ++hitr)
                {
                    ++InCombatPlayers;
     
                    Player* pHealer     = sObjectMgr.GetPlayer(hitr->first);
                    float   Healing     = hitr->second;
                    float   MaxHealth   = pAttacker->GetMaxHealth();
     
                    if (!pHealer || !pHealer->IsInWorld())
                        continue;
     
                    float maxhealingPct = (Healing / MaxHealth);
                    if (maxhealingPct > 1)
                        maxhealingPct = 1.0f;
     
                    Reward *= (Healing / TotalHealing)*((pHealer->GetKillStreak() / 10) + 1.0f) * maxhealingPct;
                    if (Reward > MaxReward)
                        Reward = MaxReward;
     
                    uint32 NewMoney = pHealer->GetMoney() + (Reward * pHealer->GetBoosterMod(DONATION_BOOST_GOLD));
                    if (NewMoney < MAX_MONEY_AMOUNT)
                        pHealer->SetMoney(NewMoney);
     
                    pHealer->IncreaseKillStreak();
     
                    pHealer->SendChatMessage("%s[PvP System]%s You got awarded %.2f gold for healing %s who damaged %s", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, Reward/10000.f, pAttacker->GetNameLink().c_str(), GetNameLink().c_str());
                }
            }
            else
                pAttacker->SendChatMessage("%s[Anti-farming System]%s You triggered the anti-farming system.", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE);
        }
     
        if (MaxD && !MaxD->IsPvPFarm(this, false))
        {
            MaxD->SendChatMessage("%s[PvP System]%s You did most damage to %s%s (%u)", MSG_COLOR_MAGENTA,MSG_COLOR_WHITE, GetNameLink().c_str(), MSG_COLOR_WHITE, MaxDmg);
            SendChatMessage("%s[PvP System]%s Your main attacker was %s%s who did %u damage to you.", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, MaxD->GetNameLink().c_str(), MSG_COLOR_WHITE, MaxDmg);
        }
     
        ClearKillStreak();
        ClearDamageHeal();
     
        if (InCombatPlayers > 1)
            SendChatMessage("%s[PvP System]%s There were %u players involved in the combat to your death.", MSG_COLOR_MAGENTA, MSG_COLOR_WHITE, InCombatPlayers);
    }
    please if anny of you can converti it to work for trinity or give me a solution i need it fast
    Thx Darksoke !..

    Help me please with Reward on &quot;Attack assist&quot;
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The function you posted essentially hooks when a honour kill is made.

    It loops through all the players in combat with the target, then rewards them equally depending on how much damage etc was done in that fight.

    You need to hook the same function then look for similar methods to achieve what that function does.

  3. #3
    darksoke's Avatar Member
    Reputation
    5
    Join Date
    May 2013
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    The function you posted essentially hooks when a honour kill is made.

    It loops through all the players in combat with the target, then rewards them equally depending on how much damage etc was done in that fight.

    You need to hook the same function then look for similar methods to achieve what that function does.
    i'm trying to figure out for 3 days how to get it work and the only thing i found and i think it can work is

    void onpvpkill(Player * killer, Player * victim)

    {
    Battleground * bg = killer -> getbattleground();

    if(bg)
    {
    victim->getattackers() and here i'm locked :S idk how to get a link to attackers :S
    }

Similar Threads

  1. Can someone help me please with d3 bot ?
    By gef69 in forum Diablo 3 Bots Questions & Requests
    Replies: 2
    Last Post: 09-25-2012, 05:03 PM
  2. Help Please With These Few Things.
    By BillyBob31 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 03-10-2008, 11:48 AM
  3. Help please with server-two people. must be good with ascent
    By waggy420 in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 03-03-2008, 09:54 PM
  4. Replies: 7
    Last Post: 01-28-2008, 03:42 PM
  5. Help please with item models
    By Pimpin_N0ob in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 09-02-2007, 10:06 PM
All times are GMT -5. The time now is 11:26 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search