From fe6f35235b4c64794890964c3c039baf266a8449 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 28 Dec 2008 23:29:21 +0100 Subject: [PATCH 1/5] *Reverted 699 --HG-- branch : trunk --- src/game/Chat.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index d86e941c3f..bb4f3c9bf3 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -842,8 +842,10 @@ int ChatHandler::ParseCommands(const char* text) ASSERT(text); ASSERT(*text); - if(m_session->GetSecurity() == 0) - return 0; + std::string fullcmd = text; + + //if(m_session->GetSecurity() == 0) + // return 0; /// chat case (.command or !command format) if(m_session) @@ -855,8 +857,7 @@ int ChatHandler::ParseCommands(const char* text) /// ignore single . and ! in line if(strlen(text) < 2) return 0; - - std::string fullcmd = text; // original `text` can't be used. It content destroyed in command code processing. + // original `text` can't be used. It content destroyed in command code processing. /// ignore messages staring from many dots. if(text[0] == '.' && text[1] == '.' || text[0] == '!' && text[1] == '!') From 28656d040aa0dd6a6cfd255c68d4bcdc91215089 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Mon, 29 Dec 2008 01:16:46 +0100 Subject: [PATCH 2/5] *Correctly show Guild Promoting / Demoting - by Machiavelli --HG-- branch : trunk --- src/game/GuildHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp index 0737314168..1543360201 100644 --- a/src/game/GuildHandler.cpp +++ b/src/game/GuildHandler.cpp @@ -375,14 +375,14 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) guild->ChangeRank(plGuid, (slot->RankId+1)); // Put record into guildlog - guild->LogGuildEvent(GUILD_EVENT_LOG_DEMOTE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), (slot->RankId+1)); + guild->LogGuildEvent(GUILD_EVENT_LOG_DEMOTE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), (slot->RankId)); WorldPacket data(SMSG_GUILD_EVENT, (2+30)); // guess size data << (uint8)GE_DEMOTION; data << (uint8)3; data << GetPlayer()->GetName(); data << plName; - data << guild->GetRankName(slot->RankId+1); + data << guild->GetRankName(slot->RankId); guild->BroadcastPacket(&data); } From a0e40a39f5caa8e4bb075e1b9d54be4fd9845ebb Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Mon, 29 Dec 2008 15:33:19 +0100 Subject: [PATCH 3/5] *Fixed EventStart in Shade of Akama script - by Lightguard --HG-- branch : trunk --- .../zone/black_temple/boss_shade_of_akama.cpp | 78 ++++++++++--------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp index 8190263550..a29a2db932 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp @@ -189,37 +189,13 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI bool IsBanished; bool HasKilledAkama; bool reseting; + bool GridSearcherSucceeded; void Reset() { reseting = true; - m_creature->setActive(true); // TODO: setActive(true, time); - FindChannelers(); - - if(!Channelers.empty()) - { - for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) - { - Creature* Channeler = NULL; - Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr)); - if(Channeler) - { - if(Channeler->isDead()) - { - Channeler->RemoveCorpse(); - Channeler->Respawn(); - } - if(m_creature->isAlive()) - { - Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); - Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); - Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - }else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); - } - - } + GridSearcherSucceeded = false; if(!Sorcerers.empty()) { @@ -252,8 +228,8 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI m_creature->SetVisibility(VISIBILITY_ON); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); + //m_creature->GetMotionMaster()->Clear(); + //m_creature->GetMotionMaster()->MoveIdle(); m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); if(pInstance && m_creature->isAlive()) @@ -262,6 +238,42 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI reseting = false; } + void MoveInLineOfSight(Unit *who) + { + if(!GridSearcherSucceeded) + { + FindChannelers(); + + if (!Channelers.empty()) + { + for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + { + Creature* Channeler = NULL; + Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr)); + + if (Channeler) + { + if (Channeler->isDead()) + { + Channeler->RemoveCorpse(); + Channeler->Respawn(); + Channeler->InterruptNonMeleeSpells(true); + Channeler->RemoveAurasDueToSpell(SPELL_SHADE_SOUL_CHANNEL); + } + + if (Channeler->isAlive()) + { + Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); + Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); + Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + GridSearcherSucceeded = true; + } + } + } + }else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); + } + } + void Aggro(Unit* who) { } void AttackStart(Unit* who) @@ -272,13 +284,6 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI DoStartMovement(who); } - void MoveInLineOfSight(Unit* who) - { - if(IsBanished) return; - - ScriptedAI::MoveInLineOfSight(who); - } - void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer { if(reseting) @@ -324,6 +329,8 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI { Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + Spawn->AI()->AttackStart(target); } } } @@ -433,6 +440,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI Akama->AddThreat(m_creature, 10000000.0f); m_creature->Attack(Akama, true); Akama->Attack(m_creature, true); + m_creature->SetInCombatWith(Akama); } } } From f0ca8d152ff279c7002161e4c831aa20586a49d1 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 29 Dec 2008 12:06:33 -0600 Subject: [PATCH 4/5] *Fix a bug about arena point autodistributiontime. --HG-- branch : trunk --- src/game/BattleGroundMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 4be2320be6..0ad6340f0c 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1613,7 +1613,7 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution() if(!result) { sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now."); - m_NextAutoDistributionTime = sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); + m_NextAutoDistributionTime = time(NULL) + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ('"I64FMTD"')", m_NextAutoDistributionTime); } else From 513f9ce6b9d539790a2b43cb621f6d8b6d72b0e1 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 29 Dec 2008 15:57:27 -0600 Subject: [PATCH 5/5] *Fix a crash bug about dynobj. --HG-- branch : trunk --- src/game/Unit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1fed4717db..b830b7b4c7 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4432,7 +4432,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit { int32 basePoints = aur->GetBasePoints(); // construct the new aura for the attacker - Aura * new_aur = CreateAura(aur->GetSpellProto(), aur->GetEffIndex(), &basePoints, stealer); + Aura * new_aur = CreateAura(aur->GetSpellProto(), aur->GetEffIndex(), NULL/*&basePoints*/, stealer); if(!new_aur) continue; @@ -4808,7 +4808,7 @@ DynamicObject * Unit::GetDynObject(uint32 spellId, uint32 effIndex) { for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();) { - DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*m_dynObjGUIDs.begin()); + DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this, *i); if(!dynObj) { i = m_dynObjGUIDs.erase(i); @@ -4826,7 +4826,7 @@ DynamicObject * Unit::GetDynObject(uint32 spellId) { for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();) { - DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*m_dynObjGUIDs.begin()); + DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this, *i); if(!dynObj) { i = m_dynObjGUIDs.erase(i);