Jump to content

atombomb

Members
  • Posts

    13
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by atombomb

  1. why not use the forums api on the frontend "minimanager or whatever ur gonna use" and just add redirects on the forum for the register and change pass buttons this way u dont have to modify much on the forum so that its easier to update it at a later time. I know in SMF they even have a page u can view that has all there api functions on it.

  2. Added to Darkrulerz code to add gold on kill also, you can disable it by doing this in config "PvPToken.Gold = 0"

    From d86442c181cadc3a1e02b990015d914f20aeb6ae Mon Sep 17 00:00:00 2001
    From: Furt <[email protected]>
    Date: Mon, 14 Jun 2010 07:34:18 -0500
    Subject: [PATCH] PVP Token Patch With Gold Reward Added
    
    ---
    src/game/Player.cpp              |   37 +++++++++++++++++++++++++++++++++++++
    src/game/Player.h                |    3 +++
    src/game/Unit.cpp                |    5 +++++
    src/game/World.cpp               |   10 ++++++++++
    src/game/World.h                 |   10 +++++++++-
    src/mangosd/mangosd.conf.dist.in |   35 +++++++++++++++++++++++++++++++++++
    6 files changed, 99 insertions(+), 1 deletions(-)
    
    diff --git a/src/game/Player.cpp b/src/game/Player.cpp
    index 106fdb4..d40d80a 100644
    --- a/src/game/Player.cpp
    +++ b/src/game/Player.cpp
    @@ -21449,6 +21449,43 @@ void Player::UpdateFallInformationIfNeed( MovementInfo const& minfo,uint16 opcod
            SetFallInformation(minfo.GetFallTime(), minfo.GetPos()->z);
    }
    
    +///PVP Token
    +void Player::ReceiveToken()
    +{
    +    if(!sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE))
    +        return;
    +
    +    uint8 MapRestriction = sWorld.getConfig(CONFIG_PVP_TOKEN_RESTRICTION);
    +
    +    if( MapRestriction == 1 && !InBattleGround() && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP) ||
    +        MapRestriction == 2 && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP) ||
    +        MapRestriction == 3 && !InBattleGround())
    +        return;
    +
    +    uint32 itemID = sWorld.getConfig(CONFIG_PVP_TOKEN_ITEMID);
    +    uint32 itemCount = sWorld.getConfig(CONFIG_PVP_TOKEN_ITEMCOUNT);
    +    uint32 goldAmount = sWorld.getConfig(CONFIG_PVP_TOKEN_GOLD);
    +
    +    ItemPosCountVec dest;
    +    uint8 msg = CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemID, itemCount);
    +    if( msg != EQUIP_ERR_OK )   // convert to possible store amount
    +    {
    +        SendEquipError( msg, NULL, NULL );
    +        return;
    +    }
    +
    +    Item* item = StoreNewItem( dest, itemID, true, Item::GenerateItemRandomPropertyId(itemID));
    +    SendNewItem(item,itemCount,true,false);
    +
    +    if( goldAmount > 0 )
    +        ModifyMoney(goldAmount);
    +        SaveGoldToDB();
    +        return;
    +
    +    ChatHandler(this).PSendSysMessage(LANG_YOU_RECEIVE_TOKEN);
    +}
    +
    +
    void Player::UnsummonPetTemporaryIfAny()
    {
        Pet* pet = GetPet();
    diff --git a/src/game/Player.h b/src/game/Player.h
    index 544e7e1..6801a77 100644
    --- a/src/game/Player.h
    +++ b/src/game/Player.h
    @@ -2019,6 +2019,9 @@ class MANGOS_DLL_SPEC Player : public Unit
            void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply);
            void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply);
            void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply);
    +        
    +        ///PVP Token
    +        void ReceiveToken();
    
            void _ApplyItemMods(Item *item,uint8 slot,bool apply);
            void _RemoveAllItemMods();
    diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
    index d0c82d8..91d3919 100644
    --- a/src/game/Unit.cpp
    +++ b/src/game/Unit.cpp
    @@ -697,6 +697,11 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
            if(player_tap && player_tap != pVictim)
            {
                player_tap->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
    +            
    +            /// PvP Token
    +            int8 leveldiff = player_tap->getLevel() - pVictim->getLevel();
    +            if((pVictim->GetTypeId() == TYPEID_PLAYER) && leveldiff < 10)
    +            player_tap->ReceiveToken();
    
                WorldPacket data(SMSG_PARTYKILLLOG, (8+8));     //send event PARTY_KILL
                data << player_tap->GetObjectGuid();            //player with killing blow
    diff --git a/src/game/World.cpp b/src/game/World.cpp
    index abf273d..034178a 100644
    --- a/src/game/World.cpp
    +++ b/src/game/World.cpp
    @@ -755,6 +755,16 @@ void World::LoadConfigSettings(bool reload)
        setConfig(CONFIG_UINT32_TIMERBAR_BREATH_MAX,      "TimerBar.Breath.Max", 180);
        setConfig(CONFIG_UINT32_TIMERBAR_FIRE_GMLEVEL,    "TimerBar.Fire.GMLevel", SEC_CONSOLE);
        setConfig(CONFIG_UINT32_TIMERBAR_FIRE_MAX,        "TimerBar.Fire.Max", 1);
    +    
    +    /* PvP Token System */
    +    setConfig(CONFIG_PVP_TOKEN_ENABLE,"PvPToken.Enable", true);
    +    setConfig(CONFIG_PVP_TOKEN_ITEMID,"PvPToken.ItemID", 29434);
    +    setConfig(CONFIG_PVP_TOKEN_ITEMCOUNT,"PvPToken.ItemCount", 1);
    +     setConfig(CONFIG_PVP_TOKEN_GOLD,"PvPToken.Gold", 100000);
    +    setConfig(CONFIG_PVP_TOKEN_RESTRICTION,"PvPToken.MapRestriction", 4);
    +
    +    if(getConfig(CONFIG_PVP_TOKEN_ITEMCOUNT) < 1)
    +    setConfig(CONFIG_PVP_TOKEN_ITEMCOUNT,"PvPToken.ItemCount",1);
    
        m_VisibleUnitGreyDistance = sConfig.GetFloatDefault("Visibility.Distance.Grey.Unit", 1);
        if(m_VisibleUnitGreyDistance >  MAX_VISIBILITY_DISTANCE)
    diff --git a/src/game/World.h b/src/game/World.h
    index b289b91..31ee893 100644
    --- a/src/game/World.h
    +++ b/src/game/World.h
    @@ -260,7 +260,15 @@ enum eConfigFloatValues
        CONFIG_FLOAT_CREATURE_FAMILY_ASSISTANCE_RADIUS,
        CONFIG_FLOAT_GROUP_XP_DISTANCE,
        CONFIG_FLOAT_THREAT_RADIUS,
    -    CONFIG_FLOAT_VALUE_COUNT
    +    CONFIG_FLOAT_VALUE_COUNT,
    +    
    +    ///PVP Token
    +    CONFIG_PVP_TOKEN_ENABLE,
    +    CONFIG_PVP_TOKEN_ITEMID,
    +    CONFIG_PVP_TOKEN_ITEMCOUNT,
    +    CONFIG_PVP_TOKEN_GOLD,
    +    CONFIG_PVP_TOKEN_RESTRICTION
    +
    };
    
    /// Configuration elements
    diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
    index f5ba807..390c66c 100644
    --- a/src/mangosd/mangosd.conf.dist.in
    +++ b/src/mangosd/mangosd.conf.dist.in
    @@ -1519,3 +1519,38 @@ SOAP.Port = 7878
    CharDelete.Method = 0
    CharDelete.MinLevel = 0
    CharDelete.KeepDays = 30
    +
    +###################################################################################################################
    +# PvP Token System (custom patch)
    +#
    +#   PvPToken.Enable
    +#       Enable/disable PvP Token system.
    +#       Default: 1 (enabled)
    +#       0 (disabled)
    +#
    +#   PvPToken.ItemID
    +#       The item ID of the token that players will receive after killing an enemy.
    +#       Default: 29434 (Badge of Justice)
    +#
    +#   PvPToken.ItemCount
    +#       The count amount of the ItemID
    +#       Default: 1
    +#
    +#   PvPToken.Gold
    +#       The amount of gold that players will receive after killing an enemy.
    +#       Default: 100000
    +#
    +#   PvPToken.MapRestriction
    +#       The type of maps where players can receive the token
    +#       Default: 4 - all maps
    +#       3 - battlegrounds only
    +#       2 - FFA areas only (both instanced and world arenas)
    +#       1 - battlegrounds and FFA areas only
    +#
    +###################################################################################################################
    +
    +PvPToken.Enable = 1
    +PvPToken.ItemID = 29434
    +PvPToken.ItemCount = 1
    +PvPToken.Gold = 100000
    +PvPToken.MapRestriction = 4
    -- 

    Edit: noticed i forgot the part for language.cpp in the patch i made so apply this after u apply the first.

    From dd54b532911d2227847c1b67969b6f41421e32b7 Mon Sep 17 00:00:00 2001
    From: Furt <[email protected]>
    Date: Mon, 14 Jun 2010 07:45:41 -0500
    Subject: [PATCH 2/2] Token Part2
    
    ---
    src/game/Language.h |    1 +
    1 files changed, 1 insertions(+), 0 deletions(-)
    
    diff --git a/src/game/Language.h b/src/game/Language.h
    index 38ec346..4f8e6a9 100644
    --- a/src/game/Language.h
    +++ b/src/game/Language.h
    @@ -851,6 +851,7 @@ enum MangosStrings
    
        // Use for not-in-offcial-sources patches
        //                                    10000-10999
    +    LANG_YOU_RECEIVE_TOKEN                = 11050,
    
        // Use for custom patches             11000-11999
    
    -- 

  3. I was right when I said that we must look at BattleGround::EventPlayerLoggedOut().

    There are nice hack

    @@ -245,22 +245,19 @@ void BattleGround::Update(uint32 diff)
            if (!GetInvitedCount(HORDE) && !GetInvitedCount(ALLIANCE))
                m_SetDeleteThis = true;
            return;
        }
    
    -    // remove offline players from bg after 5 minutes
    +    // remove offline players from bg without delays (blizzlike is after 5 minutes)
        if (!m_OfflineQueue.empty())
        {
            BattleGroundPlayerMap::iterator itr = m_Players.find(*(m_OfflineQueue.begin()));
            if (itr != m_Players.end())
            {
    -            if (itr->second.OfflineRemoveTime <= sWorld.GetGameTime())
    -            {
    -                RemovePlayerAtLeave(itr->first, true, true);// remove player from BG
    -                m_OfflineQueue.pop_front();                 // remove from offline queue
    -                //do not use itr for anything, because it is erased in RemovePlayerAtLeave()
    -            }
    +            RemovePlayerAtLeave(itr->first, true, true);// remove player from BG
    +            m_OfflineQueue.pop_front();                 // remove from offline queue
    +            //do not use itr for anything, because it is erased in RemovePlayerAtLeave()
            }
        }
    
        /*********************************************************/
        /***           BATTLEGROUND BALLANCE SYSTEM            ***/
    

    I'm not really understanding whats wrong i tried reproducing it ingame but i don't see it.

    On intentional logout, if u log back in within the 5 minute time limit your fine and load back into the bg in last position and you drop flag as u logout "this has been test twice and its offlike , if your out of game longer u get ported back to last position b4 the bg and have the abandon debuff.

  4. Not sure if anyone has talked about this b4 but here is my idea.

    Lets say you have 2 tests servers and you want a gmlvl2 tester on one of the realms but not on the other

    currently this is not possible.

    The idea is to add another column in the accounts table called GMrealm and it will use realmlist id's

    so say testrealm1 = 1 and testrealm2 = 4

    And lets say you have a account with gmlvl 3 but you only want them using it on the first realm so in that column you would set it to 1. If u want them to be gmlvl3 on both you would set it GMrealm = 1,4

    I havent attemped this b/c i have very little c++ experience im only good at fixing conflicts but i figured now would be the time to learn :P

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use