Changeset 34 for trunk/src/game
- Timestamp:
- 11/19/08 13:25:37 (17 years ago)
- Location:
- trunk/src/game
- Files:
-
- 12 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/BattleGround.h
r9 r34 32 32 SOUND_HORDE_WINS = 8454, 33 33 SOUND_ALLIANCE_WINS = 8455, 34 SOUND_BG_START = 3439 34 SOUND_BG_START = 3439, 35 SOUND_BG_START_L70ETC = 11803, 35 36 }; 36 37 -
trunk/src/game/BattleGroundAB.cpp
r9 r34 26 26 #include "MapManager.h" 27 27 #include "Language.h" 28 #include "World.h" 28 29 #include "Util.h" 29 30 … … 108 109 DoorOpen(BG_AB_OBJECT_GATE_H); 109 110 110 PlaySoundToAll(SOUND_BG_START); 111 if(sWorld.getConfig(CONFIG_BG_START_MUSIC)) 112 { 113 PlaySoundToAll(SOUND_BG_START); 114 PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC 115 } 116 else 117 PlaySoundToAll(SOUND_BG_START); 111 118 SetStatus(STATUS_IN_PROGRESS); 112 119 -
trunk/src/game/BattleGroundEY.cpp
r9 r34 26 26 #include "MapManager.h" 27 27 #include "Language.h" 28 #include "World.h" 28 29 #include "Util.h" 29 30 … … 100 101 SendMessageToAll(GetMangosString(LANG_BG_EY_BEGIN)); 101 102 102 PlaySoundToAll(SOUND_BG_START); 103 if(sWorld.getConfig(CONFIG_BG_START_MUSIC)) 104 { 105 PlaySoundToAll(SOUND_BG_START); 106 PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC 107 } 108 else 109 PlaySoundToAll(SOUND_BG_START); 103 110 SetStatus(STATUS_IN_PROGRESS); 104 111 -
trunk/src/game/BattleGroundWS.cpp
r9 r34 26 26 #include "MapManager.h" 27 27 #include "Language.h" 28 #include "World.h" 28 29 29 30 BattleGroundWS::BattleGroundWS() … … 98 99 SendMessageToAll(GetMangosString(LANG_BG_WS_BEGIN)); 99 100 100 PlaySoundToAll(SOUND_BG_START); 101 if(sWorld.getConfig(CONFIG_BG_START_MUSIC)) 102 { 103 PlaySoundToAll(SOUND_BG_START); 104 PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC - Custom config 105 } 106 else 107 PlaySoundToAll(SOUND_BG_START); 101 108 SetStatus(STATUS_IN_PROGRESS); 102 109 -
trunk/src/game/CharacterHandler.cpp
r28 r34 733 733 sWorld.ShutdownMsg(true,pCurrChar); 734 734 735 if(sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when logging in 736 pCurrChar->UpdateSkillsToMaxSkillsForLevel(); 737 738 //ImpConfig - Check if player has logged in before 739 QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM has_logged_in_before WHERE guid = %u",pCurrChar->GetGUIDLow()); 740 if(!result) 741 { 742 sLog.outBasic("Character '%s' logging in for first time, applying skills and stuff",pCurrChar->GetName()); 743 CharacterDatabase.PExecute("INSERT INTO has_logged_in_before VALUES (%u)",pCurrChar->GetGUIDLow()); 744 745 //Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way 746 if(sWorld.getConfig(CONFIG_START_ALL_REP)) 747 { 748 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(942),42999); 749 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(935),42999); 750 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(936),42999); 751 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(1011),42999); 752 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(970),42999); 753 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(967),42999); 754 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(989),42999); 755 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(932),42999); 756 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(934),42999); 757 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(1038),42999); 758 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(1077),42999); 759 760 // Factions depending on team, like cities and some more stuff 761 switch(pCurrChar->GetTeam()) 762 { 763 case ALLIANCE: 764 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(72),42999); 765 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(47),42999); 766 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(69),42999); 767 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(930),42999); 768 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(730),42999); 769 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(978),42999); 770 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(54),42999); 771 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(946),42999); 772 break; 773 case HORDE: 774 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(76),42999); 775 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(68),42999); 776 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(81),42999); 777 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(911),42999); 778 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(729),42999); 779 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(941),42999); 780 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(530),42999); 781 pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(947),42999); 782 break; 783 } 784 } 785 } 786 else 787 sLog.outBasic("Character '%s' has logged in before",pCurrChar->GetName()); 788 789 if(sWorld.getConfig(CONFIG_START_ALL_TAXI)) 790 pCurrChar->SetTaxiCheater(true); 791 792 735 793 if(pCurrChar->isGameMaster()) 736 794 SendNotification(LANG_GM_ON); -
trunk/src/game/MiscHandler.cpp
r28 r34 296 296 } 297 297 298 //instant logout in taverns/cities or on taxi 299 if(GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() )298 //instant logout in taverns/cities or on taxi or if its enabled in mangosd.conf 299 if(GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() || sWorld.getConfig(CONFIG_INSTANT_LOGOUT)) 300 300 { 301 301 LogoutPlayer(true); … … 575 575 if(newZone != _player->GetZoneId()) 576 576 GetPlayer()->SendInitWorldStates(); // only if really enters to new zone, not just area change, works strange... 577 578 // AntiCheat.GMIsland 579 if(sWorld.getConfig(CONFIG_KICK_FROM_GMISLAND)) 580 { 581 if(newZone == 876 && GetPlayer()->GetSession()->GetSecurity() == SEC_PLAYER) 582 _player->TeleportTo(13,0,0,0,0); 583 } 577 584 578 585 GetPlayer()->UpdateZone(newZone); -
trunk/src/game/ObjectMgr.cpp
r28 r34 2082 2082 QueryResult *result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell"); 2083 2083 2084 QueryResult *result = NULL; 2085 if(sWorld.getConfig(CONFIG_START_ALL_SPELLS)) 2086 result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom"); 2087 else 2088 result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell"); 2089 2084 2090 uint32 count = 0; 2085 2091 … … 2090 2096 sLog.outString(); 2091 2097 sLog.outString( ">> Loaded %u player create spells", count ); 2092 sLog.outErrorDb( "Error loading `playercreateinfo_spell` tableor empty table.");2098 sLog.outErrorDb( "Error loading player starting spells or empty table."); 2093 2099 } 2094 2100 else -
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 -
trunk/src/game/Player.h
r28 r34 1723 1723 void UpdateArenaFields(); 1724 1724 void UpdateHonorFields(); 1725 bool RewardHonor(Unit *pVictim, uint32 groupsize, float honor = -1 );1725 bool RewardHonor(Unit *pVictim, uint32 groupsize, float honor = -1, bool pvptoken = false); 1726 1726 uint32 GetHonorPoints() { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); } 1727 1727 uint32 GetArenaPoints() { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); } -
trunk/src/game/World.cpp
r28 r34 63 63 volatile uint32 World::m_worldLoopCounter = 0; 64 64 65 float World::m_PlayerStartGold = 0; // starting gold 65 66 float World::m_MaxVisibleDistanceForCreature = DEFAULT_VISIBILITY_DISTANCE; 66 67 float World::m_MaxVisibleDistanceForPlayer = DEFAULT_VISIBILITY_DISTANCE; … … 769 770 m_configs[CONFIG_LISTEN_RANGE_YELL] = sConfig.GetIntDefault("ListenRange.Yell", 300); 770 771 772 m_PlayerStartGold = sConfig.GetFloatDefault("PlayerStart.Gold", 0); 773 if(m_PlayerStartGold < 0) 774 m_PlayerStartGold = 0; 775 776 if(m_PlayerStartGold > MAX_MONEY_AMOUNT) 777 m_PlayerStartGold = MAX_MONEY_AMOUNT; 778 779 m_configs[CONFIG_PLAYER_START_HONOR] = sConfig.GetIntDefault("PlayerStart.HonorPoints", 0); 780 if(m_configs[CONFIG_PLAYER_START_HONOR] < 0) 781 m_configs[CONFIG_PLAYER_START_HONOR] = 0; 782 783 m_configs[CONFIG_PLAYER_START_ARENAPTS] = sConfig.GetIntDefault("PlayerStart.ArenaPoints", 0); 784 if(m_configs[CONFIG_PLAYER_START_ARENAPTS] < 0) 785 m_configs[CONFIG_PLAYER_START_ARENAPTS] = 0; 786 787 m_configs[CONFIG_GM_START_LEVEL] = sConfig.GetIntDefault("GamemasterStartLevel", 70); 788 if(m_configs[CONFIG_GM_START_LEVEL] < 1) 789 m_configs[CONFIG_GM_START_LEVEL] = 1; 790 791 m_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetBoolDefault("PlayerInstantLogout", false); 792 m_configs[CONFIG_BG_START_MUSIC] = sConfig.GetBoolDefault("MusicInBattleground", false); 793 m_configs[CONFIG_START_ALL_SPELLS] = sConfig.GetBoolDefault("PlayerStart.AllSpells", false); 794 // Leaving GM queue option out for now, it's not 100% functional with the ACE patch 795 //m_configs[CONFIG_QUEUE_FOR_GM] = sConfig.GetBoolDefault("EnableQueueForGMs", false); 796 m_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0); 797 if(m_configs[CONFIG_HONOR_AFTER_DUEL] < 0) 798 m_configs[CONFIG_HONOR_AFTER_DUEL]= 0; 799 m_configs[CONFIG_KICK_FROM_GMISLAND] = sConfig.GetBoolDefault("AntiCheat.GMIsland", false); 800 m_configs[CONFIG_START_ALL_EXPLORED] = sConfig.GetBoolDefault("PlayerStart.MapsExplored", false); 801 m_configs[CONFIG_DISABLE_BREATHING] = sConfig.GetBoolDefault("DisableWaterBreath", false); 802 m_configs[CONFIG_DISABLE_RES_SICKNESS] = sConfig.GetBoolDefault("DisableResurrectSickness", false); 803 m_configs[CONFIG_START_ALL_REP] = sConfig.GetBoolDefault("PlayerStart.AllReputation", false); 804 m_configs[CONFIG_ALWAYS_MAXSKILL] = sConfig.GetBoolDefault("AlwaysMaxWeaponSkill", false); 805 m_configs[CONFIG_START_ALL_TAXI] = sConfig.GetBoolDefault("PlayerStart.AllFlightPaths", false); 806 m_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfig.GetBoolDefault("PvPToken.Enable", false); 807 m_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfig.GetIntDefault("PvPToken.MapAllowType", 4); 808 m_configs[CONFIG_PVP_TOKEN_ID] = sConfig.GetIntDefault("PvPToken.ItemID", 29434); 809 m_configs[CONFIG_PVP_TOKEN_COUNT] = sConfig.GetIntDefault("PvPToken.ItemCount", 1); 810 if(m_configs[CONFIG_PVP_TOKEN_COUNT] < 1) 811 m_configs[CONFIG_PVP_TOKEN_COUNT] = 1; 812 m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false); 771 813 772 814 m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault("Arena.MaxRatingDifference", 0); -
trunk/src/game/World.h
r28 r34 154 154 CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP, 155 155 CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE, 156 157 CONFIG_PLAYER_START_HONOR, 158 CONFIG_PLAYER_START_ARENAPTS, 159 CONFIG_GM_START_LEVEL, 160 CONFIG_INSTANT_LOGOUT, 161 CONFIG_BG_START_MUSIC, 162 CONFIG_START_ALL_SPELLS, 163 CONFIG_QUEUE_FOR_GM, 164 CONFIG_HONOR_AFTER_DUEL, 165 CONFIG_KICK_FROM_GMISLAND, 166 CONFIG_START_ALL_EXPLORED, 167 CONFIG_DISABLE_BREATHING, 168 CONFIG_DISABLE_RES_SICKNESS, 169 CONFIG_START_ALL_REP, 170 CONFIG_ALWAYS_MAXSKILL, 171 CONFIG_START_ALL_TAXI, 172 CONFIG_PVP_TOKEN_ENABLE, 173 CONFIG_PVP_TOKEN_MAP_TYPE, 174 CONFIG_PVP_TOKEN_ID, 175 CONFIG_PVP_TOKEN_COUNT, 176 CONFIG_NO_RESET_TALENT_COST, 177 156 178 CONFIG_THREAT_RADIUS, 157 179 CONFIG_DECLINED_NAMES_USED, … … 458 480 bool IsScriptScheduled() const { return !m_scriptSchedule.empty(); } 459 481 482 static float PlayerStartGold() { return m_PlayerStartGold; } 483 460 484 // for max speed access 461 485 static float GetMaxVisibleDistanceForCreature() { return m_MaxVisibleDistanceForCreature; } … … 513 537 uint32 m_ShutdownMask; 514 538 539 static float m_PlayerStartGold; 540 515 541 // for max speed access 516 542 static float m_MaxVisibleDistanceForCreature; -
trunk/src/game/WorldSession.cpp
r28 r34 280 280 // give honor to all attackers from set like group case 281 281 for(std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr) 282 (*itr)->RewardHonor(_player, aset.size());282 (*itr)->RewardHonor(_player, aset.size(), -1, true); 283 283 284 284 // give bg rewards and update counters like kill by first from attackers