Changeset 34 for trunk/src/game/Player.cpp
- Timestamp:
- 11/19/08 13:25:37 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Player.cpp
r28 r34 579 579 580 580 // 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 } 582 600 583 601 // Played time … … 755 773 return; 756 774 757 //if have water breath , then remove bar758 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()) 759 777 { 760 778 StopMirrorTimer(BREATH_TIMER); … … 2128 2146 2129 2147 UpdateAllStats(); 2148 2149 if(sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up 2150 UpdateSkillsToMaxSkillsForLevel(); 2130 2151 2131 2152 // set current level health and mana/energy to maximum after applying all mods. … … 3602 3623 CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u'",guid); 3603 3624 CharacterDatabase.PExecute("DELETE FROM character_pet_declinedname WHERE owner = '%u'",guid); 3625 CharacterDatabase.PExecute("DELETE FROM has_logged_in_before WHERE guid = %u",guid); 3604 3626 CharacterDatabase.CommitTransaction(); 3605 3627 … … 3726 3748 DestroyZoneLimitedItem( true, GetZoneId()); 3727 3749 3728 if( !applySickness || getLevel() <= 10)3750 if(sWorld.getConfig(CONFIG_DISABLE_RES_SICKNESS) || !applySickness || getLevel() <= 10) 3729 3751 return; 3730 3752 … … 5898 5920 ///and the size of the group for which the honor is divided 5899 5921 ///An exact honor value can also be given (overriding the calcs) 5900 bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor )5922 bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvptoken) 5901 5923 { 5902 5924 // 'Inactive' this aura prevents the player from gaining honor points and battleground tokens … … 6017 6039 6018 6040 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 6019 6077 return true; 6020 6078 } … … 6384 6442 else if(duel->opponent->GetComboTarget()==GetPetGUID()) 6385 6443 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 } 6386 6451 6387 6452 //cleanups … … 7807 7872 data << uint64(guid); 7808 7873 data << uint32(resetTalentsCost()); 7874 if(sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST)) 7875 data << uint32(0); 7876 else 7877 data << uint32(resetTalentsCost()); 7809 7878 GetSession()->SendPacket( &data ); 7810 7879 } … … 17896 17965 17897 17966 // 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) 17899 17968 honored_kill = true; 17900 17969 … … 17934 18003 17935 18004 // honor can be in PvP and !PvP (racial leader) cases 17936 if(RewardHonor(pVictim,1 ))18005 if(RewardHonor(pVictim,1, -1, true)) 17937 18006 honored_kill = true; 17938 18007