Jump to content

caeruleaus

Members
  • Posts

    185
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by caeruleaus

  1. should work on "newest" sources

    diff --git a/src/game/Player.cpp b/src/game/Player.cpp
    index e482f7d..350a2ca 100644
    --- a/src/game/Player.cpp
    +++ b/src/game/Player.cpp
    @@ -21409,6 +21409,37 @@ 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);
    +
    +    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);
    +
    +    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 299dd31..3876208 100644
    --- a/src/game/Player.h
    +++ b/src/game/Player.h
    @@ -1964,6 +1964,9 @@ class MANGOS_DLL_SPEC Player : public Unit
            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();
            void _ApplyAllItemMods();
    diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
    index 3d0d448..10f57ea 100644
    --- a/src/game/Unit.cpp
    +++ b/src/game/Unit.cpp
    @@ -709,6 +709,11 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
                player->RewardPlayerAndGroupAtKill(pVictim);
                player->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
    
    +            // PvP Token
    +            int8 leveldiff = player->getLevel() - pVictim->getLevel();
    +            if((pVictim->GetTypeId() == TYPEID_PLAYER) && leveldiff < 10)
    +                player->ReceiveToken();
    +
                WorldPacket data(SMSG_PARTYKILLLOG, (8+8)); //send event PARTY_KILL
                data << uint64(player->GetGUID()); //player with killing blow
                data << uint64(pVictim->GetGUID()); //victim
    diff --git a/src/game/World.cpp b/src/game/World.cpp
    index 6bf92af..d55102a 100644
    --- a/src/game/World.cpp
    +++ b/src/game/World.cpp
    @@ -757,6 +757,15 @@ void World::LoadConfigSettings(bool reload)
        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_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 2cbaa40..4244156 100644
    --- a/src/game/World.h
    +++ b/src/game/World.h
    @@ -261,6 +261,12 @@ enum eConfigFloatValues
        CONFIG_FLOAT_GROUP_XP_DISTANCE,
        CONFIG_FLOAT_THREAT_RADIUS,
        CONFIG_FLOAT_VALUE_COUNT
    +
    +    ///PVP Token
    +    CONFIG_PVP_TOKEN_ENABLE,
    +    CONFIG_PVP_TOKEN_ITEMID,
    +    CONFIG_PVP_TOKEN_ITEMCOUNT,
    +    CONFIG_PVP_TOKEN_RESTRICTION
    };
    
    /// Configuration elements
    diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
    index e330abe..7b2804a 100644
    --- a/src/mangosd/mangosd.conf.dist.in
    +++ b/src/mangosd/mangosd.conf.dist.in
    @@ -1452,6 +1452,36 @@ SOAP.IP = 127.0.0.1
    SOAP.Port = 7878
    
    ###################################################################################################################
    +# 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.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.MapRestriction = 4
    +
    +###################################################################################################################
    #    CharDelete.Method
    #        Character deletion behavior
    #        Default: 0  - Completely remove the character from the database
    
    

  2. well if you download one of the newest rev's youll be fine.

    But it's recommended to use GIT anyways just so if you do have errors and whatnot and you report them, then it's not something that could have possibly been fixed.

    If you need any help with GIt look in the source code management section as there are a few guides there. If you can't find what you're looking for either make a post or message me and I'll try to help if i can.

  3. I actually managed to push all the mmaps to a github repo (they probably hate me over there lol). It'll take a little to dl but no where near as bad as generating them. just pull from my repo at:

    git://github.com/caeruleaus/mangos.git mmaps

    It's faramir118's repo plus the added mmap files in zip archives. I use 7zip so i don't know if it'll work correctly with other zip programs. just open any of the mmaps.zip.00# files and extract and your set

  4. Yeah i had seen the accidental use of the delete also.

    To get it to those lines (yes I'm sorry it's actually two lines =P lol) I put a lot of printf statements to figure out where the program hung up. It calls so many different writeToFiles though that I didn't trace all the way through lol.

    I could be wrong (which is quite possible) but that's just where it seemed to be happening.

  5. it's crashing because of a a vector check actually. I'll go run it again and debug it for you.

     #endif /* _HAS_ITERATOR_DEBUGGING */
           _SCL_SECURE_VALIDATE_RANGE(_Pos < size()); <---------- Debugger says it crashes there
    
           return (*(_Myfirst + _Pos));
           }

    EDIT: I compiled the assembler in debug and then ran it. It's throwing an assert that the vector subscript is out of range (which makes sense since that what it's checking here.)

  6. that's true lol. Well I might mess around with it a little just to see what's up with it. I'm actually making mmaps for every map tile right now using the thing i mentioned. It's been running for like 2 hours and it's only on like map 1 lol

  7. i was bored so i actually got every map file split into map Id, X, and Y

    http://paste2.org/p/790381

    cope and paste the whole thing into a file called convert.txt and place it in the same folder as your generator.exe

    you can run a simple command in the git bash (it has to be git bash since windows doesn't have a read command) to convert EVERY map. It'll take a long ass time though.

    while read -d ";" line; do generator $line; done <convert.txt

    this should work on linux also since the read command is actually part of linux

  8. i got it to extract fine. But when i run the assembler i get an error that says "Error: file name too long!" and then on the next line something like

    min guid: 5579 max guid:5497953

    Then it starts to assemble the vmaps but crashes on stormwind.wmo

×
×
  • 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