aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-30 20:05:36 -0600
committermegamage <none@none>2008-12-30 20:05:36 -0600
commitaa3b89d7764c093ba87ee2cf99775e3aedc37637 (patch)
treef6a403e42332dab84f77d7a611dc375083452875
parent05301f91b90fc029af6df5717a6b48f0e1759008 (diff)
parent12d4ce413e7b3b9d697b160bac6c918564b2fd1e (diff)
*Update to HG 714.
--HG-- branch : trunk
-rw-r--r--sql/updates/708_world_scripts.sql2
-rw-r--r--src/bindings/scripts/Makefile.am1
-rw-r--r--src/bindings/scripts/ScriptMgr.cpp3
-rw-r--r--src/bindings/scripts/VC71/71ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp195
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp58
-rw-r--r--src/game/GroupHandler.cpp10
-rw-r--r--src/game/Level0.cpp2
-rw-r--r--src/game/Map.cpp3
-rw-r--r--src/game/Object.cpp2
-rw-r--r--src/game/SpellAuras.cpp4
-rw-r--r--src/game/SpellEffects.cpp2
-rw-r--r--src/game/Unit.cpp12
-rw-r--r--src/game/Unit.h2
-rw-r--r--src/game/WaypointMovementGenerator.cpp25
-rw-r--r--src/game/WaypointMovementGenerator.h2
-rw-r--r--src/game/World.cpp20
-rw-r--r--src/game/World.h5
-rw-r--r--src/trinitycore/trinitycore.conf.dist11
21 files changed, 324 insertions, 47 deletions
diff --git a/sql/updates/708_world_scripts.sql b/sql/updates/708_world_scripts.sql
new file mode 100644
index 00000000000..7a297f42287
--- /dev/null
+++ b/sql/updates/708_world_scripts.sql
@@ -0,0 +1,2 @@
+UPDATE `creature_template` SET `ScriptName` = 'boss_shirrak_the_dead_watcher' WHERE `entry` = '18371';
+UPDATE `creature_template` SET `ScriptName` = 'mob_focus_fire', `unit_flags` = '33554434' WHERE `entry` = '18374'; \ No newline at end of file
diff --git a/src/bindings/scripts/Makefile.am b/src/bindings/scripts/Makefile.am
index 94a01ac23af..6c473cb8d4c 100644
--- a/src/bindings/scripts/Makefile.am
+++ b/src/bindings/scripts/Makefile.am
@@ -72,6 +72,7 @@ scripts/zone/alterac_mountains/alterac_mountains.cpp \
scripts/zone/arathi_highlands/arathi_highlands.cpp \
scripts/zone/ashenvale_forest/ashenvale.cpp\
scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp \
+scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp \
scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp \
scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp \
scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp \
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp
index 49a1dc79cc8..5d78d40030d 100644
--- a/src/bindings/scripts/ScriptMgr.cpp
+++ b/src/bindings/scripts/ScriptMgr.cpp
@@ -116,6 +116,8 @@ extern void AddSC_ashenvale();
//Aunchindoun
//--Auchenai Crypts
extern void AddSC_boss_exarch_maladaar();
+extern void AddSC_boss_shirrak_the_dead_watcher();
+
//--Mana Tombs
extern void AddSC_boss_nexusprince_shaffar();
extern void AddSC_boss_pandemonius();
@@ -1317,6 +1319,7 @@ void ScriptsInit()
//Aunchindoun
//--Auchenai Crypts
AddSC_boss_exarch_maladaar();
+ AddSC_boss_shirrak_the_dead_watcher();
//--Mana Tombs
AddSC_boss_nexusprince_shaffar();
diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
index 5d8da080d66..24b76d9d4cf 100644
--- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
@@ -1259,6 +1259,10 @@
RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Mana Tombs"
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index 60b74c03320..72e05948c9d 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -1436,6 +1436,10 @@
RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Mana Tombs"
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 9c8c7da5a93..996ccb6f6d2 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -1429,6 +1429,10 @@
RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp"
>
</File>
+ <File
+ RelativePath="..\scripts\zone\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Mana Tombs"
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
new file mode 100644
index 00000000000..afc161afed4
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
@@ -0,0 +1,195 @@
+/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* ScriptData
+Name: Boss_Shirrak_the_dead_watcher
+%Complete: 80
+Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented
+Category: Auchindoun, Auchenai Crypts
+EndScriptData */
+
+#include "precompiled.h"
+
+#define SPELL_INHABITMAGIC 32264
+#define SPELL_ATTRACTMAGIC 32265
+#define N_SPELL_CARNIVOROUSBITE 36383
+#define H_SPELL_CARNIVOROUSBITE 39382
+#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE)
+
+#define ENTRY_FOCUS_FIRE 18374
+
+#define N_SPELL_FIERY_BLAST 32302
+#define H_SPELL_FIERY_BLAST 38382
+#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST)
+#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual
+
+struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI
+{
+ boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c)
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ uint32 Inhabitmagic_Timer;
+ uint32 Attractmagic_Timer;
+ uint32 Carnivorousbite_Timer;
+ uint32 FocusFire_Timer;
+ bool HeroicMode;
+ Unit *focusedTarget;
+
+ void Reset()
+ {
+ Inhabitmagic_Timer = 3000;
+ Attractmagic_Timer = 28000;
+ Carnivorousbite_Timer = 10000;
+ FocusFire_Timer = 17000;
+ focusedTarget = NULL;
+ }
+
+ void Aggro(Unit *who)
+ { }
+
+ void JustSummoned(Creature *summoned)
+ {
+ if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE)
+ {
+ summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false);
+ summoned->setFaction(m_creature->getFaction());
+ summoned->SetLevel(m_creature->getLevel());
+ summoned->addUnitState(UNIT_STAT_ROOT);
+
+ if(focusedTarget)
+ summoned->AI()->AttackStart(focusedTarget);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //Inhabitmagic_Timer
+ if (Inhabitmagic_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_INHABITMAGIC);
+ Inhabitmagic_Timer = 2000+(rand()%2000);
+ }else Inhabitmagic_Timer -= diff;
+
+ //Attractmagic_Timer
+ if (Attractmagic_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_ATTRACTMAGIC);
+ Attractmagic_Timer = 30000;
+ }else Attractmagic_Timer -= diff;
+
+ //Carnivorousbite_Timer
+ if (Carnivorousbite_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_CARNIVOROUSBITE);
+ Carnivorousbite_Timer = 10000;
+ }else Carnivorousbite_Timer -= diff;
+
+ //FocusFire_Timer
+ if (FocusFire_Timer < diff)
+ {
+ // Summon Focus Fire & Emote
+ Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0);
+ if (target && target->GetTypeId() == TYPEID_PLAYER)
+ {
+ focusedTarget = target;
+ m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500);
+
+ // Emote
+ std::string *emote = new std::string("focuses his energy on ");
+ emote->append(target->GetName());
+ DoTextEmote(emote->c_str(),NULL,true);
+ delete emote;
+
+ FocusFire_Timer = 15000+(rand()%5000);
+ }
+ }else FocusFire_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature *_Creature)
+{
+ return new boss_shirrak_the_dead_watcherAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI
+{
+ mob_focus_fireAI(Creature *c) : ScriptedAI(c)
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
+
+ bool HeroicMode;
+ uint32 FieryBlast_Timer;
+ bool fiery1, fiery2, fiery3;
+
+ void Reset()
+ {
+ FieryBlast_Timer = 3000+(rand()%1000);
+ fiery1 = fiery2 = true;
+ }
+
+ void Aggro(Unit *who)
+ { }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
+ return;
+
+ //FieryBlast_Timer
+ if (fiery2 && FieryBlast_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_FIERY_BLAST);
+
+ if(fiery1) fiery1 = false;
+ else if(fiery2) fiery2 = false;
+
+ FieryBlast_Timer = 1000;
+ }else FieryBlast_Timer -= diff;
+
+ //DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_focus_fire(Creature *_Creature)
+{
+ return new mob_focus_fireAI (_Creature);
+}
+
+void AddSC_boss_shirrak_the_dead_watcher()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_shirrak_the_dead_watcher";
+ newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="mob_focus_fire";
+ newscript->GetAI = &GetAI_mob_focus_fire;
+ newscript->RegisterSelf();
+} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
index c566ab40230..f38b144da90 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Boss_Darkweaver_Syth
SD%Complete: 85
-SDComment: Shock spells/times need more work. Heroic not implemented.
+SDComment: Shock spells/times need more work. Heroic partly implemented.
SDCategory: Auchindoun, Sethekk Halls
EndScriptData */
@@ -34,30 +34,31 @@ EndScriptData */
#define SAY_DEATH -1556006
-#define SPELL_FROST_SHOCK 37865
+#define SPELL_FROST_SHOCK 21401 //37865
#define SPELL_FLAME_SHOCK 34354
#define SPELL_SHADOW_SHOCK 30138
#define SPELL_ARCANE_SHOCK 37132
-#define SPELL_CHAIN_LIGHTNING 39945
+#define SPELL_CHAIN_LIGHTNING 15659 //15305
#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203
#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205
#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204
#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206
-#define SPELL_FLAME_BUFFET 33526
-#define H_SPELL_FLAME_BUFFET 38141
-#define SPELL_ARCANE_BUFFET 33527
-#define H_SPELL_ARCANE_BUFFET 38138
-#define SPELL_FROST_BUFFET 33528
-#define H_SPELL_FROST_BUFFET 38142
-#define SPELL_SHADOW_BUFFET 33529
-#define H_SPELL_SHADOW_BUFFET 38143
+#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526)
+#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527)
+#define SPELL_FROST_BUFFET (HeroicMode?38142:33528)
+#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529)
struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI
{
- boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) {Reset();}
+ boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c)
+
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
uint32 flameshock_timer;
uint32 arcaneshock_timer;
@@ -68,6 +69,7 @@ struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI
bool summon90;
bool summon50;
bool summon10;
+ bool HeroicMode;
void Reset()
{
@@ -204,10 +206,16 @@ CreatureAI* GetAI_boss_darkweaver_syth(Creature *_Creature)
struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI
{
- mob_syth_fireAI(Creature *c) : ScriptedAI(c) {Reset();}
+ mob_syth_fireAI(Creature *c) : ScriptedAI(c)
+
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
uint32 flameshock_timer;
uint32 flamebuffet_timer;
+ bool HeroicMode;
void Reset()
{
@@ -250,10 +258,16 @@ CreatureAI* GetAI_mob_syth_fire(Creature *_Creature)
struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI
{
- mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) {Reset();}
+ mob_syth_arcaneAI(Creature *c) : ScriptedAI(c)
+
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
uint32 arcaneshock_timer;
uint32 arcanebuffet_timer;
+ bool HeroicMode;
void Reset()
{
@@ -296,10 +310,16 @@ CreatureAI* GetAI_mob_syth_arcane(Creature *_Creature)
struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI
{
- mob_syth_frostAI(Creature *c) : ScriptedAI(c) {Reset();}
+ mob_syth_frostAI(Creature *c) : ScriptedAI(c)
+
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
uint32 frostshock_timer;
uint32 frostbuffet_timer;
+ bool HeroicMode;
void Reset()
{
@@ -342,10 +362,16 @@ CreatureAI* GetAI_mob_syth_frost(Creature *_Creature)
struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI
{
- mob_syth_shadowAI(Creature *c) : ScriptedAI(c) {Reset();}
+ mob_syth_shadowAI(Creature *c) : ScriptedAI(c)
+
+ {
+ HeroicMode = m_creature->GetMap()->IsHeroic();
+ Reset();
+ }
uint32 shadowshock_timer;
uint32 shadowbuffet_timer;
+ bool HeroicMode;
void Reset()
{
diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp
index 9f807c2b525..ab6b8d4a939 100644
--- a/src/game/GroupHandler.cpp
+++ b/src/game/GroupHandler.cpp
@@ -721,8 +721,11 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
{
if(auramask & (uint64(1) << i))
{
- *data << uint32(player->GetVisibleAura(i));
+ uint32 updatedAura = player->GetVisibleAura(i);
+ *data << uint32(updatedAura);
*data << uint8(1);
+ if(!updatedAura)
+ player->UnsetAuraUpdateMask(i);
}
}
}
@@ -802,8 +805,11 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
{
if(auramask & (uint64(1) << i))
{
- *data << uint32(pet->GetVisibleAura(i));
+ uint32 updatedAura = pet->GetVisibleAura(i);
+ *data << uint32(updatedAura);
*data << uint8(1);
+ if(!updatedAura)
+ pet->UnsetAuraUpdateMask(i);
}
}
}
diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp
index db319215ded..75f7a257caf 100644
--- a/src/game/Level0.cpp
+++ b/src/game/Level0.cpp
@@ -93,6 +93,7 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
uint32 maxActiveClientsNum = sWorld.GetMaxActiveSessionCount();
uint32 maxQueuedClientsNum = sWorld.GetMaxQueuedSessionCount();
std::string str = secsToTimeString(sWorld.GetUptime());
+ uint32 updateTime = sWorld.GetUpdateTime();
PSendSysMessage(_FULLVERSION); //char const* full;
//if(m_session)
@@ -105,6 +106,7 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
//PSendSysMessage(LANG_USING_WORLD_DB,sWorld.GetDBVersion());
PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
PSendSysMessage(LANG_UPTIME, str.c_str());
+ PSendSysMessage("Update time diff: %u.", updateTime);
return true;
}
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index c1673b1082d..802b0f7feec 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -1778,7 +1778,8 @@ bool InstanceMap::Add(Player *player)
{
sLog.outError("InstanceMap::Add: player %s(%d) is being put in instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(pGroup->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
if(groupBind) sLog.outError("InstanceMap::Add: the group is bound to instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
- assert(false);
+ player->UnbindInstance(GetId(), GetSpawnMode());
+ //assert(false);
}
// bind to the group or keep using the group save
if(!groupBind)
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index e4e5230bfb6..a33cd1a7bd4 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1544,7 +1544,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
{
TemporarySummon* pCreature = new TemporarySummon(GetGUID());
- pCreature->SetInstanceId(GetInstanceId());
+ //pCreature->SetInstanceId(GetInstanceId());
uint32 team = 0;
if (GetTypeId()==TYPEID_PLAYER)
team = ((Player*)this)->GetTeam();
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index f5db41ed37f..fb4ea35f1fc 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -882,7 +882,7 @@ void Aura::_AddAura()
SendAuraUpdate(false);
// update for out of range group members
- m_target->UpdateAuraForGroup(slot, true);
+ m_target->UpdateAuraForGroup(slot);
}
}
else // use found slot
@@ -970,7 +970,7 @@ void Aura::_RemoveAura()
SendAuraUpdate(true);
// update for out of range group members
- m_target->UpdateAuraForGroup(slot, false);
+ m_target->UpdateAuraForGroup(slot);
if( IsSealSpell(GetSpellProto()) )
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT,false);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index e8c94e1a13a..76687a48711 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3907,7 +3907,7 @@ void Spell::EffectEnchantItemTmp(uint32 i)
// Shaman Rockbiter Weapon
if(i==0 && m_spellInfo->Effect[1]==SPELL_EFFECT_DUMMY)
{
- int32 enchnting_damage = m_currentBasePoints[1];//+1;
+ int32 enchnting_damage = damage;//+1;
// enchanting id selected by calculated damage-per-sec stored in Effect[1] base value
// with already applied percent bonus from Elemental Weapons talent
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 5721a708e3c..56284ca5f6b 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10675,7 +10675,7 @@ uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectT
return CastingTime;
}
-void Unit::UpdateAuraForGroup(uint8 slot, bool apply)
+void Unit::UpdateAuraForGroup(uint8 slot)
{
if(GetTypeId() == TYPEID_PLAYER)
{
@@ -10683,10 +10683,7 @@ void Unit::UpdateAuraForGroup(uint8 slot, bool apply)
if(player->GetGroup())
{
player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_AURAS);
- if(apply)
- player->SetAuraUpdateMask(slot);
- else
- player->UnsetAuraUpdateMask(slot);
+ player->SetAuraUpdateMask(slot);
}
}
else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
@@ -10698,10 +10695,7 @@ void Unit::UpdateAuraForGroup(uint8 slot, bool apply)
if(owner && (owner->GetTypeId() == TYPEID_PLAYER) && ((Player*)owner)->GetGroup())
{
((Player*)owner)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_AURAS);
- if(apply)
- pet->SetAuraUpdateMask(slot);
- else
- pet->UnsetAuraUpdateMask(slot);
+ pet->SetAuraUpdateMask(slot);
}
}
}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 71999202ff7..2aaa160dfc0 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1450,7 +1450,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void UpdateReactives(uint32 p_time);
// group updates
- void UpdateAuraForGroup(uint8 slot, bool apply);
+ void UpdateAuraForGroup(uint8 slot);
// pet auras
typedef std::set<PetAura const*> PetAuraSet;
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index adc4345fdfc..c4025d9de5e 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -107,7 +107,7 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
Traveller<Creature> traveller(u);
node = *(waypoints->at(i_currentNode));
InitTraveller(u,node);
- i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
+ i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
}*/
}
@@ -152,8 +152,9 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
{
if(StopedByPlayer)
{
- InitTraveller(unit,node);
- i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
+ assert(node);
+ InitTraveller(unit, *node);
+ i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
StopedByPlayer = false;
return true;
@@ -165,7 +166,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
i_currentNode = 0; //Start moving all over again
else
{
- unit.SetHomePosition(node.x, node.y, node.z, unit.GetOrientation());
+ unit.SetHomePosition(node->x, node->y, node->z, unit.GetOrientation());
unit.GetMotionMaster()->Initialize();
return false; //Clear the waypoint movement
}
@@ -173,24 +174,24 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
else
i_currentNode++;
- node = *(waypoints->at(i_currentNode));
- InitTraveller(unit,node);
- i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
+ node = waypoints->at(i_currentNode);
+ InitTraveller(unit, *node);
+ i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
}
else
{
//Determine waittime
- if(node.delay)
- i_nextMoveTime.Reset(node.delay);
+ if(node->delay)
+ i_nextMoveTime.Reset(node->delay);
- if(node.event_id && rand()%100 < node.event_chance)
- sWorld.ScriptsStart(sWaypointScripts, node.event_id, &unit, NULL);
+ if(node->event_id && rand()%100 < node->event_chance)
+ sWorld.ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL);
MovementInform(unit);
unit.UpdateWaypointID(i_currentNode);
unit.clearUnitState(UNIT_STAT_MOVING);
- unit.Relocate(node.x, node.y, node.z);
+ unit.Relocate(node->x, node->y, node->z);
}
}
else
diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h
index 99d111063de..899c55a5925 100644
--- a/src/game/WaypointMovementGenerator.h
+++ b/src/game/WaypointMovementGenerator.h
@@ -80,7 +80,7 @@ class TRINITY_DLL_SPEC WaypointMovementGenerator
MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; }
private:
- WaypointData node;
+ WaypointData *node;
uint32 path_id;
TimeTrackerSmall i_nextMoveTime;
WaypointPath *waypoints;
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 875a83bd4ff..fc7f113a3c2 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -112,6 +112,9 @@ World::World()
m_defaultDbcLocale = LOCALE_enUS;
m_availableDbcLocaleMask = 0;
+
+ m_updateTimeSum = 0;
+ m_updateTimeCount = 0;
}
/// World destructor
@@ -1021,6 +1024,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_PVP_TOKEN_COUNT] = 1;
m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false);
m_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfig.GetBoolDefault("ShowKickInWorld", false);
+ m_configs[CONFIG_INTERVAL_LOG_UPDATE] = sConfig.GetIntDefault("RecordUpdateTimeDiffInterval", 60000);
std::string forbiddenmaps = sConfig.GetStringDefault("ForbiddenMaps", "");
char * forbiddenMaps = new char[forbiddenmaps.length() + 1];
@@ -1450,6 +1454,22 @@ void World::DetectDBCLang()
/// Update the World !
void World::Update(time_t diff)
{
+ m_updateTime = uint32(diff);
+ if(m_configs[CONFIG_INTERVAL_LOG_UPDATE])
+ {
+ if(m_updateTimeSum > m_configs[CONFIG_INTERVAL_LOG_UPDATE])
+ {
+ sLog.outString("Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount());
+ m_updateTimeSum = m_updateTime;
+ m_updateTimeCount = 1;
+ }
+ else
+ {
+ m_updateTimeSum += m_updateTime;
+ ++m_updateTimeCount;
+ }
+ }
+
///- Update the different timers
for(int i = 0; i < WUPDATE_COUNT; i++)
if(m_timers[i].GetCurrent()>=0)
diff --git a/src/game/World.h b/src/game/World.h
index 3c3c67fe3e9..89a82545c64 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -203,6 +203,7 @@ enum WorldConfigs
CONFIG_PVP_TOKEN_COUNT,
CONFIG_NO_RESET_TALENT_COST,
CONFIG_SHOW_KICK_IN_WORLD,
+ CONFIG_INTERVAL_LOG_UPDATE,
CONFIG_VALUE_COUNT
};
@@ -414,6 +415,8 @@ class World
time_t const& GetGameTime() const { return m_gameTime; }
/// Uptime (in secs)
uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); }
+ /// Update time
+ uint32 GetUpdateTime() const { return m_updateTime; }
/// Get the maximum skill level a player can reach
uint16 GetConfigMaxSkillValue() const
@@ -531,6 +534,8 @@ class World
IntervalTimer m_timers[WUPDATE_COUNT];
uint32 mail_timer;
uint32 mail_timer_expires;
+ uint32 m_updateTime, m_updateTimeSum;
+ uint32 m_updateTimeCount;
typedef UNORDERED_MAP<uint32, Weather*> WeatherMap;
WeatherMap m_weathers;
diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist
index de93143c6ad..7855b616082 100644
--- a/src/trinitycore/trinitycore.conf.dist
+++ b/src/trinitycore/trinitycore.conf.dist
@@ -1251,12 +1251,20 @@ Ra.Secure = 1
# example: "538,90"
# Note that it's HIGHLY DISCOURAGED to forbid starting maps (0, 1, 530)!
#
-# ShowKickInWorld
+# ShowKickInWorld
# determines wether a message is broadcasted to the entire server when a player gets kicked
# Default: 0
# 1 = Enable
# 0 = Disable
#
+# RecordUpdateTimeDiffInterval
+# record update time diff to the log file
+# update diff can be used as a criterion of performance
+# diff < 300: good performance
+# diff > 600: bad performance, may be caused by high cpu usage
+# Default: 60000 (diff is written into log every 60000 ms or 1 minute.
+# >0 = Interval
+# 0 = Disable
###################################################################################################################
PlayerStart.AllReputation = 0
@@ -1271,3 +1279,4 @@ PvPToken.ItemID = 29434
PvPToken.ItemCount = 1
NoResetTalentsCost = 0
ShowKickInWorld = 0
+RecordUpdateTimeDiffInterval = 60000