Skip to content

Commit

Permalink
[11452] Implement spell 14537 effects.
Browse files Browse the repository at this point in the history
Also re-add in correct way sql update for prev. commit.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
stfxpi authored and VladimirMangos committed May 9, 2011
1 parent ea490ba commit a9b664a
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 4 deletions.
8 changes: 6 additions & 2 deletions 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_11433_01_mangos_item_template` bit(1) default NULL
`required_11452_02_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 @@ -14664,9 +14664,13 @@ INSERT INTO `spell_bonus_data` VALUES
(17712, 0, 0, 0, 0, 'Item - Lifestone Healing'),
(5707, 0, 0, 0, 0, 'Item - Lifestone Regeneration'),
(43733, 0, 0, 0, 0, 'Item - Lightning Zap'),
(71824, 0, 0, 0, 0, 'Item - Shaman T9 Elemental 4P Bonus'),
(38395, 0, 0, 0, 0, 'Item - Siphon Essence'),
(40293, 0, 0, 0, 0, 'Item - Siphon Essence'),
(71824, 0, 0, 0, 0, 'Item - Shaman T9 Elemental 4P Bonus');
(21179, 0, 0, 0, 0, 'Item - Six Demon Bag - Chain Lightning'),
(15662, 0, 0, 0, 0, 'Item - Six Demon Bag - Fireball'),
(11538, 0, 0, 0, 0, 'Item - Six Demon Bag - Frostbolt');

/*!40000 ALTER TABLE `spell_bonus_data` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down
7 changes: 7 additions & 0 deletions sql/updates/11452_01_mangos_spell_bonus_data.sql
@@ -0,0 +1,7 @@
ALTER TABLE db_version CHANGE COLUMN required_11433_01_mangos_item_template required_11452_01_mangos_spell_bonus_data bit;

DELETE FROM spell_bonus_data WHERE entry IN (15662, 11538, 21179);
INSERT INTO spell_bonus_data VALUES
(15662, 0, 0, 0, 0, 'Item - Six Demon Bag - Fireball'),
(11538, 0, 0, 0, 0, 'Item - Six Demon Bag - Frostbolt'),
(21179, 0, 0, 0, 0, 'Item - Six Demon Bag - Chain Lightning');
@@ -1,3 +1,5 @@
ALTER TABLE db_version CHANGE COLUMN required_11452_01_mangos_spell_bonus_data required_11452_02_mangos_spell_proc_event bit;

DELETE FROM spell_proc_event WHERE entry = 63156;
INSERT INTO spell_proc_event VALUES
(63156, 0x00, 5, 0x00000001, 0x00000001, 0x00000001, 0x000000C0, 0x000000C0, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
31 changes: 31 additions & 0 deletions src/game/SpellEffects.cpp
Expand Up @@ -887,6 +887,37 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
}
return;
}
case 14537: // Six Demon Bag
{
if (!unitTarget)
return;

Unit* newTarget = unitTarget;
uint32 spell_id = 0;
uint32 roll = urand(0, 99);
if (roll < 25) // Fireball (25% chance)
spell_id = 15662;
else if (roll < 50) // Frostbolt (25% chance)
spell_id = 11538;
else if (roll < 70) // Chain Lighting (20% chance)
spell_id = 21179;
else if (roll < 80) // Polymorph (10% chance)
{
spell_id = 14621;
if (urand(0, 9) < 3) // 30% chance to self-cast

This comment has been minimized.

Copy link
@DomGries

DomGries May 9, 2011

Contributor

you could also write ... if (roll < 73) ... to prevent calculating the random number in this line - one might be enough :)

This comment has been minimized.

Copy link
@VladimirMangos

VladimirMangos May 13, 2011

Use 2 random roll seq. in same code can also can be problematic from real "randomness" of rolled values. Fix added into [11480]. Thank you.

newTarget = m_caster;
}
else if (roll < 95) // Enveloping Winds (15% chance)
spell_id = 25189;
else // Summon Felhund minion (5% chance)
{
spell_id = 14642;
newTarget = m_caster;
}

m_caster->CastSpell(newTarget, spell_id, true, m_CastItem);
return;
}
case 15998: // Capture Worg Pup
case 29435: // Capture Female Kaliri Hatchling
{
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 "11451"
#define REVISION_NR "11452"
#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_11436_01_characters_character_queststatus"
#define REVISION_DB_MANGOS "required_11433_01_mangos_item_template"
#define REVISION_DB_MANGOS "required_11452_02_mangos_spell_proc_event"
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
#endif // __REVISION_SQL_H__

0 comments on commit a9b664a

Please sign in to comment.