Merge branch 'master' of github.com:TrinityCore/TrinityCore

This commit is contained in:
Manuel
2011-01-16 15:13:22 -03:00
33 changed files with 197 additions and 148 deletions
+4 -1
View File
@@ -1847,7 +1847,10 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 72089, 'spell_marrowgar_bone_spike_graveyard'),
( 69140, 'spell_marrowgar_coldflame'),
( 72705, 'spell_marrowgar_coldflame'),
( 69147, 'spell_marrowgar_coldflame_trigger'),
( 69146, 'spell_marrowgar_coldflame_damage'),
( 70823, 'spell_marrowgar_coldflame_damage'),
( 70824, 'spell_marrowgar_coldflame_damage'),
( 70825, 'spell_marrowgar_coldflame_damage');
( 69075, 'spell_marrowgar_bone_storm'),
( 70834, 'spell_marrowgar_bone_storm'),
( 70835, 'spell_marrowgar_bone_storm'),
@@ -0,0 +1,7 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_marrowgar_coldflame_trigger';
DELETE FROM `spell_script_names` WHERE `spell_id` IN (69146,70823,70824,70825) AND `ScriptName`='spell_marrowgar_coldflame_damage';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(69146,'spell_marrowgar_coldflame_damage'),
(70823,'spell_marrowgar_coldflame_damage'),
(70824,'spell_marrowgar_coldflame_damage'),
(70825,'spell_marrowgar_coldflame_damage');
@@ -1231,8 +1231,8 @@ void CreatureEventAI::DoFindFriendlyMissingBuff(std::list<Creature*>& _list, flo
cell.Visit(p, grid_creature_searcher, *me->GetMap());
}
//*********************************
//*** Functions used globally ***
// *********************************
// *** Functions used globally ***
void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target)
{
@@ -45,9 +45,9 @@ struct ScriptedAI : public CreatureAI
explicit ScriptedAI(Creature* pCreature);
virtual ~ScriptedAI() {}
//*************
// *************
//CreatureAI Functions
//*************
// *************
void AttackStartNoMove(Unit *pTarget);
@@ -81,9 +81,9 @@ struct ScriptedAI : public CreatureAI
// Called when AI is temporarily replaced or put back when possess is applied or removed
void OnPossess(bool /*apply*/) {}
//*************
// *************
// Variables
//*************
// *************
//Pointer to creature we are manipulating
Creature* me;
@@ -91,9 +91,9 @@ struct ScriptedAI : public CreatureAI
//For fleeing
bool IsFleeing;
//*************
// *************
//Pure virtual functions
//*************
// *************
//Called at creature reset either by death or evade
void Reset() {}
@@ -101,9 +101,9 @@ struct ScriptedAI : public CreatureAI
//Called at creature aggro either by MoveInLOS or Attack Start
void EnterCombat(Unit* /*who*/) {}
//*************
// *************
//AI Helper Functions
//*************
// *************
//Start movement toward victim
void DoStartMovement(Unit* pVictim, float fDistance = 0, float fAngle = 0);
+1 -1
View File
@@ -2374,7 +2374,7 @@ bool ChatHandler::HandleChangeWeather(const char *args)
return false;
}
//*Change the weather of a cell
// *Change the weather of a cell
char* px = strtok((char*)args, " ");
char* py = strtok(NULL, " ");
+3 -3
View File
@@ -22492,9 +22492,9 @@ bool ItemPosCount::isContainedIn(ItemPosCountVec const& vec) const
return false;
}
//***********************************
//-------------TRINITY---------------
//***********************************
// ***********************************
// -------------TRINITY---------------
// ***********************************
void Player::StopCastingBindSight()
{
@@ -180,8 +180,11 @@ Transport::Transport(uint32 period, uint32 script) : GameObject(), m_period(peri
Transport::~Transport()
{
for (CreatureSet::iterator itr = m_NPCPassengerSet.begin(); itr != m_NPCPassengerSet.end();)
(*(itr++))->ForcedDespawn();
for (CreatureSet::iterator itr = m_NPCPassengerSet.begin(); itr != m_NPCPassengerSet.end(); ++itr)
{
(*itr)->SetTransport(NULL);
GetMap()->AddObjectToRemoveList(*itr);
}
m_NPCPassengerSet.clear();
+9 -5
View File
@@ -45,11 +45,6 @@ ObjectAccessor::ObjectAccessor()
ObjectAccessor::~ObjectAccessor()
{
for (Player2CorpsesMapType::const_iterator itr = i_player2corpse.begin(); itr != i_player2corpse.end(); ++itr)
{
itr->second->RemoveFromWorld();
delete itr->second;
}
}
WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, uint64 guid)
@@ -385,6 +380,15 @@ void ObjectAccessor::Update(uint32 /*diff*/)
}
}
void ObjectAccessor::UnloadAll()
{
for (Player2CorpsesMapType::const_iterator itr = i_player2corpse.begin(); itr != i_player2corpse.end(); ++itr)
{
itr->second->RemoveFromWorld();
delete itr->second;
}
}
/// Define the static members of HashMapHolder
template <class T> UNORDERED_MAP< uint64, T* > HashMapHolder<T>::m_objectMap;
+5
View File
@@ -40,6 +40,7 @@ class DynamicObject;
class WorldObject;
class Vehicle;
class Map;
class WorldRunnable;
template <class T>
class HashMapHolder
@@ -84,6 +85,7 @@ class HashMapHolder
class ObjectAccessor
{
friend class ACE_Singleton<ObjectAccessor, ACE_Thread_Mutex>;
friend class WorldRunnable;
ObjectAccessor();
~ObjectAccessor();
ObjectAccessor(const ObjectAccessor&);
@@ -254,6 +256,9 @@ class ObjectAccessor
typedef ACE_Thread_Mutex LockType;
protected:
void UnloadAll();
private:
Player2CorpsesMapType i_player2corpse;
+1 -1
View File
@@ -2542,7 +2542,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm
player->GetName(), player->GetGUIDLow(), pItemSrc->GetEntry(), tabId, slotId, destTabId, destSlotId, pItemSrc->GetEntry());
//return; // Commented out for now, uncomment when it's verified that this causes a crash!!
}
//*/
// */
// 3. Check destination rights
if (!pDest->HasStoreRights(pSrc))
+2 -2
View File
@@ -1020,9 +1020,9 @@ void Map::UnloadAll()
}
}
//*****************************
// *****************************
// Grid function
//*****************************
// *****************************
GridMap::GridMap()
{
m_flags = 0;
+2 -2
View File
@@ -60,9 +60,9 @@ struct ScriptAction
ScriptInfo const* script; // pointer to static script data
};
//******************************************
// ******************************************
// Map file format defines
//******************************************
// ******************************************
#define MAP_MAGIC 'SPAM'
#define MAP_VERSION_MAGIC '1.1v'
#define MAP_AREA_MAGIC 'AERA'
+12 -16
View File
@@ -45,16 +45,6 @@ MapManager::MapManager()
MapManager::~MapManager()
{
for (MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
delete iter->second;
for (TransportSet::iterator i = m_Transports.begin(); i != m_Transports.end(); ++i)
{
(*i)->RemoveFromWorld();
delete *i;
}
Map::DeleteStateMachine();
}
void MapManager::Initialize()
@@ -305,17 +295,23 @@ bool MapManager::IsValidMAP(uint32 mapid)
void MapManager::UnloadAll()
{
for (MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
iter->second->UnloadAll();
while (!i_maps.empty())
for (TransportSet::iterator i = m_Transports.begin(); i != m_Transports.end(); ++i)
{
delete i_maps.begin()->second;
i_maps.erase(i_maps.begin());
(*i)->RemoveFromWorld();
delete *i;
}
for (MapMapType::iterator iter = i_maps.begin(); iter != i_maps.end();)
{
iter->second->UnloadAll();
delete iter->second;
i_maps.erase(iter++);
}
if (m_updater.activated())
m_updater.deactivate();
Map::DeleteStateMachine();
}
void MapManager::InitMaxInstanceId()
@@ -1142,9 +1142,9 @@ void AuraEffect::UpdatePeriodic(Unit * caster)
}
else
{
//**********************************************
// **********************************************
// This feature uses only in arenas
//**********************************************
// **********************************************
// Here need increase mana regen per tick (6 second rule)
// on 0 tick - 0 (handled in 2 second)
// on 1 tick - 166% (handled in 4 second)
@@ -1931,7 +1931,7 @@ void AuraEffect::PeriodicDummyTick(Unit * target, Unit * caster) const
}
case 54798: // FLAMING Arrow Triggered Effect
{
if (!target->ToCreature() || !caster->ToCreature()->IsVehicle())
if (!target || !target->ToCreature() || !caster->ToCreature()->IsVehicle())
return;
Unit *rider = caster->GetVehicleKit()->GetPassenger(0);
+4 -4
View File
@@ -606,17 +606,17 @@ class Spell
int32 m_damage; // Damge in effects count here
int32 m_healing; // Healing in effects count here
//******************************************
// ******************************************
// Spell trigger system
//******************************************
// ******************************************
uint32 m_procAttacker; // Attacker trigger flags
uint32 m_procVictim; // Victim trigger flags
uint32 m_procEx;
void prepareDataForTriggerSystem(AuraEffect const * triggeredByAura);
//*****************************************
// *****************************************
// Spell target subsystem
//*****************************************
// *****************************************
// Targets store structures and data
struct TargetInfo
{
+2 -2
View File
@@ -306,8 +306,8 @@ void CreatureTextMgr::BuildMonsterChat(WorldPacket *data, WorldObject* source, C
{
sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent WHISPER msg to Non-Player target. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow());
return;
//*data << (uint32)1; // target name length
//*data << (uint8)0; // target name
// *data << (uint32)1; // target name length
// *data << (uint8)0; // target name
}
*data << (uint32)(strlen(text)+1);
*data << text;
@@ -88,11 +88,11 @@ class example_creature : public CreatureScript
struct example_creatureAI : public ScriptedAI
{
//*** HANDLED FUNCTION ***
// *** HANDLED FUNCTION ***
//This is the constructor, called only once when the Creature is first created
example_creatureAI(Creature *c) : ScriptedAI(c) {}
//*** CUSTOM VARIABLES ****
// *** CUSTOM VARIABLES ****
//These variables are for use only by this individual script.
//Nothing else will ever call them but us.
@@ -105,7 +105,7 @@ class example_creature : public CreatureScript
uint32 m_uiPhase; // The current battle phase we are in
uint32 m_uiPhaseTimer; // Timer until phase transition
//*** HANDLED FUNCTION ***
// *** HANDLED FUNCTION ***
//This is called after spawn and whenever the core decides we need to evade
void Reset()
{
@@ -119,7 +119,7 @@ class example_creature : public CreatureScript
me->RestoreFaction();
}
//*** HANDLED FUNCTION ***
// *** HANDLED FUNCTION ***
// Enter Combat called once per combat
void EnterCombat(Unit* pWho)
{
@@ -127,7 +127,7 @@ class example_creature : public CreatureScript
DoScriptText(SAY_AGGRO, me, pWho);
}
//*** HANDLED FUNCTION ***
// *** HANDLED FUNCTION ***
// Attack Start is called when victim change (including at start of combat)
// By default, attack pWho and start movement toward the victim.
//void AttackStart(Unit* pWho)
@@ -135,14 +135,14 @@ class example_creature : public CreatureScript
// ScriptedAI::AttackStart(pWho);
//}
//*** HANDLED FUNCTION ***
// *** HANDLED FUNCTION ***
// Called when going out of combat. Reset is called just after.
void EnterEvadeMode()
{
DoScriptText(SAY_EVADE, me);
}
//*** HANDLED FUNCTION ***
// *** HANDLED FUNCTION ***
//Our Receive emote function
void ReceiveEmote(Player* /*pPlayer*/, uint32 uiTextEmote)
{
@@ -159,7 +159,7 @@ class example_creature : public CreatureScript
}
}
//*** HANDLED FUNCTION ***
// *** HANDLED FUNCTION ***
//Update AI is called Every single map update (roughly once every 50ms if a player is within the grid)
void UpdateAI(const uint32 uiDiff)
{
@@ -78,13 +78,13 @@ enum Creatures
{
MOB_CTHUN_PORTAL = 15896,
//***** Main Phase 1 ********
// ***** Main Phase 1 ********
BOSS_EYE_OF_CTHUN = 15589,
MOB_CLAW_TENTACLE = 15725,
MOB_EYE_TENTACLE = 15726,
MOB_SMALL_PORTAL = 15904,
//***** Main Phase 2 ********
// ***** Main Phase 2 ********
MOB_BODY_OF_CTHUN = 15809,
MOB_GIANT_CLAW_TENTACLE = 15728,
MOB_GIANT_EYE_TENTACLE = 15334,
@@ -94,7 +94,7 @@ enum Creatures
enum Spells
{
//***** Main Phase 1 ********
// ***** Main Phase 1 ********
//Eye Spells
SPELL_FREEZE_ANIM = 16245,
SPELL_GREEN_BEAM = 26134,
@@ -108,7 +108,7 @@ enum Spells
SPELL_GROUND_RUPTURE = 26139,
SPELL_HAMSTRING = 26141,
//***** Main Phase 2 ******
// ***** Main Phase 2 ******
//Body spells
//#define SPELL_CARAPACE_CTHUN 26156 //Was removed from client dbcs
SPELL_TRANSFORM = 26232,
@@ -142,7 +142,7 @@ enum Yells
//Text emote
EMOTE_WEAKENED = -1531011,
//****** Out of Combat ******
// ****** Out of Combat ******
// Random Wispers - No txt only sound
// The random sound is chosen by the client.
RANDOM_SOUND_WHISPER = 8663,
@@ -1059,7 +1059,7 @@ class npc_ball_of_flame : public CreatureScript
struct npc_ball_of_flameAI : public ScriptedAI
{
npc_ball_of_flameAI(Creature* creature) : ScriptedAI(creature)
npc_ball_of_flameAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript())
{
despawnTimer = 0;
}
@@ -1102,6 +1102,15 @@ class npc_ball_of_flame : public CreatureScript
}
}
void DamageDealt(Unit* /*target*/, uint32& damage, DamageEffectType damageType)
{
if (!instance || damageType != SPELL_DIRECT_DAMAGE)
return;
if (damage > RAID_MODE<uint32>(23000, 25000, 23000, 25000))
instance->SetData(DATA_ORB_WHISPERER_ACHIEVEMENT, uint32(false));
}
void UpdateAI(const uint32 diff)
{
if (!despawnTimer)
@@ -1117,6 +1126,7 @@ class npc_ball_of_flame : public CreatureScript
}
private:
InstanceScript* instance;
uint64 chaseGUID;
uint32 despawnTimer;
};
@@ -139,7 +139,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
void Reset()
{
events.Reset();
_Reset();
events.ScheduleEvent(EVENT_BERSERK, 330000);
events.ScheduleEvent(EVENT_VAMPIRIC_BITE, 15000);
events.ScheduleEvent(EVENT_BLOOD_MIRROR, 2500, EVENT_GROUP_CANCELLABLE);
@@ -151,8 +151,6 @@ class boss_blood_queen_lana_thel : public CreatureScript
me->SetSpeed(MOVE_FLIGHT, 0.642857f, true);
offtank = NULL;
vampires.clear();
instance->SetBossState(DATA_BLOOD_QUEEN_LANA_THEL, NOT_STARTED);
}
void EnterCombat(Unit* who)
@@ -164,6 +162,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
return;
}
me->setActive(true);
DoZoneInCombat();
Talk(SAY_AGGRO);
instance->SetBossState(DATA_BLOOD_QUEEN_LANA_THEL, IN_PROGRESS);
@@ -174,6 +173,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
void JustDied(Unit* /*killer*/)
{
_JustDied();
Talk(SAY_DEATH);
instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN);
instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN_PLR);
@@ -184,11 +184,11 @@ class boss_blood_queen_lana_thel : public CreatureScript
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DUMMY);
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_DELIRIOUS_SLASH);
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN);
instance->SetBossState(DATA_BLOOD_QUEEN_LANA_THEL, DONE);
}
void JustReachedHome()
{
_JustReachedHome();
Talk(SAY_WIPE);
instance->SetBossState(DATA_BLOOD_QUEEN_LANA_THEL, FAIL);
}
@@ -257,8 +257,8 @@ class boss_deathbringer_saurfang : public CreatureScript
void Reset()
{
_Reset();
me->SetReactState(REACT_DEFENSIVE);
events.Reset();
events.SetPhase(PHASE_COMBAT);
frenzy = false;
me->SetPower(POWER_ENERGY, 0);
@@ -269,8 +269,6 @@ class boss_deathbringer_saurfang : public CreatureScript
DoCast(me, SPELL_RUNE_OF_BLOOD_S, true);
me->RemoveAurasDueToSpell(SPELL_BERSERK);
me->RemoveAurasDueToSpell(SPELL_FRENZY);
summons.DespawnAll();
instance->SetBossState(DATA_DEATHBRINGER_SAURFANG, NOT_STARTED);
}
void EnterCombat(Unit* who)
@@ -283,6 +281,9 @@ class boss_deathbringer_saurfang : public CreatureScript
}
// oh just screw intro, enter combat - no exploits please
me->setActive(true);
DoZoneInCombat();
events.SetPhase(PHASE_COMBAT);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
introDone = true;
@@ -301,11 +302,11 @@ class boss_deathbringer_saurfang : public CreatureScript
void JustDied(Unit* /*killer*/)
{
_JustDied();
DoCastAOE(SPELL_ACHIEVEMENT, true);
Talk(SAY_DEATH);
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MARK_OF_THE_FALLEN_CHAMPION);
instance->SetBossState(DATA_DEATHBRINGER_SAURFANG, DONE);
if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SAURFANG_EVENT_NPC)))
creature->AI()->DoAction(ACTION_START_OUTRO);
}
@@ -327,6 +328,7 @@ class boss_deathbringer_saurfang : public CreatureScript
void JustReachedHome()
{
_JustReachedHome();
instance->SetBossState(DATA_DEATHBRINGER_SAURFANG, FAIL);
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MARK_OF_THE_FALLEN_CHAMPION);
}
@@ -98,7 +98,7 @@ class boss_festergut : public CreatureScript
void Reset()
{
events.Reset();
_Reset();
events.ScheduleEvent(EVENT_BERSERK, 300000);
events.ScheduleEvent(EVENT_INHALE_BLIGHT, urand(25000, 30000));
events.ScheduleEvent(EVENT_GAS_SPORE, urand(20000, 25000));
@@ -111,12 +111,10 @@ class boss_festergut : public CreatureScript
gasDummyGUID = gasDummy->GetGUID();
for (uint8 i = 0; i < 3; ++i)
{
gasDummy->RemoveAurasDueToSpell(gaseousBlight[i]);
me->RemoveAurasDueToSpell(gaseousBlight[i]);
gasDummy->RemoveAurasDueToSpell(gaseousBlightVisual[i]);
}
}
instance->SetBossState(DATA_FESTERGUT, NOT_STARTED);
}
void EnterCombat(Unit* who)
@@ -128,19 +126,19 @@ class boss_festergut : public CreatureScript
return;
}
me->setActive(true);
Talk(SAY_AGGRO);
if (Creature* gasDummy = me->FindNearestCreature(NPC_GAS_DUMMY, 100.0f, true))
gasDummyGUID = gasDummy->GetGUID();
if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PROFESSOR_PUTRICIDE)))
professor->AI()->DoAction(ACTION_FESTERGUT_COMBAT);
DoZoneInCombat(me);
DoZoneInCombat();
}
void JustDied(Unit* /*killer*/)
{
_JustDied();
Talk(SAY_DEATH);
instance->SetBossState(DATA_FESTERGUT, DONE);
if (Creature* professor = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PROFESSOR_PUTRICIDE)))
professor->AI()->DoAction(ACTION_FESTERGUT_DEATH);
@@ -149,6 +147,7 @@ class boss_festergut : public CreatureScript
void JustReachedHome()
{
_JustReachedHome();
instance->SetBossState(DATA_FESTERGUT, FAIL);
}
@@ -180,9 +180,9 @@ class boss_lady_deathwhisper : public CreatureScript
void Reset()
{
_Reset();
me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA));
me->SetLastManaUse(0xFFFFFFFF); // hacky, but no other way atm to prevent mana regen
events.Reset();
events.SetPhase(PHASE_ONE);
addWaveCounter = 0;
nextVengefulShadeTarget = 0;
@@ -191,7 +191,6 @@ class boss_lady_deathwhisper : public CreatureScript
me->RemoveAurasDueToSpell(SPELL_MANA_BARRIER);
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
instance->SetBossState(DATA_LADY_DEATHWHISPER, NOT_STARTED);
}
void MoveInLineOfSight(Unit* who)
@@ -230,6 +229,9 @@ class boss_lady_deathwhisper : public CreatureScript
return;
}
me->setActive(true);
DoZoneInCombat();
events.Reset();
events.SetPhase(PHASE_ONE);
// phase-independent events
@@ -254,8 +256,6 @@ class boss_lady_deathwhisper : public CreatureScript
{
Talk(SAY_DEATH);
instance->SetBossState(DATA_LADY_DEATHWHISPER, DONE);
std::set<uint32> livingAddEntries;
// Full House achievement
for (SummonList::iterator itr = summons.begin(); itr != summons.end(); ++itr)
@@ -284,11 +284,12 @@ class boss_lady_deathwhisper : public CreatureScript
}
}
summons.DespawnAll();
_JustDied();
}
void JustReachedHome()
{
_JustReachedHome();
instance->SetBossState(DATA_LADY_DEATHWHISPER, FAIL);
summons.DespawnAll();
@@ -50,6 +50,7 @@ enum Spells
// Coldflame
SPELL_COLDFLAME_PASSIVE = 69145,
SPELL_COLDFLAME_SUMMON = 69147,
};
static const uint32 boneSpikeSummonId[3] = {69062, 72669, 72670};
@@ -103,22 +104,23 @@ class boss_lord_marrowgar : public CreatureScript
void Reset()
{
_Reset();
me->SetSpeed(MOVE_RUN, baseSpeed, true);
me->RemoveAurasDueToSpell(SPELL_BONE_STORM);
me->RemoveAurasDueToSpell(SPELL_BERSERK);
events.Reset();
events.ScheduleEvent(EVENT_ENABLE_BONE_SLICE, 10000);
events.ScheduleEvent(EVENT_BONE_SPIKE_GRAVEYARD, urand(10000, 15000), EVENT_GROUP_SPECIAL);
events.ScheduleEvent(EVENT_COLDFLAME, 5000, EVENT_GROUP_SPECIAL);
events.ScheduleEvent(EVENT_WARN_BONE_STORM, urand(45000, 50000));
events.ScheduleEvent(EVENT_ENRAGE, 600000);
instance->SetBossState(DATA_LORD_MARROWGAR, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/)
{
Talk(SAY_AGGRO);
me->setActive(true);
DoZoneInCombat();
instance->SetBossState(DATA_LORD_MARROWGAR, IN_PROGRESS);
}
@@ -126,11 +128,12 @@ class boss_lord_marrowgar : public CreatureScript
{
Talk(SAY_DEATH);
instance->SetBossState(DATA_LORD_MARROWGAR, DONE);
_JustDied();
}
void JustReachedHome()
{
_JustReachedHome();
instance->SetBossState(DATA_LORD_MARROWGAR, FAIL);
instance->SetData(DATA_BONED_ACHIEVEMENT, uint32(true)); // reset
}
@@ -281,7 +284,6 @@ class npc_coldflame : public CreatureScript
return;
Creature* creOwner = owner->ToCreature();
DoCast(me, SPELL_COLDFLAME_PASSIVE, true);
float x, y, z;
// random target case
if (!owner->HasAura(SPELL_BONE_STORM))
{
@@ -295,23 +297,17 @@ class npc_coldflame : public CreatureScript
return;
}
target->GetPosition(x, y, z);
float scale = 70.0f / me->GetExactDist2d(x, y);
x = me->GetPositionX() + (x - me->GetPositionX()) * scale;
y = me->GetPositionY() + (y - me->GetPositionY()) * scale;
me->SetOrientation(me->GetAngle(target));
}
else
{
me->GetPosition(x, y, z);
MarrowgarAI* marrowgarAI = CAST_AI(MarrowgarAI, creOwner->AI());
Position const* ownerPos = marrowgarAI->GetLastColdflamePosition();
float ang = me->GetAngle(ownerPos) - static_cast<float>(M_PI);
MapManager::NormalizeOrientation(ang);
x += 50.0f * cosf(ang);
y += 50.0f * sinf(ang);
me->SetOrientation(ang);
}
me->GetMotionMaster()->MovePoint(POINT_TARGET_COLDFLAME, x, y, z);
events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 400);
events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 200);
}
void UpdateAI(const uint32 diff)
@@ -321,20 +317,18 @@ class npc_coldflame : public CreatureScript
if (events.ExecuteEvent() == EVENT_COLDFLAME_TRIGGER)
{
if (me->HasAura(SPELL_COLDFLAME_PASSIVE))
DoCast(SPELL_COLDFLAME_PASSIVE);
events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 400);
{
float x, y;
me->GetPosition(x, y);
x += 5.5f * cos(me->GetOrientation());
y += 5.5f * sin(me->GetOrientation());
me->NearTeleportTo(x, y, me->GetPositionZ(), me->GetOrientation());
DoCast(SPELL_COLDFLAME_SUMMON);
}
events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 200);
}
}
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE || id != POINT_TARGET_COLDFLAME)
return;
// stop triggering but dont despawn
me->RemoveAura(SPELL_COLDFLAME_PASSIVE);
}
private:
EventMap events;
};
@@ -436,6 +430,34 @@ class spell_marrowgar_coldflame : public SpellScriptLoader
}
};
class spell_marrowgar_coldflame_damage : public SpellScriptLoader
{
public:
spell_marrowgar_coldflame_damage() : SpellScriptLoader("spell_marrowgar_coldflame_damage") { }
class spell_marrowgar_coldflame_damage_AuraScript : public AuraScript
{
PrepareAuraScript(spell_marrowgar_coldflame_damage_AuraScript);
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
if (DynamicObject* owner = GetDynobjOwner())
if (GetTarget()->GetExactDist2d(owner) > owner->GetRadius() || GetTarget()->HasAura(SPELL_IMPALED))
PreventDefaultAction();
}
void Register()
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_marrowgar_coldflame_damage_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
AuraScript* GetAuraScript() const
{
return new spell_marrowgar_coldflame_damage_AuraScript();
}
};
class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader
{
public:
@@ -451,22 +473,20 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader
if (Creature* marrowgar = GetCaster()->ToCreature())
{
CreatureAI* marrowgarAI = marrowgar->AI();
bool yell = false;
uint8 boneSpikeCount = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 3 : 1);
for (uint8 i = 0; i < boneSpikeCount; ++i)
{
// select any unit but not the tank
Unit* target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 1, 100.0f, true, -SPELL_IMPALED);
// try the tank only in first iteration
if (!target && !i)
target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_IMPALED);
if (!target)
break;
yell = true;
return;
target->CastCustomSpell(boneSpikeSummonId[i], SPELLVALUE_BASE_POINT0, 0, target, true);
}
if (yell)
marrowgarAI->Talk(SAY_BONESPIKE);
marrowgarAI->Talk(SAY_BONESPIKE);
}
}
@@ -493,13 +513,12 @@ class spell_marrowgar_bone_storm : public SpellScriptLoader
void RecalculateDamage(SpellEffIndex /*effIndex*/)
{
int32 dmg = GetHitDamage();
float distance = GetHitUnit()->GetExactDist2d(GetCaster());
if (distance < 5.0f)
return;
float distVar = distance >= 20.0f ? 4 : (10.0f/3.0f);
SetHitDamage(int32(dmg * distVar / distance));
float distVar = distance >= 40.0f ? 4 : (10.0f/3.0f);
SetHitDamage(int32(GetHitDamage() * distVar / distance));
}
void Register()
@@ -520,6 +539,7 @@ void AddSC_boss_lord_marrowgar()
new npc_coldflame();
new npc_bone_spike();
new spell_marrowgar_coldflame();
new spell_marrowgar_coldflame_damage();
new spell_marrowgar_bone_spike_graveyard();
new spell_marrowgar_bone_storm();
}
@@ -221,6 +221,7 @@ class boss_professor_putricide : public CreatureScript
return;
}
me->setActive(true);
events.Reset();
events.ScheduleEvent(EVENT_BERSERK, 600000);
events.ScheduleEvent(EVENT_SLIME_PUDDLE, 10000);
@@ -240,6 +241,7 @@ class boss_professor_putricide : public CreatureScript
void JustReachedHome()
{
_JustReachedHome();
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
if (events.GetPhaseMask() & PHASE_MASK_COMBAT)
instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, FAIL);
@@ -253,8 +255,8 @@ class boss_professor_putricide : public CreatureScript
void JustDied(Unit* /*killer*/)
{
_JustDied();
Talk(SAY_DEATH);
instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, DONE);
}
void JustSummoned(Creature* summon)
@@ -290,6 +292,7 @@ class boss_professor_putricide : public CreatureScript
summon->ClearUnitState(UNIT_STAT_CASTING);
summon->GetMotionMaster()->MoveIdle();
summon->m_Events.AddEvent(new StartMovementEvent(*summon), summon->m_Events.CalculateTime(3500));
me->SetReactState(REACT_PASSIVE);
}
return;
case NPC_CHOKING_GAS_BOMB:
@@ -703,7 +706,11 @@ class npc_volatile_ooze : public CreatureScript
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
// simplified update, we do not want to select new target
if (!me->isInCombat())
return;
if (!me->getVictim())
return;
if (!newTargetSelectTimer)
@@ -100,15 +100,12 @@ class boss_rotface : public CreatureScript
void Reset()
{
events.Reset();
_Reset();
events.ScheduleEvent(EVENT_SLIME_SPRAY, 20000);
events.ScheduleEvent(EVENT_HASTEN_INFECTIONS, 90000);
events.ScheduleEvent(EVENT_MUTATED_INFECTION, 14000);
infectionStage = 0;
infectionCooldown = 14000;
summons.DespawnAll();
instance->SetBossState(DATA_ROTFACE, NOT_STARTED);
}
void EnterCombat(Unit* who)
@@ -120,23 +117,24 @@ class boss_rotface : public CreatureScript
return;
}
me->setActive(true);
Talk(SAY_AGGRO);
if (Creature* professor = Unit::GetCreature(*me, instance->GetData64(DATA_PROFESSOR_PUTRICIDE)))
professor->AI()->DoAction(ACTION_ROTFACE_COMBAT);
DoZoneInCombat(me);
DoZoneInCombat();
}
void JustDied(Unit* /*killer*/)
{
_JustDied();
Talk(SAY_DEATH);
instance->SetBossState(DATA_ROTFACE, DONE);
if (Creature* professor = Unit::GetCreature(*me, instance->GetData64(DATA_PROFESSOR_PUTRICIDE)))
professor->AI()->DoAction(ACTION_ROTFACE_DEATH);
}
void JustReachedHome()
{
_JustReachedHome();
instance->SetBossState(DATA_ROTFACE, FAIL);
instance->SetData(DATA_OOZE_DANCE_ACHIEVEMENT, uint32(true)); // reset
}
@@ -497,7 +497,7 @@ public:
{
switch (sayStep)
{
case 1:
case 0:
{
switch (me->GetEntry())
{
@@ -509,7 +509,7 @@ public:
sayStep++;
break;
}
case 2:
case 1:
{
switch (me->GetEntry())
{
@@ -521,7 +521,7 @@ public:
sayStep++;
break;
}
case 3:
case 2:
{
switch (me->GetEntry())
{
@@ -555,17 +555,17 @@ public:
{
switch (i)
{
case 1:
case 0:
if (NPC_HEMET != me->GetEntry())
continue;
else
break;
case 2:
case 1:
if (NPC_HADRIUS != me->GetEntry())
continue;
else
break;
case 3:
case 2:
if (NPC_TAMARA != me->GetEntry())
continue;
else
@@ -577,7 +577,7 @@ public:
caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(), 0);
caster->ToPlayer()->Say(SAY_OFFER, LANG_UNIVERSAL);
sayStep = 1;
sayStep = 0;
break;
}
}
@@ -47,6 +47,5 @@ int DatabaseWorker::svc()
delete request;
}
m_conn->Close();
return 0;
}
@@ -109,9 +109,9 @@ class DatabaseWorkerPool
/// Now we just wait until m_queue gives the signal to the worker threads to stop
T* t = m_connections[IDX_ASYNC][i];
DatabaseWorker* worker = t->m_worker;
worker->wait(); // t->Close(); is called from worker thread
worker->wait();
delete worker;
--m_connectionCount[IDX_ASYNC];
t->Close();
}
sLog->outSQLDriver("Asynchronous connections on databasepool '%s' terminated. Proceeding with synchronous connections.", m_connectionInfo.database.c_str());
@@ -123,7 +123,6 @@ class DatabaseWorkerPool
//while (1)
// if (t->LockIfReady()) -- For some reason deadlocks us
t->Close();
--m_connectionCount[IDX_SYNCH];
}
sLog->outSQLDriver("All connections on databasepool %s closed.", m_connectionInfo.database.c_str());
-4
View File
@@ -72,8 +72,6 @@ void usage(const char *prog)
/// Launch the Trinity server
extern int main(int argc, char **argv)
{
ACE::init();
///- Command line parsing to get the configuration file name
char const* cfg_file = _TRINITY_CORE_CONFIG;
int c=1;
@@ -151,8 +149,6 @@ extern int main(int argc, char **argv)
// 1 - shutdown at error
// 2 - restart command used, this code can be used by restarter for restart Trinityd
ACE::fini();
return ret;
}
+5 -5
View File
@@ -174,7 +174,7 @@ int Master::Run()
CoredSignalHandler SignalBREAK;
#endif /* _WIN32 */
// Register realmd's signal handlers
// Register core's signal handlers
ACE_Sig_Handler Handler;
Handler.register_handler(SIGINT, &SignalINT);
Handler.register_handler(SIGTERM, &SignalTERM);
@@ -290,7 +290,7 @@ int Master::Run()
}
// set server offline
LoginDatabase.PExecute("UPDATE realmlist SET color = color | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID);
LoginDatabase.DirectPExecute("UPDATE realmlist SET color = color | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID);
// when the main thread closes the singletons get unloaded
// since worldrunnable uses them, it will crash if unloaded after master
@@ -484,12 +484,12 @@ void Master::clearOnlineAccounts()
{
// Cleanup online status for characters hosted at current realm
/// \todo Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'?
LoginDatabase.PExecute(
LoginDatabase.DirectPExecute(
"UPDATE account SET online = 0 WHERE online > 0 "
"AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID);
CharacterDatabase.Execute("UPDATE characters SET online = 0 WHERE online<>0");
CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online<>0");
// Battleground instance ids reset at server restart
CharacterDatabase.Execute("UPDATE character_battleground_data SET instance_id = 0");
CharacterDatabase.DirectExecute("UPDATE character_battleground_data SET instance_id = 0");
}
@@ -90,6 +90,6 @@ void WorldRunnable::run()
sWorldSocketMgr->StopNetwork();
sObjectAccessor->UnloadAll(); // unload 'i_player2corpse' storage and remove from world
sMapMgr->UnloadAll(); // unload all grids (including locked in memory)
}