From b28a7eb406ee7ce6efd5d86ae971ce07e0fff42e Mon Sep 17 00:00:00 2001 From: Anubisss Date: Fri, 19 Jun 2009 11:13:50 +0200 Subject: [PATCH 1/9] *Backport TrinityCore2 r4137. --HG-- branch : trunk --- .../zone/magisters_terrace/boss_selin_fireheart.cpp | 3 --- .../the_mechanar/boss_pathaleon_the_calculator.cpp | 13 +++++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp index a56d6a4dd3..9b40a9dd92 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp @@ -230,10 +230,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI DoScriptText(SAY_DEATH, m_creature); if(!pInstance) - { - error_log(ERROR_INST_DATA); return; - } pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete! diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp index 073054c3b9..5595e6739c 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp @@ -50,12 +50,13 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI { - boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c) + boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(m_creature) { HeroicMode = m_creature->GetMap()->IsHeroic(); } uint32 Summon_Timer; + SummonList summons; uint32 ManaTap_Timer; uint32 ArcaneTorrent_Timer; uint32 Domination_Timer; @@ -76,7 +77,7 @@ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI Enraged = false; Counter = 0; - + summons.DespawnAll(); } void Aggro(Unit *who) { @@ -95,8 +96,13 @@ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI void JustDied(Unit* Killer) { DoScriptText(SAY_DEATH, m_creature); + + summons.DespawnAll(); } + void JustSummoned(Creature *summon) { summons.Summon(summon); } + void SummonedCreatureDespawn(Creature *summon) { summons.Despawn(summon); } + void UpdateAI(const uint32 diff) { //Return since we have no target @@ -107,8 +113,7 @@ struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI { for(int i = 0; i < 3;i++) { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); if (target && Wraith) Wraith->AI()->AttackStart(target); From abe4388eeb92a76597f4bb49f267f370f4a0454c Mon Sep 17 00:00:00 2001 From: D_Skywalk Date: Fri, 19 Jun 2009 12:53:09 +0200 Subject: [PATCH 2/9] *Fixed gain reputation and xp reward between group mates in --HG-- branch : trunk --- src/game/Player.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 23b5434e1b..716997df04 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18834,6 +18834,9 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const { + if(GetInstanceId() != pRewardSource->GetInstanceId()) + return false; + if(pRewardSource->GetDistance(this) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE)) return true; From d9c8770d45ab73124ab826718c384f394b4262d4 Mon Sep 17 00:00:00 2001 From: D_Skywalk Date: Fri, 19 Jun 2009 12:56:27 +0200 Subject: [PATCH 3/9] *Avoid show quest sign for trainer under cursor if trianer have unavailable quest. Author: SeT --HG-- branch : trunk --- src/game/QuestHandler.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp index c447b170d4..a811f99d0f 100644 --- a/src/game/QuestHandler.cpp +++ b/src/game/QuestHandler.cpp @@ -605,9 +605,6 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 result = result2; } - if(questgiver->GetTypeId()==TYPEID_UNIT && ((Creature*)questgiver)->isCanTrainingAndResetTalentsOf(pPlayer) && result < DIALOG_STATUS_CHAT) - result = DIALOG_STATUS_CHAT; - return result; } From 831320565eb497a1af28a067a93f99e2268ad687 Mon Sep 17 00:00:00 2001 From: D_Skywalk Date: Fri, 19 Jun 2009 13:03:22 +0200 Subject: [PATCH 4/9] *The Author of r1583 is AlexDereka. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 6ba4e1efaf..8169bc1488 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1231,7 +1231,7 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(m_caster, 30452, true, NULL); return; - } + } } //All IconID Check in there @@ -2634,7 +2634,7 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype) // we succeeded in creating at least one item, so a levelup is possible player->UpdateCraftSkill(m_spellInfo->Id); - } + } } void Spell::EffectCreateItem(uint32 i) @@ -3998,7 +3998,7 @@ void Spell::EffectSummonPet(uint32 i) Pet* pet = owner->SummonPet(petentry, x, y, z, owner->GetOrientation(), SUMMON_PET, 0); if(!pet) return; - + if(m_caster->GetTypeId() == TYPEID_UNIT) { if ( ((Creature*)m_caster)->isTotem() ) @@ -5522,23 +5522,23 @@ void Spell::EffectMomentMove(uint32 i) dist = sqrt((x-destx)*(x-destx) + (y-desty)*(y-desty)); step = dist/10.0f; } - + int j = 0; for(j; j<10 ;j++) { - if(fabs(z - destz) > 6) - { - destx -= step * cos(orientation); - desty -= step * sin(orientation); - ground = unitTarget->GetMap()->GetHeight(destx,desty,MAX_HEIGHT,true); - floor = unitTarget->GetMap()->GetHeight(destx,desty,z, true); - destz = fabs(ground - z) <= fabs(floor - z) ? ground:floor; - }else - break; + if(fabs(z - destz) > 6) + { + destx -= step * cos(orientation); + desty -= step * sin(orientation); + ground = unitTarget->GetMap()->GetHeight(destx,desty,MAX_HEIGHT,true); + floor = unitTarget->GetMap()->GetHeight(destx,desty,z, true); + destz = fabs(ground - z) <= fabs(floor - z) ? ground:floor; + }else + break; } if(j == 9) { - return; + return; } if(unitTarget->GetTypeId() == TYPEID_PLAYER) From 0bef9c2e59e87f44d35b8c33a8c700bf82e85d28 Mon Sep 17 00:00:00 2001 From: Iskander Date: Fri, 19 Jun 2009 13:14:33 +0200 Subject: [PATCH 5/9] * Correct group reward distance check --HG-- branch : trunk --- src/game/Player.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 716997df04..c449c53b23 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18834,20 +18834,14 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const { - if(GetInstanceId() != pRewardSource->GetInstanceId()) + const WorldObject* player = GetCorpse(); + if(!player || isAlive()) + player = this; + + if(player->GetMapId() != pRewardSource->GetMapId() || player->GetInstanceId() != pRewardSource->GetInstanceId()) return false; - if(pRewardSource->GetDistance(this) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE)) - return true; - - if(isAlive()) - return false; - - Corpse* corpse = GetCorpse(); - if(!corpse) - return false; - - return pRewardSource->GetDistance(corpse) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE); + return pRewardSource->GetDistance(player) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE); } uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const From eab85d9d6e55d66971ac5b816196510a26973d47 Mon Sep 17 00:00:00 2001 From: Muhaha Date: Sat, 20 Jun 2009 02:54:03 +0200 Subject: [PATCH 6/9] * Added LowerPlayerDamageReq function from TC2 * Akama is summoned after the illidari council has been deafeated. (remove your akama spawn from creature db) * Dampen Magic timer * Merging mother from TC2 --HG-- branch : trunk --- .../aunchindoun/shadow_labyrinth/boss_murmur.cpp | 1 + .../zone/black_temple/boss_mother_shahraz.cpp | 4 ++-- .../scripts/zone/black_temple/illidari_council.cpp | 14 ++++++++++---- src/game/AggressorAI.cpp | 2 +- src/game/Creature.cpp | 6 +++--- src/game/Creature.h | 14 +++++++++----- src/game/CreatureAI.cpp | 2 +- src/game/ReactorAI.cpp | 2 +- src/game/Unit.cpp | 2 +- 9 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp index 0ac15f31f4..1908de699b 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp @@ -62,6 +62,7 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI //database should have `RegenHealth`=0 to prevent regen uint32 hp = (m_creature->GetMaxHealth()*40)/100; if (hp) m_creature->SetHealth(hp); + m_creature->ResetPlayerDamageReq(); } void Aggro(Unit *who) { } diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp index 4b63b092c5..2718ff5b2a 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 +/* Copyright (C) 2006 - 2009 ScriptDev2 * 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 @@ -241,7 +241,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later. if(ExplosionCount < 3) { - for(uint8 i = 0; i < 4; i++) + for(uint8 i = 0; i < 3; ++i) { Unit* pUnit = NULL; if(TargetGUID[i]) diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp index 266c84bd09..b64c5d7374 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 +/* Copyright (C) 2006 - 2009 ScriptDev2 * 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 @@ -51,6 +51,8 @@ EndScriptData */ #define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly." +#define AKAMAID 23089 + struct CouncilYells { int32 entry; @@ -240,7 +242,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); + m_creature->SetDisplayId(11686); } void Aggro(Unit *who) {} @@ -297,6 +299,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI if(Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE); + m_creature->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0); } m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); return; @@ -405,9 +408,12 @@ struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI damage /= 4; for(uint8 i = 0; i < 4; ++i) { - if(Unit* pUnit = Unit::GetUnit(*m_creature, Council[i])) + if(Creature* pUnit = Unit::GetCreature(*m_creature, Council[i])) if(pUnit != m_creature && damage < pUnit->GetHealth()) + { pUnit->SetHealth(pUnit->GetHealth() - damage); + pUnit->LowerPlayerDamageReq(damage); + } } } @@ -593,7 +599,7 @@ struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_ { DoCast(m_creature, SPELL_DAMPEN_MAGIC); Cooldown = 1000; - DampenMagicTimer = 110000; // almost 2 minutes + DampenMagicTimer = 67200; // almost 1,12 minutes ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen. }else DampenMagicTimer -= diff; diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp index d44cab9fd2..b549d8bfcc 100644 --- a/src/game/AggressorAI.cpp +++ b/src/game/AggressorAI.cpp @@ -93,7 +93,7 @@ void AggressorAI::EnterEvadeMode() i_victimGuid = 0; i_creature.CombatStop(); i_creature.SetLootRecipient(NULL); - i_creature.ResetDamageByPlayers(); + i_creature.ResetPlayerDamageReq(); } void diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index fc79caf726..8c062282b9 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -147,7 +147,7 @@ m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_resp m_gossipOptionLoaded(false), m_emoteState(0), m_isPet(false), m_isTotem(false), m_reactState(REACT_AGGRESSIVE), m_regenTimer(2000), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0), m_AlreadyCallAssistance(false), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), -m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTableGuid(0), m_formation(NULL) +m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTableGuid(0), m_formation(NULL), m_PlayerDamageReq(0) { m_valuesCount = UNIT_END; @@ -159,7 +159,6 @@ m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTabl m_GlobalCooldown = 0; m_unit_movement_flags = MOVEMENTFLAG_WALK_MODE; DisableReputationGain = false; - ResetDamageByPlayers(); } Creature::~Creature() @@ -1270,6 +1269,7 @@ void Creature::SelectLevel(const CreatureInfo *cinfo) SetCreateHealth(health); SetMaxHealth(health); SetHealth(health); + ResetPlayerDamageReq(); // mana uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana); @@ -1654,7 +1654,7 @@ void Creature::setDeathState(DeathState s) // setActive(true); SetHealth(GetMaxHealth()); SetLootRecipient(NULL); - ResetDamageByPlayers(); + ResetPlayerDamageReq(); Unit::setDeathState(ALIVE); CreatureInfo const *cinfo = GetCreatureInfo(); RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); diff --git a/src/game/Creature.h b/src/game/Creature.h index b25893b5ba..2abd304138 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -637,10 +637,15 @@ class TRINITY_DLL_SPEC Creature : public Unit void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; } bool IsReputationGainDisabled() { return DisableReputationGain; } - bool IsDamageEnoughForLootingAndReward() { return m_unDamageByPlayers >= (uint32)(GetMaxHealth() / 2); } - void AddDamageByPlayers(uint32 unDamage) { m_unDamageByPlayers += unDamage; } - void ResetDamageByPlayers() { m_unDamageByPlayers = 0; } - + bool IsDamageEnoughForLootingAndReward() { return m_PlayerDamageReq == 0; } + void LowerPlayerDamageReq(uint32 unDamage) + { + if(m_PlayerDamageReq) + m_PlayerDamageReq > unDamage ? m_PlayerDamageReq -= unDamage : m_PlayerDamageReq = 0; + } + void ResetPlayerDamageReq() { m_PlayerDamageReq = GetHealth() / 2; } + uint32 m_PlayerDamageReq; + protected: bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL); bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL); @@ -655,7 +660,6 @@ class TRINITY_DLL_SPEC Creature : public Unit uint32 m_lootMoney; uint64 m_lootRecipient; - uint32 m_unDamageByPlayers; /// Timers uint32 m_deathTimer; // (msecs)timer for death or corpse disappearance diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp index 3a7cb896e8..e5ed4cf894 100644 --- a/src/game/CreatureAI.cpp +++ b/src/game/CreatureAI.cpp @@ -100,7 +100,7 @@ void CreatureAI::EnterEvadeMode() me->CombatStop(); me->LoadCreaturesAddon(); me->SetLootRecipient(NULL); - me->ResetDamageByPlayers(); + me->ResetPlayerDamageReq(); if(me->isAlive()) me->GetMotionMaster()->MoveTargetedHome(); diff --git a/src/game/ReactorAI.cpp b/src/game/ReactorAI.cpp index f9fe0abfdc..15a99adef8 100644 --- a/src/game/ReactorAI.cpp +++ b/src/game/ReactorAI.cpp @@ -104,7 +104,7 @@ ReactorAI::EnterEvadeMode() i_victimGuid = 0; i_creature.CombatStop(); i_creature.SetLootRecipient(NULL); - i_creature.ResetDamageByPlayers(); + i_creature.ResetPlayerDamageReq(); if(!i_creature.GetCharmerOrOwner()) { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 23cde7b2fc..b4878cbac4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -806,7 +806,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa ((Creature*)pVictim)->SetLootRecipient(this); if(GetCharmerOrOwnerPlayerOrPlayerItself()) - ((Creature*)pVictim)->AddDamageByPlayers(health < damage ? health : damage); + ((Creature*)pVictim)->LowerPlayerDamageReq(health < damage ? health : damage); } if (health <= damage) From 1dd1f6db344c403fb6b90d6dff9b19cee73ffc0b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 20 Jun 2009 14:16:42 +0200 Subject: [PATCH 7/9] * Implement parameter 'reason' for mute command. --HG-- branch : trunk --- sql/updates/1588_world.sql | 9 +++++++++ src/game/Level2.cpp | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 sql/updates/1588_world.sql diff --git a/sql/updates/1588_world.sql b/sql/updates/1588_world.sql new file mode 100644 index 0000000000..d7ccaeaf6d --- /dev/null +++ b/sql/updates/1588_world.sql @@ -0,0 +1,9 @@ +# 1588 +DELETE FROM `trinity_string` WHERE `entry` IN(301, 300); +INSERT INTO `trinity_string` (`entry`, `content_default`)VALUES +('300', 'Your chat has been disabled for %u minutes. Reason: %s.'), +('301', 'You have disabled %s\'s chat for %u minutes. Reason: %s.'); + +DELETE FROM `command` WHERE `name` = 'mute'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('mute', 1 ,'Syntax: .mute [$playerName] $timeInMinutes [$reason]\r\n\r\nDisible chat messaging for any character from account of character $playerName (or currently selected) at $timeInMinutes minutes. Player can be offline.'); diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 4caa6f2957..4e80cfda1d 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -69,6 +69,10 @@ bool ChatHandler::HandleMuteCommand(const char* args) if(!timetonotspeak) return false; + char *mutereason = strtok(NULL, " "); + if(!mutereason) + strcpy(mutereason, "No reason."); + uint32 notspeaktime = (uint32) atoi(timetonotspeak); if(!normalizePlayerName(cname)) @@ -118,9 +122,9 @@ bool ChatHandler::HandleMuteCommand(const char* args) LoginDatabase.PExecute("UPDATE account SET mutetime = " I64FMTD " WHERE id = '%u'",uint64(mutetime), account_id ); if(chr) - ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime); + ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereason); - PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime); + PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime, mutereason); return true; } From a8d305c8c235c8c597cd5ffd051e5f829d850f30 Mon Sep 17 00:00:00 2001 From: Iskander Date: Sat, 20 Jun 2009 21:53:59 +0200 Subject: [PATCH 8/9] * fix of Spiritual Attunement --HG-- branch : trunk --- sql/updates/1589_world.sql | 3 +++ src/game/SpellAuras.cpp | 14 ++++++++++++++ src/game/Unit.cpp | 6 ++++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 sql/updates/1589_world.sql diff --git a/sql/updates/1589_world.sql b/sql/updates/1589_world.sql new file mode 100644 index 0000000000..e3a76bedf7 --- /dev/null +++ b/sql/updates/1589_world.sql @@ -0,0 +1,3 @@ +# 1589 +-- Spiritual Attunement +UPDATE `spell_proc_event` SET `procFlags` = `procFlags`|0x80000 WHERE `entry` IN ('31785','33776'); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 937833eab7..5e8241b486 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1140,6 +1140,20 @@ void Aura::HandleAddModifier(bool apply, bool Real) if(apply) m_target->CastSpell(m_target,45471,true); } + + if(spellInfo->SpellFamilyName==SPELLFAMILY_PALADIN && (spellFamilyMask & 0x0000100000000000LL)) // Spiritual Attunement + { + if(m_target->HasAura(31785,0)) // rank 1 + { + m_target->RemoveAurasDueToSpell(31785); + m_target->CastSpell(m_target,31785,true); + } + if(m_target->HasAura(33776,0)) // rank 2 + { + m_target->RemoveAurasDueToSpell(33776); + m_target->CastSpell(m_target,33776,true); + } + } } void Aura::TriggerSpell() diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b4878cbac4..3031a89e0a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5908,9 +5908,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu return false; // heal amount - basepoints0 = triggeredByAura->GetModifier()->m_amount*damage/100; + basepoints0 = triggeredByAura->GetModifierValue()*std::min(damage,GetMaxHealth() - GetHealth())/100; target = this; - triggered_spell_id = 31786; + + if(basepoints0) + triggered_spell_id = 31786; break; } // Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal) From 4a93373c0698a4b9b05f91bbedf1f1b8b9880238 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 20 Jun 2009 23:28:47 +0200 Subject: [PATCH 9/9] * Use safer way to handle recently added mute reason command --HG-- branch : trunk --- src/game/Level2.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 4e80cfda1d..7c9405cb10 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -70,8 +70,11 @@ bool ChatHandler::HandleMuteCommand(const char* args) return false; char *mutereason = strtok(NULL, " "); + std::string mutereasonstr; if(!mutereason) - strcpy(mutereason, "No reason."); + mutereasonstr = "No reason."; + else + mutereasonstr = mutereason; uint32 notspeaktime = (uint32) atoi(timetonotspeak); @@ -122,9 +125,9 @@ bool ChatHandler::HandleMuteCommand(const char* args) LoginDatabase.PExecute("UPDATE account SET mutetime = " I64FMTD " WHERE id = '%u'",uint64(mutetime), account_id ); if(chr) - ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereason); + ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereasonstr.c_str()); - PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime, mutereason); + PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime, mutereasonstr.c_str()); return true; }