Show
Ignore:
Timestamp:
11/19/08 13:25:37 (17 years ago)
Author:
yumileroy
Message:

[svn] * Removing useless data accidentally committed.
* Applying ImpConfig? patch.
* Note: QUEUE_FOR_GM currently disabled as it's not compatible with the ACE patch. Anyone care to rewrite it?
* Note2: This is untested - I may have done some mistakes here and there. Will try to compile now.

Original author: XTZGZoReX
Date: 2008-10-10 13:37:21-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Player.cpp

    r28 r34  
    579579 
    580580    // set starting level 
    581     SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) ); 
     581        if(GetSession()->GetSecurity() >= SEC_MODERATOR) 
     582                SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_GM_START_LEVEL) ); //ImpConfig 
     583        else 
     584                SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) ); 
     585        // set starting gold 
     586        SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.PlayerStartGold()*10000 ); 
     587 
     588        // set starting honor 
     589        SetUInt32Value( PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_HONOR) ); 
     590 
     591        // set starting arena pts 
     592        SetUInt32Value( PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_ARENAPTS) ); 
     593 
     594        // start with every map explored 
     595        if(sWorld.getConfig(CONFIG_START_ALL_EXPLORED)) 
     596        { 
     597                for (uint8 i=0; i<64; i++) 
     598                        SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF); 
     599        } 
    582600 
    583601    // Played time 
     
    755773        return; 
    756774 
    757     //if have water breath , then remove bar 
    758     if(waterbreath || isGameMaster() || !isAlive()) 
     775    //if players is GM, have waterbreath, dead or breathing is disabled 
     776    if(sWorld.getConfig(CONFIG_DISABLE_BREATHING) || waterbreath || isGameMaster() || !isAlive()) 
    759777    { 
    760778        StopMirrorTimer(BREATH_TIMER); 
     
    21282146 
    21292147    UpdateAllStats(); 
     2148 
     2149    if(sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up 
     2150    UpdateSkillsToMaxSkillsForLevel(); 
    21302151 
    21312152    // set current level health and mana/energy to maximum after applying all mods. 
     
    36023623    CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u'",guid); 
    36033624    CharacterDatabase.PExecute("DELETE FROM character_pet_declinedname WHERE owner = '%u'",guid); 
     3625    CharacterDatabase.PExecute("DELETE FROM has_logged_in_before WHERE guid = %u",guid); 
    36043626    CharacterDatabase.CommitTransaction(); 
    36053627 
     
    37263748    DestroyZoneLimitedItem( true, GetZoneId()); 
    37273749 
    3728     if(!applySickness || getLevel() <= 10) 
     3750    if(sWorld.getConfig(CONFIG_DISABLE_RES_SICKNESS) || !applySickness || getLevel() <= 10) 
    37293751        return; 
    37303752 
     
    58985920///and the size of the group for which the honor is divided 
    58995921///An exact honor value can also be given (overriding the calcs) 
    5900 bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor) 
     5922bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvptoken) 
    59015923{ 
    59025924    // 'Inactive' this aura prevents the player from gaining honor points and battleground tokens 
     
    60176039 
    60186040    ApplyModUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, uint32(honor), true); 
     6041 
     6042        if( sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken ) 
     6043        { 
     6044                if(!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT)) 
     6045                        return true; 
     6046 
     6047                if(uVictim->GetTypeId() == TYPEID_PLAYER) 
     6048                { 
     6049                        // Check if allowed to receive it in current map 
     6050                        uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE); 
     6051                        if(MapType == 1 && !InBattleGround() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) || MapType == 2 && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) || MapType == 3 && !InBattleGround()) 
     6052                                return true; 
     6053 
     6054                        uint32 noSpaceForCount = 0; 
     6055                        uint32 itemId = sWorld.getConfig(CONFIG_PVP_TOKEN_ID); 
     6056                        int32 count = sWorld.getConfig(CONFIG_PVP_TOKEN_COUNT); 
     6057 
     6058                        // check space and find places 
     6059                        ItemPosCountVec dest; 
     6060                        uint8 msg = CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount ); 
     6061                        if( msg != EQUIP_ERR_OK )   // convert to possible store amount 
     6062                                count = noSpaceForCount; 
     6063 
     6064                        if( count == 0 || dest.empty()) // can't add any 
     6065                        { 
     6066                                // -- TODO: Send to mailbox if no space 
     6067                                ChatHandler(this).PSendSysMessage("You don't have any space in your bags for a token."); 
     6068                                return true; 
     6069                        } 
     6070 
     6071                        Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); 
     6072                        SendNewItem(item,count,true,false); 
     6073                        ChatHandler(this).PSendSysMessage("You have been awarded a token for slaying another player."); 
     6074                } 
     6075        } 
     6076 
    60196077    return true; 
    60206078} 
     
    63846442    else if(duel->opponent->GetComboTarget()==GetPetGUID()) 
    63856443        duel->opponent->ClearComboPoints(); 
     6444 
     6445        // Honor points after duel (the winner) - ImpConfig 
     6446        if(sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL > 0)) 
     6447        { 
     6448                uint32 amount = sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL); 
     6449                duel->opponent->RewardHonor(NULL,1,amount); 
     6450        } 
    63866451 
    63876452    //cleanups 
     
    78077872    data << uint64(guid); 
    78087873    data << uint32(resetTalentsCost()); 
     7874        if(sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST)) 
     7875                data << uint32(0); 
     7876        else 
     7877                data << uint32(resetTalentsCost()); 
    78097878    GetSession()->SendPacket( &data ); 
    78107879} 
     
    1789617965 
    1789717966                // honor can be in PvP and !PvP (racial leader) cases (for alive) 
    17898                 if(pGroupGuy->isAlive() && pGroupGuy->RewardHonor(pVictim,count) && pGroupGuy==this) 
     17967                if(pGroupGuy->isAlive() && pGroupGuy->RewardHonor(pVictim,count, -1, true) && pGroupGuy==this) 
    1789917968                    honored_kill = true; 
    1790017969 
     
    1793418003 
    1793518004        // honor can be in PvP and !PvP (racial leader) cases 
    17936         if(RewardHonor(pVictim,1)) 
     18005        if(RewardHonor(pVictim,1, -1, true)) 
    1793718006            honored_kill = true; 
    1793818007