diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/BattleGround.h | 3 | ||||
-rw-r--r-- | src/game/BattleGroundAB.cpp | 9 | ||||
-rw-r--r-- | src/game/BattleGroundEY.cpp | 9 | ||||
-rw-r--r-- | src/game/BattleGroundWS.cpp | 9 | ||||
-rw-r--r-- | src/game/CharacterHandler.cpp | 58 | ||||
-rw-r--r-- | src/game/MiscHandler.cpp | 11 | ||||
-rw-r--r-- | src/game/ObjectMgr.cpp | 8 | ||||
-rw-r--r-- | src/game/Player.cpp | 83 | ||||
-rw-r--r-- | src/game/Player.h | 2 | ||||
-rw-r--r-- | src/game/World.cpp | 42 | ||||
-rw-r--r-- | src/game/World.h | 26 | ||||
-rw-r--r-- | src/game/WorldSession.cpp | 2 | ||||
-rw-r--r-- | src/trinitycore/Master.cpp | 5 | ||||
-rw-r--r-- | src/trinitycore/trinitycore.conf.dist | 109 | ||||
-rw-r--r-- | src/trinityrealm/AuthCodes.h | 2 | ||||
-rw-r--r-- | src/trinityrealm/AuthSocket.cpp | 10 | ||||
-rw-r--r-- | src/trinityrealm/trinityrealm.conf.dist | 18 |
17 files changed, 384 insertions, 22 deletions
diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h index 23cfe9721d0..0b54a521320 100644 --- a/src/game/BattleGround.h +++ b/src/game/BattleGround.h @@ -31,7 +31,8 @@ enum BattleGroundSounds { SOUND_HORDE_WINS = 8454, SOUND_ALLIANCE_WINS = 8455, - SOUND_BG_START = 3439 + SOUND_BG_START = 3439, + SOUND_BG_START_L70ETC = 11803, }; enum BattleGroundQuests diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp index b58c850d2c3..5c065bc644c 100644 --- a/src/game/BattleGroundAB.cpp +++ b/src/game/BattleGroundAB.cpp @@ -25,6 +25,7 @@ #include "ObjectMgr.h" #include "MapManager.h" #include "Language.h" +#include "World.h" #include "Util.h" BattleGroundAB::BattleGroundAB() @@ -107,7 +108,13 @@ void BattleGroundAB::Update(time_t diff) DoorOpen(BG_AB_OBJECT_GATE_A); DoorOpen(BG_AB_OBJECT_GATE_H); - PlaySoundToAll(SOUND_BG_START); + if(sWorld.getConfig(CONFIG_BG_START_MUSIC)) + { + PlaySoundToAll(SOUND_BG_START); + PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC + } + else + PlaySoundToAll(SOUND_BG_START); SetStatus(STATUS_IN_PROGRESS); for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGroundEY.cpp index 18b2645d25e..ac27df99355 100644 --- a/src/game/BattleGroundEY.cpp +++ b/src/game/BattleGroundEY.cpp @@ -25,6 +25,7 @@ #include "ObjectMgr.h" #include "MapManager.h" #include "Language.h" +#include "World.h" #include "Util.h" BattleGroundEY::BattleGroundEY() @@ -99,7 +100,13 @@ void BattleGroundEY::Update(time_t diff) SendMessageToAll(GetMangosString(LANG_BG_EY_BEGIN)); - PlaySoundToAll(SOUND_BG_START); + if(sWorld.getConfig(CONFIG_BG_START_MUSIC)) + { + PlaySoundToAll(SOUND_BG_START); + PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC + } + else + PlaySoundToAll(SOUND_BG_START); SetStatus(STATUS_IN_PROGRESS); for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp index 76ce4236cc0..6a64261b081 100644 --- a/src/game/BattleGroundWS.cpp +++ b/src/game/BattleGroundWS.cpp @@ -25,6 +25,7 @@ #include "Chat.h" #include "MapManager.h" #include "Language.h" +#include "World.h" BattleGroundWS::BattleGroundWS() { @@ -97,7 +98,13 @@ void BattleGroundWS::Update(time_t diff) SendMessageToAll(GetMangosString(LANG_BG_WS_BEGIN)); - PlaySoundToAll(SOUND_BG_START); + if(sWorld.getConfig(CONFIG_BG_START_MUSIC)) + { + PlaySoundToAll(SOUND_BG_START); + PlaySoundToAll(SOUND_BG_START_L70ETC); //MUSIC - Custom config + } + else + PlaySoundToAll(SOUND_BG_START); SetStatus(STATUS_IN_PROGRESS); for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index f6dc47e7b60..036de1e7399 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -732,6 +732,64 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) if(sWorld.IsShutdowning())
sWorld.ShutdownMsg(true,pCurrChar);
+ if(sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when logging in
+ pCurrChar->UpdateSkillsToMaxSkillsForLevel();
+
+ //ImpConfig - Check if player has logged in before
+ QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM has_logged_in_before WHERE guid = %u",pCurrChar->GetGUIDLow());
+ if(!result)
+ {
+ sLog.outBasic("Character '%s' logging in for first time, applying skills and stuff",pCurrChar->GetName());
+ CharacterDatabase.PExecute("INSERT INTO has_logged_in_before VALUES (%u)",pCurrChar->GetGUIDLow());
+
+ //Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way
+ if(sWorld.getConfig(CONFIG_START_ALL_REP))
+ {
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(942),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(935),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(936),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(1011),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(970),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(967),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(989),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(932),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(934),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(1038),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(1077),42999);
+
+ // Factions depending on team, like cities and some more stuff
+ switch(pCurrChar->GetTeam())
+ {
+ case ALLIANCE:
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(72),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(47),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(69),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(930),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(730),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(978),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(54),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(946),42999);
+ break;
+ case HORDE:
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(76),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(68),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(81),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(911),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(729),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(941),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(530),42999);
+ pCurrChar->SetFactionReputation(sFactionStore.LookupEntry(947),42999);
+ break;
+ }
+ }
+ }
+ else
+ sLog.outBasic("Character '%s' has logged in before",pCurrChar->GetName());
+
+ if(sWorld.getConfig(CONFIG_START_ALL_TAXI))
+ pCurrChar->SetTaxiCheater(true);
+
+
if(pCurrChar->isGameMaster())
SendNotification(LANG_GM_ON);
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index cb9a7cd673f..a618d83c15a 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -295,8 +295,8 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ ) return;
}
- //instant logout in taverns/cities or on taxi
- if(GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight())
+ //instant logout in taverns/cities or on taxi or if its enabled in mangosd.conf
+ if(GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() || sWorld.getConfig(CONFIG_INSTANT_LOGOUT))
{
LogoutPlayer(true);
return;
@@ -575,6 +575,13 @@ void WorldSession::HandleZoneUpdateOpcode( WorldPacket & recv_data ) if(newZone != _player->GetZoneId())
GetPlayer()->SendInitWorldStates(); // only if really enters to new zone, not just area change, works strange...
+ // AntiCheat.GMIsland
+ if(sWorld.getConfig(CONFIG_KICK_FROM_GMISLAND))
+ {
+ if(newZone == 876 && GetPlayer()->GetSession()->GetSecurity() == SEC_PLAYER)
+ _player->TeleportTo(13,0,0,0,0);
+ }
+
GetPlayer()->UpdateZone(newZone);
}
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 74a6a3ef684..b6f3f44834e 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -2081,6 +2081,12 @@ void ObjectMgr::LoadPlayerInfo() // 0 1 2 3
QueryResult *result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell");
+ QueryResult *result = NULL;
+ if(sWorld.getConfig(CONFIG_START_ALL_SPELLS))
+ result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom");
+ else
+ result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell");
+
uint32 count = 0;
if (!result)
@@ -2089,7 +2095,7 @@ void ObjectMgr::LoadPlayerInfo() sLog.outString();
sLog.outString( ">> Loaded %u player create spells", count );
- sLog.outErrorDb( "Error loading `playercreateinfo_spell` table or empty table.");
+ sLog.outErrorDb( "Error loading player starting spells or empty table.");
}
else
{
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 56e123f6e6f..acbcc9d3ca0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -578,7 +578,25 @@ bool Player::Create( uint32 guidlow, std::string name, uint8 race, uint8 class_, SetUInt32Value( PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0 );
// set starting level
- SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) );
+ if(GetSession()->GetSecurity() >= SEC_MODERATOR)
+ SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_GM_START_LEVEL) ); //ImpConfig
+ else
+ SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) );
+ // set starting gold
+ SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.PlayerStartGold()*10000 );
+
+ // set starting honor
+ SetUInt32Value( PLAYER_FIELD_HONOR_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_HONOR) );
+
+ // set starting arena pts
+ SetUInt32Value( PLAYER_FIELD_ARENA_CURRENCY, sWorld.getConfig(CONFIG_PLAYER_START_ARENAPTS) );
+
+ // start with every map explored
+ if(sWorld.getConfig(CONFIG_START_ALL_EXPLORED))
+ {
+ for (uint8 i=0; i<64; i++)
+ SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF);
+ }
// Played time
m_Last_tick = time(NULL);
@@ -754,8 +772,8 @@ void Player::HandleDrowning() if(!m_isunderwater)
return;
- //if have water breath , then remove bar
- if(waterbreath || isGameMaster() || !isAlive())
+ //if players is GM, have waterbreath, dead or breathing is disabled
+ if(sWorld.getConfig(CONFIG_DISABLE_BREATHING) || waterbreath || isGameMaster() || !isAlive())
{
StopMirrorTimer(BREATH_TIMER);
m_isunderwater = 0;
@@ -2128,6 +2146,9 @@ void Player::GiveLevel(uint32 level) UpdateAllStats();
+ if(sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up
+ UpdateSkillsToMaxSkillsForLevel();
+
// set current level health and mana/energy to maximum after applying all mods.
SetHealth(GetMaxHealth());
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
@@ -3601,6 +3622,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC CharacterDatabase.PExecute("DELETE FROM mail_items WHERE receiver = '%u'",guid);
CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u'",guid);
CharacterDatabase.PExecute("DELETE FROM character_pet_declinedname WHERE owner = '%u'",guid);
+ CharacterDatabase.PExecute("DELETE FROM has_logged_in_before WHERE guid = %u",guid);
CharacterDatabase.CommitTransaction();
//loginDatabase.PExecute("UPDATE realmcharacters SET numchars = numchars - 1 WHERE acctid = %d AND realmid = %d", accountId, realmID);
@@ -3725,7 +3747,7 @@ void Player::ResurrectPlayer(float restore_percent, bool updateToWorld, bool app // some items limited to specific map
DestroyZoneLimitedItem( true, GetZoneId());
- if(!applySickness || getLevel() <= 10)
+ if(sWorld.getConfig(CONFIG_DISABLE_RES_SICKNESS) || !applySickness || getLevel() <= 10)
return;
//Characters from level 1-10 are not affected by resurrection sickness.
@@ -5897,7 +5919,7 @@ void Player::UpdateHonorFields() ///Calculate the amount of honor gained based on the victim
///and the size of the group for which the honor is divided
///An exact honor value can also be given (overriding the calcs)
-bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor)
+bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvptoken)
{
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
if(GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
@@ -6016,6 +6038,42 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor) ModifyHonorPoints(int32(honor));
ApplyModUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, uint32(honor), true);
+
+ if( sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken )
+ {
+ if(!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
+ return true;
+
+ if(uVictim->GetTypeId() == TYPEID_PLAYER)
+ {
+ // Check if allowed to receive it in current map
+ uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
+ if(MapType == 1 && !InBattleGround() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) || MapType == 2 && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP) || MapType == 3 && !InBattleGround())
+ return true;
+
+ uint32 noSpaceForCount = 0;
+ uint32 itemId = sWorld.getConfig(CONFIG_PVP_TOKEN_ID);
+ int32 count = sWorld.getConfig(CONFIG_PVP_TOKEN_COUNT);
+
+ // check space and find places
+ ItemPosCountVec dest;
+ uint8 msg = CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount );
+ if( msg != EQUIP_ERR_OK ) // convert to possible store amount
+ count = noSpaceForCount;
+
+ if( count == 0 || dest.empty()) // can't add any
+ {
+ // -- TODO: Send to mailbox if no space
+ ChatHandler(this).PSendSysMessage("You don't have any space in your bags for a token.");
+ return true;
+ }
+
+ Item* item = StoreNewItem( dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
+ SendNewItem(item,count,true,false);
+ ChatHandler(this).PSendSysMessage("You have been awarded a token for slaying another player.");
+ }
+ }
+
return true;
}
@@ -6384,6 +6442,13 @@ void Player::DuelComplete(DuelCompleteType type) else if(duel->opponent->GetComboTarget()==GetPetGUID())
duel->opponent->ClearComboPoints();
+ // Honor points after duel (the winner) - ImpConfig
+ if(sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL > 0))
+ {
+ uint32 amount = sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL);
+ duel->opponent->RewardHonor(NULL,1,amount);
+ }
+
//cleanups
SetUInt64Value(PLAYER_DUEL_ARBITER, 0);
SetUInt32Value(PLAYER_DUEL_TEAM, 0);
@@ -7806,6 +7871,10 @@ void Player::SendTalentWipeConfirm(uint64 guid) WorldPacket data(MSG_TALENT_WIPE_CONFIRM, (8+4));
data << uint64(guid);
data << uint32(resetTalentsCost());
+ if(sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST))
+ data << uint32(0);
+ else
+ data << uint32(resetTalentsCost());
GetSession()->SendPacket( &data );
}
@@ -17895,7 +17964,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) continue; // member (alive or dead) or his corpse at req. distance
// honor can be in PvP and !PvP (racial leader) cases (for alive)
- if(pGroupGuy->isAlive() && pGroupGuy->RewardHonor(pVictim,count) && pGroupGuy==this)
+ if(pGroupGuy->isAlive() && pGroupGuy->RewardHonor(pVictim,count, -1, true) && pGroupGuy==this)
honored_kill = true;
// xp and reputation only in !PvP case
@@ -17933,7 +18002,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) xp = PvP ? 0 : MaNGOS::XP::Gain(this, pVictim);
// honor can be in PvP and !PvP (racial leader) cases
- if(RewardHonor(pVictim,1))
+ if(RewardHonor(pVictim,1, -1, true))
honored_kill = true;
// xp and reputation only in !PvP case
diff --git a/src/game/Player.h b/src/game/Player.h index b8c35e941f7..ea5f5e00d61 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1722,7 +1722,7 @@ class MANGOS_DLL_SPEC Player : public Unit /*********************************************************/
void UpdateArenaFields();
void UpdateHonorFields();
- bool RewardHonor(Unit *pVictim, uint32 groupsize, float honor = -1);
+ bool RewardHonor(Unit *pVictim, uint32 groupsize, float honor = -1, bool pvptoken = false);
uint32 GetHonorPoints() { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); }
uint32 GetArenaPoints() { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); }
void ModifyHonorPoints( int32 value );
diff --git a/src/game/World.cpp b/src/game/World.cpp index b195e394f36..90036e46cd1 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -62,6 +62,7 @@ INSTANTIATE_SINGLETON_1( World ); volatile bool World::m_stopEvent = false;
volatile uint32 World::m_worldLoopCounter = 0;
+float World::m_PlayerStartGold = 0; // starting gold
float World::m_MaxVisibleDistanceForCreature = DEFAULT_VISIBILITY_DISTANCE;
float World::m_MaxVisibleDistanceForPlayer = DEFAULT_VISIBILITY_DISTANCE;
float World::m_MaxVisibleDistanceForObject = DEFAULT_VISIBILITY_DISTANCE;
@@ -768,6 +769,47 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = sConfig.GetIntDefault("ListenRange.TextEmote", 25);
m_configs[CONFIG_LISTEN_RANGE_YELL] = sConfig.GetIntDefault("ListenRange.Yell", 300);
+ m_PlayerStartGold = sConfig.GetFloatDefault("PlayerStart.Gold", 0);
+ if(m_PlayerStartGold < 0)
+ m_PlayerStartGold = 0;
+
+ if(m_PlayerStartGold > MAX_MONEY_AMOUNT)
+ m_PlayerStartGold = MAX_MONEY_AMOUNT;
+
+ m_configs[CONFIG_PLAYER_START_HONOR] = sConfig.GetIntDefault("PlayerStart.HonorPoints", 0);
+ if(m_configs[CONFIG_PLAYER_START_HONOR] < 0)
+ m_configs[CONFIG_PLAYER_START_HONOR] = 0;
+
+ m_configs[CONFIG_PLAYER_START_ARENAPTS] = sConfig.GetIntDefault("PlayerStart.ArenaPoints", 0);
+ if(m_configs[CONFIG_PLAYER_START_ARENAPTS] < 0)
+ m_configs[CONFIG_PLAYER_START_ARENAPTS] = 0;
+
+ m_configs[CONFIG_GM_START_LEVEL] = sConfig.GetIntDefault("GamemasterStartLevel", 70);
+ if(m_configs[CONFIG_GM_START_LEVEL] < 1)
+ m_configs[CONFIG_GM_START_LEVEL] = 1;
+
+ m_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetBoolDefault("PlayerInstantLogout", false);
+ m_configs[CONFIG_BG_START_MUSIC] = sConfig.GetBoolDefault("MusicInBattleground", false);
+ m_configs[CONFIG_START_ALL_SPELLS] = sConfig.GetBoolDefault("PlayerStart.AllSpells", false);
+ // Leaving GM queue option out for now, it's not 100% functional with the ACE patch
+ //m_configs[CONFIG_QUEUE_FOR_GM] = sConfig.GetBoolDefault("EnableQueueForGMs", false);
+ m_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0);
+ if(m_configs[CONFIG_HONOR_AFTER_DUEL] < 0)
+ m_configs[CONFIG_HONOR_AFTER_DUEL]= 0;
+ m_configs[CONFIG_KICK_FROM_GMISLAND] = sConfig.GetBoolDefault("AntiCheat.GMIsland", false);
+ m_configs[CONFIG_START_ALL_EXPLORED] = sConfig.GetBoolDefault("PlayerStart.MapsExplored", false);
+ m_configs[CONFIG_DISABLE_BREATHING] = sConfig.GetBoolDefault("DisableWaterBreath", false);
+ m_configs[CONFIG_DISABLE_RES_SICKNESS] = sConfig.GetBoolDefault("DisableResurrectSickness", false);
+ m_configs[CONFIG_START_ALL_REP] = sConfig.GetBoolDefault("PlayerStart.AllReputation", false);
+ m_configs[CONFIG_ALWAYS_MAXSKILL] = sConfig.GetBoolDefault("AlwaysMaxWeaponSkill", false);
+ m_configs[CONFIG_START_ALL_TAXI] = sConfig.GetBoolDefault("PlayerStart.AllFlightPaths", false);
+ m_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfig.GetBoolDefault("PvPToken.Enable", false);
+ m_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfig.GetIntDefault("PvPToken.MapAllowType", 4);
+ m_configs[CONFIG_PVP_TOKEN_ID] = sConfig.GetIntDefault("PvPToken.ItemID", 29434);
+ m_configs[CONFIG_PVP_TOKEN_COUNT] = sConfig.GetIntDefault("PvPToken.ItemCount", 1);
+ if(m_configs[CONFIG_PVP_TOKEN_COUNT] < 1)
+ m_configs[CONFIG_PVP_TOKEN_COUNT] = 1;
+ m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false);
m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault("Arena.MaxRatingDifference", 0);
m_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfig.GetIntDefault("Arena.RatingDiscardTimer",300000);
diff --git a/src/game/World.h b/src/game/World.h index 8543c94648b..7c383f8baf7 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -153,6 +153,28 @@ enum WorldConfigs CONFIG_DEATH_SICKNESS_LEVEL,
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP,
CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE,
+
+ CONFIG_PLAYER_START_HONOR,
+ CONFIG_PLAYER_START_ARENAPTS,
+ CONFIG_GM_START_LEVEL,
+ CONFIG_INSTANT_LOGOUT,
+ CONFIG_BG_START_MUSIC,
+ CONFIG_START_ALL_SPELLS,
+ CONFIG_QUEUE_FOR_GM,
+ CONFIG_HONOR_AFTER_DUEL,
+ CONFIG_KICK_FROM_GMISLAND,
+ CONFIG_START_ALL_EXPLORED,
+ CONFIG_DISABLE_BREATHING,
+ CONFIG_DISABLE_RES_SICKNESS,
+ CONFIG_START_ALL_REP,
+ CONFIG_ALWAYS_MAXSKILL,
+ CONFIG_START_ALL_TAXI,
+ CONFIG_PVP_TOKEN_ENABLE,
+ CONFIG_PVP_TOKEN_MAP_TYPE,
+ CONFIG_PVP_TOKEN_ID,
+ CONFIG_PVP_TOKEN_COUNT,
+ CONFIG_NO_RESET_TALENT_COST,
+
CONFIG_THREAT_RADIUS,
CONFIG_DECLINED_NAMES_USED,
CONFIG_LISTEN_RANGE_SAY,
@@ -457,6 +479,8 @@ class World void ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target);
bool IsScriptScheduled() const { return !m_scriptSchedule.empty(); }
+ static float PlayerStartGold() { return m_PlayerStartGold; }
+
// for max speed access
static float GetMaxVisibleDistanceForCreature() { return m_MaxVisibleDistanceForCreature; }
static float GetMaxVisibleDistanceForPlayer() { return m_MaxVisibleDistanceForPlayer; }
@@ -512,6 +536,8 @@ class World uint32 m_ShutdownTimer;
uint32 m_ShutdownMask;
+ static float m_PlayerStartGold;
+
// for max speed access
static float m_MaxVisibleDistanceForCreature;
static float m_MaxVisibleDistanceForPlayer;
diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index b6585185eea..9a0265b823a 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -279,7 +279,7 @@ void WorldSession::LogoutPlayer(bool Save) // give honor to all attackers from set like group case
for(std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr)
- (*itr)->RewardHonor(_player,aset.size());
+ (*itr)->RewardHonor(_player, aset.size(), -1, true);
// give bg rewards and update counters like kill by first from attackers
// this can't be called for all attackers.
diff --git a/src/trinitycore/Master.cpp b/src/trinitycore/Master.cpp index de4b2c3e14f..ee42f16b87a 100644 --- a/src/trinitycore/Master.cpp +++ b/src/trinitycore/Master.cpp @@ -239,6 +239,11 @@ int Master::Run() // set server online loginDatabase.PExecute("UPDATE realmlist SET color = 0, population = 0 WHERE id = '%d'",realmID); + // Create table: has_logged_in_before - used for certain custom options + sLog.outBasic("ImpConfig: Creating/Checking table 'has_logged_in_before'..."); + CharacterDatabase.PExecute("CREATE TABLE IF NOT EXISTS `has_logged_in_before` (`guid` int(11) unsigned NOT NULL default '0', PRIMARY KEY (`guid`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='ImpConfig check';"); + sLog.outBasic("ImpConfig: Done..."); + #ifdef WIN32 if (sConfig.GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/) #else diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index 918f8503724..5eeacc53561 100644 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -1074,4 +1074,113 @@ Network.OutKBuff = -1 Network.OutUBuff = 65536 Network.TcpNodelay = 1 +################################################################################################################### +# CUSTOM SERVER OPTIONS +# +# PlayerStart.Gold +# Amount of gold that new players will start with. +# If you want to start with silver, use for example 0.1 (for 10s) +# Default: 0 +# +# PlayerStart.HonorPoints +# Amount of honor that new players will start with +# Default: 0 +# +# PlayerStart.ArenaPoints +# Amount of arena points that new players will start with +# Default: 0 +# +# PlayerStart.AllReputation +# Players will start with most of the high level reputations that are needed for items, mounts etc. +# If there are any reputation faction you want to be added, just tell me. +# +# PlayerStart.AllSpells +# If enabled, players will start with all their class spells (not talents). Useful for instant 70 servers. +# You must import playercreateinfo_spell_custom.sql, it's included in the SQL folder. +# Default: 0 - off +# 1 - on +# +# PlayerStart.MapsExplored +# Players will start with all maps explored if enabled +# +# PlayerStart.AllFlightPaths +# Players will start with all flight paths (Note: ALL flight paths, not only player's team) +# +# AntiCheat.GMIsland +# If a player enters GM island, he will get teleported away. This will prevent cheaters from buying GM stuff +# on servers with a GM mall. GM's will not get teleported away. +# +# GamemasterStartLevel +# GM starting level +# Default: 70 Min,max: 1 - 255 +# +# PlayerInstantLogout +# Enable or disable instant logout for all players (NOT in combat/while dueling/while falling) +# Default: 0 - off +# 1 - on +# +# MusicInBattleground +# If enabled, "L70ETC - Power of the horde" will be played when BG starts ;) +# +# EnableQueueForGMs +# NOTE: This option currently does not work due to ACE patch +# GMs will also be added to the login queue (not gmlvl 3+) if enabled. Useful for GM servers. +# Default: 0 - off +# 1 - on +# +# HonorPointsAfterDuel +# The amount of honor points the duel winner will get after a duel. +# Default: 0 - disable +# +# DisableWaterBreath +# Disable/enable waterbreathing for players +# +# DisableResurrectSickness +# Players wont get any resurrect sickness when speaking with a spirit healer if this is enabled+ +# +# AlwaysMaxWeaponSkill +# Players will automatically gain max weapon/defense skill when logging in, leveling up etc. +# +# PvPToken.Enable +# Enable/disable PvP Token System. Players will get a token after slaying another player that gives honor. +# +# PvPToken.MapAllowType +# Where players can receive the pvp token +# 4 - In all maps +# 3 - In battlegrounds only +# 2 - In FFA areas only (gurubashi arena etc) +# 1 - In battlegrounds AND FFA areas only +# +# PvPToken.ItemID +# The item players will get after killing someone if PvP Token system is enabled. +# Default: 29434 - Badge of justice +# +# PvPToken.ItemCount +# Modify the item ID count - Default: 1 +# +# NoResetTalentsCost +# Enable or disable no cost when reseting talents +# +################################################################################################################### +PlayerStart.Gold = 0 +PlayerStart.HonorPoints = 0 +PlayerStart.ArenaPoints = 0 +PlayerStart.AllReputation = 0 +PlayerStart.AllSpells = 0 +PlayerStart.MapsExplored = 0 +PlayerStart.AllFlightPaths = 0 +AntiCheat.GMIsland = 0 +GamemasterStartLevel = 70 +PlayerInstantLogout = 0 +MusicInBattleground = 0 +EnableQueueForGMs = 0 +HonorPointsAfterDuel = 0 +DisableWaterBreath = 0 +DisableResurrectSickness = 0 +AlwaysMaxWeaponSkill = 0 +PvPToken.Enable = 0 +PvPToken.MapAllowType = 4 +PvPToken.ItemID = 29434 +PvPToken.ItemCount = 1 +NoResetTalentsCost = 0 diff --git a/src/trinityrealm/AuthCodes.h b/src/trinityrealm/AuthCodes.h index 56a3077aae6..c33acc51c47 100644 --- a/src/trinityrealm/AuthCodes.h +++ b/src/trinityrealm/AuthCodes.h @@ -68,6 +68,6 @@ enum LoginResult // others will not and opposite // will only support WoW and WoW:TBC 2.4.3 client build 8606... -#define EXPECTED_MANGOS_CLIENT_BUILD {8606, 0} +//#define EXPECTED_MANGOS_CLIENT_BUILD {8606, 0} // - commented as builds are set in config #endif diff --git a/src/trinityrealm/AuthSocket.cpp b/src/trinityrealm/AuthSocket.cpp index 816a1d32538..0fd2726470d 100644 --- a/src/trinityrealm/AuthSocket.cpp +++ b/src/trinityrealm/AuthSocket.cpp @@ -369,13 +369,15 @@ bool AuthSocket::_HandleLogonChallenge() ///- Check if the client has one of the expected version numbers bool valid_version=false; - int accepted_versions[]=EXPECTED_MANGOS_CLIENT_BUILD; - for(int i=0;accepted_versions[i];i++) - if(ch->build==accepted_versions[i]) - { + int MinBuild = sConfig.GetIntDefault("MinBuild", 8606); + int MaxBuild = sConfig.GetIntDefault("MaxBuild", 8606); + + if(ch->build >= MinBuild && ch->build <= MaxBuild) valid_version=true; break; } + else + valid_version=false; /// <ul><li> if this is a valid version if(valid_version) diff --git a/src/trinityrealm/trinityrealm.conf.dist b/src/trinityrealm/trinityrealm.conf.dist index cd154951fd1..2ca543e4224 100644 --- a/src/trinityrealm/trinityrealm.conf.dist +++ b/src/trinityrealm/trinityrealm.conf.dist @@ -113,4 +113,20 @@ ProcessPriority = 1 RealmsStateUpdateDelay = 20 WrongPass.MaxCount = 0 WrongPass.BanTime = 600 -WrongPass.BanType = 0
\ No newline at end of file +WrongPass.BanType = 0 + +################################################################################################################### +# CLIENT BUILD OPTIONS +# +# Client Builds: +# +# MinBuild +# The minium client build allowed to connect +# +# MaxBuild +# The maximum client build allowed to connect +# +################################################################################################################### + +MinBuild = 8606 +MaxBuild = 8606 |