From 441d042d5c5317e25193769c766b60e9cae6ced4 Mon Sep 17 00:00:00 2001 From: QAston Date: Wed, 15 Apr 2009 20:34:52 +0200 Subject: *Set correct healing bonus for spells using coefficient. *Always reapply aura mods as 'real' when adding aura to stack. *Make blood frenzy expire when duration ends. *Correct procflag for T.N.T once again. --HG-- branch : trunk rename : sql/updates/2685_world.sql => sql/updates/2702_world_spell_proc_event.sql --- src/game/Spell.cpp | 1 + src/game/SpellAuras.cpp | 5 ++--- src/game/SpellAuras.h | 1 + src/game/Unit.cpp | 11 ++++++----- 4 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 82293f91f34..073425741d7 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1246,6 +1246,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) _duration = aur ? aur->GetAuraDuration() : -1; } triggeredAur->SetAuraDuration(_duration); + triggeredAur->SetPermanent(false); } } } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 08ce7a59844..b9f440188d2 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1207,11 +1207,10 @@ void Aura::SetStackAmount(uint8 stackAmount) // Reapply if amount change if (amount!=part->GetAmount()) { - bool Real = bool (part->m_spellmod); // Auras which are applying spellmod should have removed spellmods for real - part->ApplyModifier(false,Real); + part->ApplyModifier(false,true); part->SetAmount(amount); - part->ApplyModifier(true, Real); + part->ApplyModifier(true,true); } } } diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index fe9c18d19b5..bd8e9d00c3b 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -94,6 +94,7 @@ class TRINITY_DLL_SPEC Aura void SetNegative() { m_positive = false; } void SetPositive() { m_positive = true; } bool IsPermanent() const { return m_permanent; } + void SetPermanent(bool val) { m_permanent = val; } bool IsPassive() const { return m_isPassive; } bool IsDeathPersistent() const { return m_isDeathPersist; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 0ee053745aa..1e403577dbd 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9017,10 +9017,11 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint break; } } - coeff = (CastingTime / 3500.0f) * DotFactor; + // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells) + coeff = (CastingTime / 3500.0f) * DotFactor * 1.88f; } - float coeff2 = CalculateLevelPenalty(spellProto) * 1.88f * stack; + float coeff2 = CalculateLevelPenalty(spellProto)* stack; TakenTotal += TakenAdvertisedBenefit * coeff * coeff2; if(Player* modOwner = GetSpellModOwner()) { @@ -9043,7 +9044,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint // Rejuvenation, Regrowth, Lifebloom, or Wild Growth if (pVictim->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x50, 0x4000010, 0)) //increase healing by 20% - DoneTotalMod *= 1.2f; + TakenTotalMod *= 1.2f; } // Taken mods @@ -9069,11 +9070,11 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint if(damagetype==DOT) { // Healing over time taken percent - float minval_hot = GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); + float minval_hot = pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); if(minval_hot) TakenTotalMod *= (100.0f + minval_hot) / 100.0f; - float maxval_hot = GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); + float maxval_hot = pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); if(maxval_hot) TakenTotalMod *= (100.0f + maxval_hot) / 100.0f; } -- cgit v1.2.3 From 8ca97f7bcbb7cc8d20eeefe2ee3c6646542ae6cb Mon Sep 17 00:00:00 2001 From: QAston Date: Wed, 15 Apr 2009 20:58:39 +0200 Subject: Backed out changeset 77ac33a3948b - it caused problems with some channeled spells (interruption) --HG-- branch : trunk --- src/game/Player.cpp | 1 + src/game/Spell.cpp | 7 ++----- src/game/SpellAuras.cpp | 3 +-- src/game/Unit.h | 8 ++++---- 4 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index ae14d5ebc30..e8b7aa6c8d1 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -3240,6 +3240,7 @@ void Player::_LoadSpellCooldowns(QueryResult *result) // some cooldowns can be already set at aura loading... //QueryResult *result = CharacterDatabase.PQuery("SELECT spell,item,time FROM character_spell_cooldown WHERE guid = '%u'",GetGUIDLow()); + if(result) { time_t curTime = time(NULL); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f14cc6b5ed3..41d01772c50 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1100,8 +1100,8 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) } unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL); - //if(m_customAttr & SPELL_ATTR_CU_AURA_CC) - //unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CC); + if(m_customAttr & SPELL_ATTR_CU_AURA_CC) + unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CC); } else { @@ -2209,9 +2209,6 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura if(isSpellBreakStealth(m_spellInfo) ) m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CAST); - if(!m_IsTriggeredSpell) - m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ANY_CAST); - m_caster->SetCurrentCastedSpell( this ); m_selfContainer = &(m_caster->m_currentSpells[GetCurrentContainer()]); SendSpellStart(); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 955539b4c53..5fedc013188 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -935,8 +935,7 @@ void Aura::_AddAura() // set infinity cooldown state for spells if(caster && caster->GetTypeId() == TYPEID_PLAYER) { - // Do not apply cooldown for caster passive spells (needed by Reincarnation) - if (!(caster->HasSpell(GetId()) && IsPassive()) && !(m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)) + if (m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE) { Item* castItem = m_castItemGuid ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL; ((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true); diff --git a/src/game/Unit.h b/src/game/Unit.h index 17e5abb10a0..ace61563c0f 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -59,9 +59,9 @@ enum SpellChannelInterruptFlags enum SpellAuraInterruptFlags { - AURA_INTERRUPT_FLAG_ANY_CAST = 0x00000001, // 0 removed by any cast + AURA_INTERRUPT_FLAG_HITBYSPELL = 0x00000001, // 0 removed when getting hit by a negative spell? AURA_INTERRUPT_FLAG_DAMAGE = 0x00000002, // 1 removed by any damage - AURA_INTERRUPT_FLAG_HITBYSPELL = 0x00000004, // 2 removed when getting hit by a negative spell? aoe damage? + AURA_INTERRUPT_FLAG_CC = 0x00000004, // 2 crowd control AURA_INTERRUPT_FLAG_MOVE = 0x00000008, // 3 removed by any movement AURA_INTERRUPT_FLAG_TURNING = 0x00000010, // 4 removed by any turning AURA_INTERRUPT_FLAG_JUMP = 0x00000020, // 5 removed by entering combat @@ -71,8 +71,8 @@ enum SpellAuraInterruptFlags AURA_INTERRUPT_FLAG_NOT_SHEATHED = 0x00000200, // 9 removed by unsheathing AURA_INTERRUPT_FLAG_TALK = 0x00000400, // 10 talk to npc / loot? action on creature AURA_INTERRUPT_FLAG_USE = 0x00000800, // 11 mine/use/open action on gameobject - AURA_INTERRUPT_FLAG_ATTACK = 0x00001000, // 12 removed by attacking (negative spell cast?) - AURA_INTERRUPT_FLAG_CAST = 0x00002000, // 13 cast stealth breaking spell + AURA_INTERRUPT_FLAG_ATTACK = 0x00001000, // 12 removed by attacking + AURA_INTERRUPT_FLAG_CAST = 0x00002000, // 13 ??? AURA_INTERRUPT_FLAG_UNK14 = 0x00004000, // 14 AURA_INTERRUPT_FLAG_TRANSFORM = 0x00008000, // 15 removed by transform? AURA_INTERRUPT_FLAG_UNK16 = 0x00010000, // 16 -- cgit v1.2.3 From 49b5e021caea81914cdf1dd68dfda4529e2914c1 Mon Sep 17 00:00:00 2001 From: QAston Date: Wed, 15 Apr 2009 21:06:22 +0200 Subject: *Correct formula for mana regen from items during 5SR. --HG-- branch : trunk --- src/game/StatSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index f9d237b9d5e..c24999e8fe5 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -701,7 +701,7 @@ void Player::UpdateManaRegen() int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT); if (modManaRegenInterrupt > 100) modManaRegenInterrupt = 100; - SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, (power_regen_mp5 + power_regen) * modManaRegenInterrupt / 100.0f); + SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, power_regen_mp5 + power_regen * modManaRegenInterrupt / 100.0f); SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, power_regen_mp5 + power_regen); } -- cgit v1.2.3 From e3bd7fed4e06827ed1337dd80f85e83304ba28fe Mon Sep 17 00:00:00 2001 From: Drahy Date: Wed, 15 Apr 2009 21:40:09 +0200 Subject: * Added gossip option related to quest 12791, 12794 and 12796 - Thx SD2 team --HG-- branch : trunk --- sql/updates/2706_world_SD2_scripts.sql | 4 ++ src/bindings/scripts/scripts/npc/npcs_special.cpp | 45 +++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 sql/updates/2706_world_SD2_scripts.sql (limited to 'src') diff --git a/sql/updates/2706_world_SD2_scripts.sql b/sql/updates/2706_world_SD2_scripts.sql new file mode 100644 index 00000000000..cd9c4ea3b19 --- /dev/null +++ b/sql/updates/2706_world_SD2_scripts.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='npc_kingdom_of_dalaran_quests' WHERE entry IN (29169,23729,26673,27158,29158,29161,26471,29155,29159,29160,29162); +DELETE FROM spell_target_position WHERE id=53360; +INSERT INTO spell_target_position VALUES +(53360, 571, 5807.829, 587.960, 660.939, 1.663); \ No newline at end of file diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index 49bc64e9021..3084b57e956 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -29,6 +29,7 @@ npc_guardian 100% guardianAI used to prevent players from accessin npc_garments_of_quests 80% NPC's related to all Garments of-quests 5621, 5624, 5625, 5648, 565 npc_injured_patient 100% patients for triage-quests (6622 and 6624) npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage) +npc_kingdom_of_dalaran_quests Misc NPC's gossip option related to quests 12791, 12794 and 12796 npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681 npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given @@ -876,6 +877,44 @@ CreatureAI* GetAI_npc_guardian(Creature *_Creature) return new npc_guardianAI (_Creature); } +/*###### +## npc_kingdom_of_dalaran_quests +######*/ + +enum +{ + SPELL_TELEPORT_DALARAN = 53360, + ITEM_KT_SIGNET = 39740, + QUEST_MAGICAL_KINGDOM_A = 12794, + QUEST_MAGICAL_KINGDOM_H = 12791, + QUEST_MAGICAL_KINGDOM_N = 12796 +}; + +#define GOSSIP_ITEM_TELEPORT_TO "I am ready to be teleported to Dalaran." + +bool GossipHello_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->HasItemCount(ITEM_KT_SIGNET,1) && (!pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_A) || + !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_H) || !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_N))) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TELEPORT_TO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer,SPELL_TELEPORT_DALARAN,false); + } + return true; +} + /*###### ## npc_mount_vendor ######*/ @@ -1417,6 +1456,12 @@ void AddSC_npcs_special() newscript->GetAI = &GetAI_npc_guardian; newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="npc_kingdom_of_dalaran_quests"; + newscript->pGossipHello = &GossipHello_npc_kingdom_of_dalaran_quests; + newscript->pGossipSelect = &GossipSelect_npc_kingdom_of_dalaran_quests; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name="npc_mount_vendor"; newscript->pGossipHello = &GossipHello_npc_mount_vendor; -- cgit v1.2.3