aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/northrend/borean_tundra.cpp14
-rw-r--r--src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp2
-rw-r--r--src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp2
-rw-r--r--src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp3
-rw-r--r--src/game/CreatureAI.cpp5
-rw-r--r--src/game/CreatureAI.h2
-rw-r--r--src/game/Guild.cpp10
-rw-r--r--src/game/Guild.h2
-rw-r--r--src/game/GuildHandler.cpp8
-rw-r--r--src/game/InstanceSaveMgr.cpp4
-rw-r--r--src/game/Map.cpp8
-rw-r--r--src/game/PetAI.cpp7
-rw-r--r--src/game/Player.cpp15
-rw-r--r--src/game/Player.h2
-rw-r--r--src/game/SpellAuras.cpp69
-rw-r--r--src/game/SpellEffects.cpp33
-rw-r--r--src/game/SpellMgr.cpp4
-rw-r--r--src/game/Totem.cpp34
-rw-r--r--src/game/Unit.cpp13
-rw-r--r--src/game/World.cpp4
-rw-r--r--src/game/WorldLog.cpp2
-rw-r--r--src/trinitycore/trinitycore.conf.dist4
-rw-r--r--src/trinityrealm/AuthCodes.h3
-rw-r--r--src/trinityrealm/AuthSocket.cpp2
24 files changed, 127 insertions, 125 deletions
diff --git a/src/bindings/scripts/scripts/northrend/borean_tundra.cpp b/src/bindings/scripts/scripts/northrend/borean_tundra.cpp
index 0788c828ba2..39a785421da 100644
--- a/src/bindings/scripts/scripts/northrend/borean_tundra.cpp
+++ b/src/bindings/scripts/scripts/northrend/borean_tundra.cpp
@@ -369,19 +369,19 @@ bool GossipSelect_npc_keristrasza(Player* pPlayer, Creature* pCreature, uint32 u
enum
{
- SPELL_SUMMON_WYRMREST_SKYTALON = 61240,
+ SPELL_SUMMON_WYRMREST_SKYTALON = 61240,
SPELL_WYRMREST_SKYTALON_RIDE_PERIODIC = 61244,
- QUEST_ACES_HIGH = 13414
-
+ QUEST_ACES_HIGH_DAILY = 13414,
+ QUEST_ACES_HIGH = 13413
};
bool GossipHello_npc_corastrasza(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
-
- if (pPlayer->GetQuestStatus(QUEST_ACES_HIGH) == QUEST_STATUS_INCOMPLETE)
+
+ if (pPlayer->GetQuestStatus(QUEST_ACES_HIGH) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(QUEST_ACES_HIGH_DAILY) == QUEST_STATUS_INCOMPLETE) //It's the same dragon for both quests.
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_C_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
}
@@ -408,7 +408,7 @@ bool GossipSelect_npc_corastrasza(Player* pPlayer, Creature* pCreature, uint32 u
## npc_iruk
######*/
-#define GOSSIP_ITEM_I "Give me the Issliruk's Totem" // This is not offilike.
+#define GOSSIP_ITEM_I "<Search corpse for Issliruk's Totem.>"
enum
{
@@ -417,7 +417,7 @@ enum
SPELL_CREATURE_TOTEM_OF_ISSLIRUK = 46816,
- GOSSIP_TEXT_I = 12585 // This is blizzlike.
+ GOSSIP_TEXT_I = 12585
};
diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp
index 6504a5737eb..a39e76a24b6 100644
--- a/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp
+++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp
@@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL boss_four_horsemenAI : public BossAI
boss_four_horsemenAI(Creature *c) : BossAI(c, BOSS_HORSEMEN)
{
id = Horsemen(0);
- for(uint8 i = 1; i < 4; ++i)
+ for(uint8 i = 0; i < 4; ++i)
if (me->GetEntry() == MOB_HORSEMEN[i])
id = Horsemen(i);
caster = (id == HORSEMEN_LADY || id == HORSEMEN_SIR);
diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp
index 1088d585e18..c420cb1920d 100644
--- a/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp
+++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp
@@ -233,7 +233,7 @@ struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
std::istringstream loadStream(chrIn);
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];
- for(uint8 i = 1; i < NUMBER_OF_ENCOUNTERS; ++i)
+ for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; ++i)
{
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
index c74a11d5733..5405873b87c 100644
--- a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
+++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
@@ -122,6 +122,7 @@ struct TRINITY_DLL_DECL boss_ingvar_the_plundererAI : public ScriptedAI
m_creature->SetHealth(0);
m_creature->InterruptNonMeleeSpells(true);
m_creature->RemoveAllAuras();
+ m_creature->SetDisplayId(MODEL_INGVAR_UNDEAD);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
m_creature->GetMotionMaster()->MovementExpired(false);
m_creature->GetMotionMaster()->MoveIdle();
@@ -369,7 +370,7 @@ struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI
{
ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY);
//ingvar->CastSpell(ingvar,SPELL_INGVAR_TRANSFORM,false);
- ingvar->SetDisplayId(MODEL_INGVAR_UNDEAD); // Visual Hack - when he dies he becomes human model -> wrong
+ //ingvar->SetDisplayId(MODEL_INGVAR_UNDEAD); // Visual Hack - when he dies he becomes human model -> wrong
Creature* c_ingvar = ingvar;
CAST_AI(boss_ingvar_the_plundererAI, (c_ingvar->AI()))->StartZombiePhase();
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index a3a903c23a6..a846d392d4c 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -93,12 +93,13 @@ void CreatureAI::DoZoneInCombat(Creature* creature)
creature->AddThreat(pPlayer, 0.0f);
}
- for(Unit::ControlList::const_iterator itr = pPlayer->m_Controlled.begin(); itr != pPlayer->m_Controlled.end(); ++itr)
+ // TC2 commit 4821 / 9d0967884f0b, disabled (causes some NPCs to not regenerate HP):
+ /* for(Unit::ControlList::const_iterator itr = pPlayer->m_Controlled.begin(); itr != pPlayer->m_Controlled.end(); ++itr)
{
creature->SetInCombatWith(*itr);
(*itr)->SetInCombatWith(creature);
creature->AddThreat(*itr, 0.0f);
- }
+ } */
}
}
}
diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h
index 76aaa834756..791c4a96ca8 100644
--- a/src/game/CreatureAI.h
+++ b/src/game/CreatureAI.h
@@ -123,7 +123,7 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
// Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc)
//virtual void AttackedBy(Unit* attacker);
- virtual bool IsEscorted () {return false;}
+ virtual bool IsEscorted() {return false;}
// Called when creature is spawned or respawned (for reseting variables)
virtual void JustRespawned() { Reset(); }
diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index ddf94158275..92faebccad5 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -728,7 +728,7 @@ void Guild::Disband()
objmgr.RemoveGuild(m_Id);
}
-void Guild::Roster(WorldSession *session)
+void Guild::Roster(WorldSession *session /*= NULL*/)
{
// we can only guess size
WorldPacket data(SMSG_GUILD_ROSTER, (4+MOTD.length()+1+GINFO.length()+1+4+m_Ranks.size()*(4+4+GUILD_BANK_MAX_TABS*(4+4))+members.size()*50));
@@ -777,7 +777,10 @@ void Guild::Roster(WorldSession *session)
data << itr->second.OFFnote;
}
}
- session->SendPacket(&data);;
+ if (session)
+ session->SendPacket(&data);
+ else
+ BroadcastPacket(&data);
sLog.outDebug( "WORLD: Sent (SMSG_GUILD_ROSTER)" );
}
@@ -1085,7 +1088,7 @@ void Guild::DisplayGuildBankTabsInfo(WorldSession *session)
//data << uint32(0xFFFFFFFF); // bit 9 must be set for this packet to work
data << uint32(0);
data << uint8(1); // Tell Client this is a TabInfo packet
- data << uint8(m_PurchasedTabs); // here is the number of tabs
+ data << uint8(m_PurchasedTabs); // here is the number of tabs
for (uint8 i = 0; i < m_PurchasedTabs; ++i)
{
@@ -1975,7 +1978,6 @@ void Guild::SendGuildBankTabText(WorldSession *session, uint8 TabId)
session->SendPacket(&data);
else
BroadcastPacket(&data);
-
}
void Guild::SwapItems(Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankTabDst, uint8 BankTabSlotDst, uint32 SplitedAmount )
diff --git a/src/game/Guild.h b/src/game/Guild.h
index 549cdc0984a..0e70ed53fd0 100644
--- a/src/game/Guild.h
+++ b/src/game/Guild.h
@@ -376,7 +376,7 @@ class Guild
return NULL;
}
- void Roster(WorldSession *session);
+ void Roster(WorldSession *session = NULL); // NULL = broadcast
void Query(WorldSession *session);
void UpdateLogoutTime(uint64 guid);
diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp
index 2d5bd1b91b5..4b163c09e85 100644
--- a/src/game/GuildHandler.cpp
+++ b/src/game/GuildHandler.cpp
@@ -678,7 +678,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
guild->SetRankRights(rankId, rights);
guild->Query(this);
- guild->Roster(this);
+ guild->Roster(); // broadcast for tab rights update
}
void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
@@ -709,7 +709,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
guild->CreateRank(rankname, GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
guild->Query(this);
- guild->Roster(this);
+ guild->Roster(); // broadcast for tab rights update
}
void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
@@ -735,7 +735,7 @@ void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
guild->DelRank();
guild->Query(this);
- guild->Roster(this);
+ guild->Roster(); // broadcast for tab rights update
}
void WorldSession::SendGuildCommandResult(uint32 typecmd, const std::string& str,uint32 cmdresult)
@@ -1185,7 +1185,7 @@ void WorldSession::HandleGuildBankBuyTab( WorldPacket & recv_data )
GetPlayer()->ModifyMoney(-int(TabCost));
pGuild->SetBankMoneyPerDay(GetPlayer()->GetRank(), WITHDRAW_MONEY_UNLIMITED);
pGuild->SetBankRightsAndSlots(GetPlayer()->GetRank(), TabId, GUILD_BANK_RIGHT_FULL, WITHDRAW_SLOT_UNLIMITED, true);
- pGuild->Roster(this);
+ pGuild->Roster(); // broadcast for tab rights update
pGuild->DisplayGuildBankTabsInfo(this);
}
diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp
index 2c3161e2faf..f0df28c5c17 100644
--- a/src/game/InstanceSaveMgr.cpp
+++ b/src/game/InstanceSaveMgr.cpp
@@ -648,6 +648,10 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe
uint64 next_reset = ((now + timeLeft + MINUTE) / DAY * DAY) + period + diff;
// update it in the DB
CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%d'", next_reset, mapid);
+
+ // schedule next reset.
+ m_resetTimeByMapId[mapid] = (time_t) next_reset;
+ ScheduleReset(true, (time_t) next_reset, InstResetEvent(1, mapid));
}
MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps();
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 4c6dbba2e90..390efda1002 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -1081,7 +1081,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll)
delete GridMaps[gx][gy];
}
// x and y are swapped
- VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gy, gx);
+ VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gx, gy);
}
else
((MapInstanced*)m_parentMap)->RemoveGridMapReference(GridPair(gx, gy));
@@ -1760,7 +1760,7 @@ uint16 Map::GetAreaFlag(float x, float y, float z) const
// The Violet Hold (Dalaran), fast check
if (x < 5791.0f && y > 404.0f && y < 595.0f)
- {
+ {
areaflag = 2540;
break;
}
@@ -1788,14 +1788,14 @@ uint16 Map::GetAreaFlag(float x, float y, float z) const
// The Eventide (Dalaran), fast check against diagonal box with lower limit
if (z > 635.0f && x+y < 6375.0f && x+y > 6295.0f && x-y < 5106.0f && x-y > 4972.0f)
- {
+ {
areaflag = 2543;
break;
}
// The Violet Hold (Dalaran), fast check
if (x < 5791.0f && y > 404.0f && y < 595.0f)
- {
+ {
areaflag = 2540;
break;
}
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index bf368001cc1..18bde7dde2e 100644
--- a/src/game/PetAI.cpp
+++ b/src/game/PetAI.cpp
@@ -272,8 +272,11 @@ void PetAI::KilledUnit(Unit *victim)
return;
// Clear target just in case. May help problem where health / focus / mana
- // regen gets stuck. Also resets attack command.
- _stopAttack();
+ // regen gets stuck. Also resets attack command.
+ // Can't use _stopAttack() because that activates movement handlers and ignores
+ // next target selection
+ me->AttackStop();
+ me->GetCharmInfo()->SetIsCommandAttack(false);
Unit *nextTarget = SelectNextTarget();
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 43a98ddc7b4..a110f64dc5a 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -585,8 +585,11 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
SetUInt32Value(UNIT_FIELD_BYTES_0, ( RaceClassGender | ( powertype << 24 ) ) );
InitDisplayIds();
- SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP );
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE );
+ if(sWorld.getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld.getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP)
+ {
+ SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP );
+ SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE );
+ }
SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER);
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); // fix cast time showed in spell tooltip on client
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f); // default for players in 3.0.3
@@ -5291,7 +5294,7 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step)
if ((!max) || (!value) || (value >= max))
return false;
- if (value*512 < max*urand(0,512))
+ if (value < max)
{
uint32 new_value = value+step;
if(new_value > max)
@@ -5510,7 +5513,7 @@ void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool de
if(!defence)
{
if(getClass() == CLASS_WARRIOR || getClass() == CLASS_ROGUE)
- chance *= 0.1f * GetStat(STAT_INTELLECT);
+ chance += chance * 0.02f * GetStat(STAT_INTELLECT);
}
chance = chance < 1.0f ? 1.0f : chance; //minimum chance to increase skill is 1%
@@ -18465,9 +18468,9 @@ void Player::UpdatePvPState(bool onlyFFA)
}
}
-void Player::UpdatePvP(bool state, bool ovrride)
+void Player::UpdatePvP(bool state, bool override)
{
- if(!state || ovrride)
+ if(!state || override)
{
SetPvP(state);
pvpInfo.endTimer = 0;
diff --git a/src/game/Player.h b/src/game/Player.h
index ec58459bea0..43533743879 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1582,7 +1582,7 @@ class MANGOS_DLL_SPEC Player : public Unit
for(ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
(*itr)->SetPvP(state);
}
- void UpdatePvP(bool state, bool ovrride=false);
+ void UpdatePvP(bool state, bool override=false);
void UpdateZone(uint32 newZone,uint32 newArea);
void UpdateArea(uint32 newArea);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index d30d0adee11..34a3ea2347d 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1023,6 +1023,20 @@ void Aura::HandleAuraSpecificMods(bool apply)
caster->CastCustomSpell(m_target, 63675, &basepoints0, NULL, NULL, true, NULL, GetPartAura(0));
}
}
+ // Renew
+ else if (GetSpellProto()->SpellFamilyFlags[0] & 0x00000040 && GetPartAura(0))
+ {
+ Unit * caster = GetCaster();
+ if (!caster)
+ return;
+
+ // Empowered Renew
+ if (AuraEffect const * aurEff = caster->GetDummyAura(SPELLFAMILY_PRIEST, 3021, 1))
+ {
+ int32 basepoints0 = aurEff->GetAmount() * GetPartAura(0)->GetTotalTicks() * caster->SpellHealingBonus(m_target, GetSpellProto(), GetPartAura(0)->GetAmount(), HEAL) / 100;
+ caster->CastCustomSpell(m_target, 63544, &basepoints0, NULL, NULL, true, NULL, GetPartAura(0));
+ }
+ }
}
else if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_ROGUE)
{
@@ -3381,34 +3395,10 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun
{
// remove movement affects
m_target->RemoveMovementImpairingAuras();
-/*
- m_target->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
- Unit::AuraList const& slowingAuras = m_target->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
- for (Unit::AuraList::const_iterator iter = slowingAuras.begin(); iter != slowingAuras.end();)
- {
- SpellEntry const* aurSpellInfo = (*iter)->GetSpellProto();
-
- uint32 aurMechMask = GetAllSpellMechanicMask(aurSpellInfo);
-
- // If spell that caused this aura has Croud Control or Daze effect
- if((aurMechMask & MECHANIC_NOT_REMOVED_BY_SHAPESHIFT) ||
- // some Daze spells have these parameters instead of MECHANIC_DAZE (skip snare spells)
- aurSpellInfo->SpellIconID == 15 && aurSpellInfo->Dispel == 0 && (aurMechMask & (1 << MECHANIC_SNARE))==0)
- {
- ++iter;
- continue;
- }
-
- // All OK, remove aura now
- m_target->RemoveAurasDueToSpellByCancel(aurSpellInfo->Id);
- iter = slowingAuras.begin();
- }
-*/
// and polymorphic affects
if(m_target->IsPolymorphed())
m_target->RemoveAurasDueToSpell(m_target->getTransForm());
-
break;
}
default:
@@ -3428,6 +3418,7 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun
if(PowerType != POWER_MANA)
{
+ uint32 oldVal = m_target->GetPower(PowerType);
// reset power to default values only at power change
if(m_target->getPowerType()!=PowerType)
m_target->setPowerType(PowerType);
@@ -3445,11 +3436,8 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun
if (GetMiscValue() == FORM_CAT)
{
- if(m_target->GetPower(POWER_ENERGY) > FurorChance)
- {
- m_target->SetPower(POWER_ENERGY, 0);
- m_target->CastCustomSpell(m_target,17099,&FurorChance,NULL,NULL,true,NULL,this);
- }
+ int32 basePoints = (FurorChance < oldVal ? FurorChance : oldVal);
+ m_target->CastCustomSpell(m_target,17099,&basePoints,NULL,NULL,true,NULL,this);
}
else
{
@@ -3640,26 +3628,27 @@ void AuraEffect::HandleAuraTransform(bool apply, bool Real, bool /*changeAmount*
CreatureInfo const * ci = objmgr.GetCreatureTemplate(GetMiscValue());
if(!ci)
{
- //pig pink ^_^
- m_target->SetDisplayId(16358);
+ m_target->SetDisplayId(16358); // pig pink ^_^
sLog.outError("Auras: unknown creature id = %d (only need its modelid) Form Spell Aura Transform in Spell ID = %d", GetMiscValue(), GetId());
}
else
{
- // Will use the default model here
- if (uint32 modelid = ci->GetRandomValidModelId())
- m_target->SetDisplayId(modelid);
+ uint32 model_id;
- // Dragonmaw Illusion (set mount model also)
- if(GetId()==42016 && m_target->GetMountID() && !m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty())
- m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
+ if (uint32 modelid = ci->GetRandomValidModelId())
+ model_id = modelid; // Will use the default model here
// Polymorph (sheep)
if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellProto()->SpellIconID == 82 && GetSpellProto()->SpellVisual[0] == 12978)
if (Unit * caster = GetCaster())
- // Glyph of the Penguin
- if (caster->HasAura(52648))
- m_target->SetDisplayId(26452);
+ if (caster->HasAura(52648)) // Glyph of the Penguin
+ model_id = 26452;
+
+ m_target->SetDisplayId(model_id);
+
+ // Dragonmaw Illusion (set mount model also)
+ if(GetId()==42016 && m_target->GetMountID() && !m_target->GetAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty())
+ m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
}
}
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 35db1b0cc04..e0e84b7c2bb 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5345,6 +5345,39 @@ void Spell::EffectScriptEffect(uint32 effIndex)
((TempSummon*)m_caster)->UnSummon();
return;
}
+ // Stoneclaw Totem
+ case 55328: // Rank 1
+ case 55329: // Rank 2
+ case 55330: // Rank 3
+ case 55332: // Rank 4
+ case 55333: // Rank 5
+ case 55335: // Rank 6
+ case 55278: // Rank 7
+ case 58589: // Rank 8
+ case 58590: // Rank 9
+ case 58591: // Rank 10
+ {
+ int32 basepoints0 = damage;
+ // Cast Absorb on totems
+ for(uint8 slot = SUMMON_SLOT_TOTEM; slot < MAX_TOTEM_SLOT; ++slot)
+ {
+ if(!unitTarget->m_SummonSlot[slot])
+ continue;
+
+ Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_SummonSlot[slot]);
+ if(totem && totem->isTotem())
+ {
+ m_caster->CastCustomSpell(totem, 55277, &basepoints0, NULL, NULL, true);
+ }
+ }
+ // Glyph of Stoneclaw Totem
+ if (AuraEffect *aur=unitTarget->GetAuraEffect(63298, 0))
+ {
+ basepoints0 *= aur->GetAmount();
+ m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, NULL, NULL, true);
+ }
+ break;
+ }
}
break;
}
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index b82343111a3..0500432f3e3 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1233,7 +1233,7 @@ void SpellMgr::LoadSpellTargetPositions()
if(found)
{
if(!spellmgr.GetSpellTargetPosition(i))
- sLog.outDetail("Spell (ID: %u) does not have record in `spell_target_position`", i);
+ sLog.outDebug("Spell (ID: %u) does not have record in `spell_target_position`", i);
}
}
@@ -2057,7 +2057,7 @@ void SpellMgr::LoadSpellScriptTarget()
{
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(i);
if(bounds.first==bounds.second)
- sLog.outDetail("Spell (ID: %u) does not have record in `spell_script_target`", i);
+ sLog.outDebug("Spell (ID: %u) does not have record in `spell_script_target`", i);
}
}
diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp
index 0b621e56edf..885f1bfaeee 100644
--- a/src/game/Totem.cpp
+++ b/src/game/Totem.cpp
@@ -90,39 +90,7 @@ void Totem::InitSummon()
SendMessageToSet(&data, true);
if(m_type == TOTEM_PASSIVE)
- CastSpell(this, GetSpell(), true);
-
- // Stoneclaw Totem
- case 55328: // Rank 1
- case 55329: // Rank 2
- case 55330: // Rank 3
- case 55332: // Rank 4
- case 55333: // Rank 5
- case 55335: // Rank 6
- case 55278: // Rank 7
- case 58589: // Rank 8
- case 58590: // Rank 9
- case 58591: // Rank 10
- {
- int32 basepoints0 = damage;
- // Cast Absorb on totems
- for(uint8 slot = SUMMON_SLOT_TOTEM; slot < MAX_TOTEM_SLOT; ++slot)
- {
- if(!unitTarget->m_SummonSlot[slot])
- continue;
-
- Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_SummonSlot[slot]);
- if(totem && totem->isTotem())
- m_caster->CastCustomSpell(totem, 55277, &basepoints0, NULL, NULL, true);
- }
- // Glyph of Stoneclaw Totem
- if (AuraEffect *aur=unitTarget->GetAuraEffect(63298, 0))
- {
- basepoints0 *= aur->GetAmount();
- m_caster->CastCustomSpell(unitTarget, 55277, &basepoints0, NULL, NULL, true);
- }
- break;
- }
+ CastSpell(this, GetSpell(), true);
// Some totems can have both instant effect and passive spell
if (GetSpell(1))
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 6424d918983..d37aa91373a 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7917,8 +7917,7 @@ void Unit::setPowerType(Powers new_powertype)
break;
case POWER_ENERGY:
SetMaxPower(POWER_ENERGY,GetCreatePowers(POWER_ENERGY));
- if(getClass() != CLASS_DRUID)
- SetPower( POWER_ENERGY,0);
+ SetPower( POWER_ENERGY,0);
break;
case POWER_HAPPINESS:
SetMaxPower(POWER_HAPPINESS,GetCreatePowers(POWER_HAPPINESS));
@@ -10529,9 +10528,9 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
if(GetTypeId() != TYPEID_PLAYER)
{
// Set home position at place of engaging combat for escorted creatures
- if(((Creature*)this)->IsAIEnabled)
- if (((Creature *)this)->AI()->IsEscorted())
- ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ if((((Creature*)this)->IsAIEnabled && ((Creature*)this)->AI()->IsEscorted()) || ((Creature*)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
+ ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+
if(enemy)
{
if(((Creature*)this)->IsAIEnabled)
@@ -12593,8 +12592,8 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
((Player*)this)->UpdateCombatSkills(pTarget, attType, isVictim);
}
// Update defence if player is victim and parry/dodge/block
- if (isVictim && procExtra&(PROC_EX_DODGE|PROC_EX_PARRY|PROC_EX_BLOCK))
- ((Player*)this)->UpdateDefense();
+ else if (isVictim && procExtra&(PROC_EX_DODGE|PROC_EX_PARRY|PROC_EX_BLOCK))
+ ((Player*)this)->UpdateCombatSkills(pTarget, attType, MELEE_HIT_DODGE);
}
// If exist crit/parry/dodge/block need update aura state (for victim and attacker)
if (procExtra & (PROC_EX_CRITICAL_HIT|PROC_EX_PARRY|PROC_EX_DODGE|PROC_EX_BLOCK))
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 4b1c54ff9f9..6d264cb049c 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1600,8 +1600,8 @@ void World::SetInitialWorldSettings()
sprintf( isoDate, "%04d-%02d-%02d %02d:%02d:%02d",
local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec);
- loginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime) VALUES('%u', " UI64FMTD ", '%s', 0)",
- realmID, uint64(m_startTime), isoDate);
+ loginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime, revision) VALUES('%u', " UI64FMTD ", '%s', 0, '%s')",
+ realmID, uint64(m_startTime), isoDate, _FULLVERSION);
static uint32 abtimer = 0;
abtimer = sConfig.GetIntDefault("AutoBroadcast.Timer", 60000);
diff --git a/src/game/WorldLog.cpp b/src/game/WorldLog.cpp
index 978514ac7d7..435e3279948 100644
--- a/src/game/WorldLog.cpp
+++ b/src/game/WorldLog.cpp
@@ -31,8 +31,6 @@
INSTANTIATE_SINGLETON_2(WorldLog, CLASS_LOCK);
INSTANTIATE_CLASS_MUTEX(WorldLog, ACE_Thread_Mutex);
-#define WORLD_LOG_FILE_STRING "world.log"
-
WorldLog::WorldLog() : i_file(NULL)
{
Initialize();
diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist
index ae8ad473a37..2caeae3e33a 100644
--- a/src/trinitycore/trinitycore.conf.dist
+++ b/src/trinitycore/trinitycore.conf.dist
@@ -1,7 +1,7 @@
##########################################
# Trinity Core worldd configuration file #
##########################################
-ConfVersion=2009091201
+ConfVersion=2009091601
###################################################################################################################
# CONNECTIONS AND DIRECTORIES
@@ -431,7 +431,7 @@ RaLogFile = "ra_commands.log"
ArenaLogFile = ""
LogColors = ""
EnableLogDB = 0
-DBLogLevel = 1
+DBLogLevel = 2
LogDB.Char = 0
LogDB.GM = 0
LogDB.RA = 0
diff --git a/src/trinityrealm/AuthCodes.h b/src/trinityrealm/AuthCodes.h
index 4781883e278..73728898503 100644
--- a/src/trinityrealm/AuthCodes.h
+++ b/src/trinityrealm/AuthCodes.h
@@ -71,7 +71,8 @@ enum LoginResult
//1.12.2 build 6005
//2.4.3 build 8606
//3.1.3 build 9947
+//3.1.3 build 10146 Chinese build
-#define EXPECTED_TRINITY_CLIENT_BUILD {9947, 8606, 5875, 6005, 0}
+#define EXPECTED_TRINITY_CLIENT_BUILD {10146, 9947, 8606, 5875, 6005, 0}
#endif
diff --git a/src/trinityrealm/AuthSocket.cpp b/src/trinityrealm/AuthSocket.cpp
index 1e0f2da2024..60a55be77f3 100644
--- a/src/trinityrealm/AuthSocket.cpp
+++ b/src/trinityrealm/AuthSocket.cpp
@@ -706,7 +706,7 @@ bool AuthSocket::_HandleLogonProof()
sha.UpdateBigNumbers(&A, &M, &K, NULL);
sha.Finalize();
- if(_build == 8606 || _build == 9947)//2.4.3 and 3.1.3 cliens
+ if(_build == 8606 || _build == 9947 || _build == 10146)//2.4.3 and 3.1.3 clients (10146 is Chinese build for 3.1.3)
{
sAuthLogonProof_S proof;
memcpy(proof.M2, sha.GetDigest(), 20);