Skip to content

Commit

Permalink
[8930] Implement bonus periodic heal part for spell 19750 and ranks.
Browse files Browse the repository at this point in the history
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also code ordering and cleanups.
  • Loading branch information
MrLama authored and VladimirMangos committed Dec 6, 2009
1 parent b29c1a4 commit 81b4744
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 55 deletions.
3 changes: 2 additions & 1 deletion sql/mangos.sql
Expand Up @@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0',
`required_8929_01_mangos_gossip_scripts` bit(1) default NULL
`required_8930_01_mangos_spell_proc_event` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';

--
Expand Down Expand Up @@ -18391,6 +18391,7 @@ INSERT INTO `spell_proc_event` VALUES
(58364, 0x00000000, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
(58372, 0x00000000, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
(58386, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0),
(58597, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00008000, 0x00000000, 0.000000, 100.000000,0),
(58616, 0x00000000, 15, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
(58620, 0x00000000, 15, 0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
(58626, 0x00000000, 15, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
Expand Down
5 changes: 5 additions & 0 deletions sql/updates/8930_01_mangos_spell_proc_event.sql
@@ -0,0 +1,5 @@
ALTER TABLE db_version CHANGE COLUMN required_8929_01_mangos_gossip_scripts required_8930_01_mangos_spell_proc_event bit;

DELETE FROM `spell_proc_event` WHERE `entry` IN (58597);
INSERT INTO `spell_proc_event` VALUES
(58597, 0x00000000, 10, 0x40000000, 0x00000000, 0x00000000, 0x00008000, 0x00000000, 0.000000, 100.000000,0);
2 changes: 2 additions & 0 deletions sql/updates/Makefile.am
Expand Up @@ -191,6 +191,7 @@ pkgdata_DATA = \
8917_01_mangos_spell_proc_event.sql \
8923_01_mangos_gossip.sql \
8929_01_mangos_gossip_scripts.sql \
8930_01_mangos_spell_proc_event.sql \
README

## Additional files to include when running 'make dist'
Expand Down Expand Up @@ -362,4 +363,5 @@ EXTRA_DIST = \
8917_01_mangos_spell_proc_event.sql \
8923_01_mangos_gossip.sql \
8929_01_mangos_gossip_scripts.sql \
8930_01_mangos_spell_proc_event.sql \
README
116 changes: 64 additions & 52 deletions src/game/Unit.cpp
Expand Up @@ -5933,13 +5933,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
basepoints0 = GetAttackTime(BASE_ATTACK) * int32(ap*0.022f + 0.044f * holy) / 1000;
break;
}
// Sacred Shield
if (dummySpell->SpellFamilyFlags & UI64LIT(0x0008000000000000))
{
triggered_spell_id = 58597;
target = this;
break;
}
// Righteous Vengeance
if (dummySpell->SpellIconID == 3025)
{
Expand Down Expand Up @@ -6040,6 +6033,20 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
break;
}
// Spiritual Attunement
case 31785:
case 33776:
{
// if healed by another unit (pVictim)
if(this == pVictim)
return false;

// heal amount
basepoints0 = triggerAmount*damage/100;
target = this;
triggered_spell_id = 31786;
break;
}
// Seal of Vengeance (damage calc on apply aura)
case 31801:
{
Expand Down Expand Up @@ -6077,20 +6084,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Replenishment
CastSpell(this, 57669, true, NULL, triggeredByAura);
break;
// Spiritual Attunement
case 31785:
case 33776:
{
// if healed by another unit (pVictim)
if(this == pVictim)
return false;

// heal amount
basepoints0 = triggerAmount*damage/100;
target = this;
triggered_spell_id = 31786;
break;
}
// Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal)
case 40470:
{
Expand Down Expand Up @@ -6119,29 +6112,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu

break;
}
// Seal of Corruption (damage calc on apply aura)
case 53736:
{
if(effIndex != 0) // effect 1,2 used by seal unleashing code
return false;

triggered_spell_id = 53742;

// Add 5-stack effect
int8 stacks = 0;
AuraList const& auras = target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{
if( ((*itr)->GetId() == 53742) && (*itr)->GetCasterGUID()==GetGUID())
{
stacks = (*itr)->GetStackAmount();
break;
}
}
if(stacks >= 5)
CastSpell(target,53739,true,NULL,triggeredByAura);
break;
}
// Light's Beacon (heal target area aura)
case 53651:
{
Expand Down Expand Up @@ -6177,6 +6147,43 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
beacon->CastCustomSpell(beacon,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura,pVictim->GetGUID());
return true;
}
// Seal of Corruption (damage calc on apply aura)
case 53736:
{
if(effIndex != 0) // effect 1,2 used by seal unleashing code
return false;

triggered_spell_id = 53742;

// Add 5-stack effect
int8 stacks = 0;
AuraList const& auras = target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{
if( ((*itr)->GetId() == 53742) && (*itr)->GetCasterGUID()==GetGUID())
{
stacks = (*itr)->GetStackAmount();
break;
}
}
if(stacks >= 5)
CastSpell(target,53739,true,NULL,triggeredByAura);
break;
}
// Glyph of Flash of Light
case 54936:
{
triggered_spell_id = 54957;
basepoints0 = triggerAmount*damage/100;
break;
}
// Glyph of Holy Light
case 54937:
{
triggered_spell_id = 54968;
basepoints0 = triggerAmount*damage/100;
break;
}
// Glyph of Divinity
case 54939:
{
Expand All @@ -6190,18 +6197,23 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
return true;
}
// Glyph of Flash of Light
case 54936:
// Sacred Shield (buff)
case 58597:
{
triggered_spell_id = 54957;
basepoints0 = triggerAmount*damage/100;
triggered_spell_id = 66922;
SpellEntry const* triggeredEntry = sSpellStore.LookupEntry(triggered_spell_id);
if (!triggeredEntry)
return false;

basepoints0 = int32(damage / (GetSpellDuration(triggeredEntry) / triggeredEntry->EffectAmplitude[0]));
target = this;
break;
}
// Glyph of Holy Light
case 54937:
// Sacred Shield (talent rank)
case 53601:
{
triggered_spell_id = 54968;
basepoints0 = triggerAmount*damage/100;
triggered_spell_id = 58597;
target = this;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8929"
#define REVISION_NR "8930"
#endif // __REVISION_NR_H__
2 changes: 1 addition & 1 deletion src/shared/revision_sql.h
@@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_8874_01_characters_character_skills"
#define REVISION_DB_MANGOS "required_8929_01_mangos_gossip_scripts"
#define REVISION_DB_MANGOS "required_8930_01_mangos_spell_proc_event"
#define REVISION_DB_REALMD "required_8728_01_realmd_account"
#endif // __REVISION_SQL_H__

7 comments on commit 81b4744

@insider42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EN: i found a bug, when you try to heal with 48785 under 58597 buff - yes it triggers 66922, but 66922 will trigger 57345
RU: нашёл баг, если пытаться лечить Вспышкой света 6-тисекундным бафом (58597) от Священного щита, то вы вспышка будет иметь периодический эффект, НО этот периодических эффект заставляет срабатывать Величие (57345) БЕЗ наличия самого аксессуара, а также обновлять 6-тисекундный баф (58597) при каждом тике, вне зависимости от наличия в поле Cooldown каких-либо значений отличных от 0. Я вообще голым без талантов этот баф (величие) получаю в этой комбинации. Просьба принять меры.

EN: another bug with this talent - you forgot to add 6 second cooldown
update spell_proc_event set Cooldown=6 where entry=58597;

@insider42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to easy reproduce this you can do .aura 58597 and use flash of light on self many times, until 57345 become triggered (without any equipped items ofcourse)
here my server logs with log_file_level=3 http://paste2.org/p/577593

@insider42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug still exists, 57345 can proc from 66922 without items

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 sec cooldown added in [9070].

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ut 66922 will trigger 57345

This is impossible: this aura apply at equip and then can't be in normal way at character.
Possible it just stuck by some reason at your character

@insider42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i will test it with new character and reply if bug persists

@insider42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reproduced with new character, but i found a reason, this because of garbage in my database at playercreateinfo tables :/
there is no bug with clean table from mangos.sql

Please sign in to comment.