QAston
47d5fc51c5
*Item enchancment/proc patch - original code by Thenecromancer
...
-void Player::CastItemCombatSpell(Item *item,Unit* Target, WeaponAttackType attType)
-{
- if(!item || item->IsBroken())
- return;
-
- ItemPrototype const *proto = item->GetProto();
- if(!proto)
- return;
+void Player::CastItemCombatSpell(Item *item, CalcDamageInfo *damageInfo, ItemPrototype const * proto)
+{
+ Unit * Target = damageInfo->target;
+ WeaponAttackType attType = damageInfo->attackType;
if (!Target || Target == this )
return;
- for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
- {
- _Spell const& spellData = proto->Spells[i];
-
- // no spell
- if(!spellData.SpellId )
- continue;
-
- // wrong triggering type
- if(spellData.SpellTrigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT)
- continue;
-
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
- if(!spellInfo)
- {
- sLog.outError("WORLD: unknown Item spellid %i", spellData.SpellId);
- continue;
- }
-
- // not allow proc extra attack spell at extra attack
- if( m_extraAttacks && IsSpellHaveEffect(spellInfo,SPELL_EFFECT_ADD_EXTRA_ATTACKS) )
- return;
-
- float chance = spellInfo->procChance;
-
- if(spellData.SpellPPMRate)
- {
- uint32 WeaponSpeed = GetAttackTime(attType);
- chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo);
- }
- else if(chance > 100.0f)
- {
- chance = GetWeaponProcChance();
- }
-
- if (roll_chance_f(chance))
- CastSpell(Target, spellInfo->Id, true, item);
+ // Can do effect if any damage done to target
+ if (damageInfo->damage)
+ {
+ for (int i = 0; i < 5; i++)
+ {
+ _Spell const& spellData = proto->Spells[i];
+
+ // no spell
+ if(!spellData.SpellId )
+ continue;
+
+ // wrong triggering type
+ if(spellData.SpellTrigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT)
+ continue;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
+ if(!spellInfo)
+ {
+ sLog.outError("WORLD: unknown Item spellid %i", spellData.SpellId);
+ continue;
+ }
+
+ // not allow proc extra attack spell at extra attack
+ if( m_extraAttacks && IsSpellHaveEffect(spellInfo,SPELL_EFFECT_ADD_EXTRA_ATTACKS) )
+ return;
+
+ float chance = spellInfo->procChance;
+
+ if(spellData.SpellPPMRate)
+ {
+ uint32 WeaponSpeed = GetAttackTime(attType);
+ chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo);
+ }
+ else if(chance > 100.0f)
+ {
+ chance = GetWeaponProcChance();
+ }
+
+ if (roll_chance_f(chance))
+ CastSpell(Target, spellInfo->Id, true, item);
+ }
}
// item combat enchantments
@@ -6993,6 +6993,21 @@
if(pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
+ SpellEnchantProcEntry const* entry = spellmgr.GetSpellEnchantProcEvent(enchant_id);
+
+ if (entry && entry->procEx)
+ {
+ // Check hit/crit/dodge/parry requirement
+ if((entry->procEx & damageInfo->procEx) == 0)
+ continue;
+ }
+ else
+ {
+ // Can do effect if any damage done to target
+ if (!(damageInfo->damage))
+ continue;
+ }
+
SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]);
if (!spellInfo)
{
@@ -7001,6 +7016,18 @@
}
float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance();
+
+ if (entry && entry->PPMChance)
+ {
+ uint32 WeaponSpeed = GetAttackTime(attType);
+ chance = GetPPMProcChance(WeaponSpeed, entry->PPMChance, spellInfo);
+ }
+ else if (entry && entry->customChance)
+ chance = entry->customChance;
+
+ // Apply spell mods
+ ApplySpellMod(pEnchant->spellid[s],SPELLMOD_CHANCE_OF_SUCCESS,chance);
+
if (roll_chance_f(chance))
{
if(IsPositiveSpell(pEnchant->spellid[s]))
@@ -7012,6 +7039,7 @@
}
}
+
void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 cast_count, uint32 glyphIndex)
{
ItemPrototype const* proto = item->GetProto();
--HG--
branch : trunk
2009-05-15 16:37:22 +02:00
krz
ee40287ef7
Do not allow to proc spells if they can't stack with already active auras.
...
this fixes 13048 and 12292.
--HG--
branch : trunk
2009-05-14 14:35:09 +02:00
QAston
51b5f2aa64
*Allow Hots to proc-this should fix talents like 33776 effect from hots.
...
--HG--
branch : trunk
2009-05-11 23:46:45 +02:00
QAston
fcf0fdc1c1
*Item enchancment/proc patch - original code by Thenecromancer
...
--HG--
branch : trunk
2009-05-10 18:06:22 +02:00
megamage
979073cebd
*Update some spell attr flag. Use better way to check IsRangedSpell and UnaffectedByInvulnerability
...
--HG--
branch : trunk
2009-05-08 00:49:02 -05:00
megamage
ac3c58a2eb
*Fix the bug that fishing bobber does not have correct position.
...
--HG--
branch : trunk
2009-05-06 10:35:37 -05:00
megamage
4045c881ab
*add SPELL_ATTR_CU_EXCLUDE_SELF
...
--HG--
branch : trunk
2009-05-06 00:07:28 -05:00
megamage
5b9dae20b1
*Fix build. By Kudlaty.
...
--HG--
branch : trunk
2009-05-07 18:06:20 -05:00
mknjc
3703f4891d
Backported TC2 commit 3157 (megamage: *Fix the bug that fishing bobber does not have correct position.)
...
--HG--
branch : trunk
2009-05-07 18:20:55 +02:00
QAston
f9b13b45e0
*Fix grounding totem.
...
*Fix runic power regeneration of butchery
*Fix some problems with master of subtlety buff expire.
*Do not allow arcane intellect and brillance to stack.
--HG--
branch : trunk
2009-05-03 16:55:09 +02:00
megamage
9f0f239e60
*Merge.
...
*Also fix build in VC7 and VC8.
--HG--
branch : trunk
2009-05-02 13:30:55 -05:00
megamage
f303ee08c5
*Update spell selection.
...
--HG--
branch : trunk
2009-05-02 11:28:11 -05:00
megamage
db817d668a
*Merge.
...
--HG--
branch : trunk
2009-05-01 18:37:32 -05:00
megamage
5a66774008
*Fix the bug that shapeshift can remove blind.
...
--HG--
branch : trunk
2009-05-01 15:36:32 -05:00
QAston
0f5a9cb46f
*Implement enchanting vellums.
...
--HG--
branch : trunk
2009-05-01 15:40:49 +02:00
megamage
09af28301e
[7716] Fixed some typos and possible crashes. Author: AlexDereka
...
--HG--
branch : trunk
2009-04-27 18:42:35 -05:00
QAston
a00563a127
*Fix deadly brew.
...
*Some changes in flag SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY.
--HG--
branch : trunk
2009-04-25 18:53:29 +02:00
QAston
a731f9a3c0
*Update of procflag system:
...
-Improved holy concentration, Second wind and other spells which can trigger from triggered spells should work correctly now
-Allow potions to trigger
--HG--
branch : trunk
2009-04-18 21:25:48 +02:00
QAston
a13e6537e9
*Fix T.N.T proc chance
...
--HG--
branch : trunk
2009-04-13 18:56:29 +02:00
QAston
beab3e0125
*Fix some problems with ProcFlag
...
--HG--
branch : trunk
2009-04-13 15:52:59 +02:00
QAston
276084e294
*Fixes in pet levelup spell system-pets no longer learn triggered spells and can cow learn 2 spells for 1 level.
...
--HG--
branch : trunk
2009-04-06 14:54:56 +02:00
QAston
20c02ef760
*Update of aura system.
...
--HG--
branch : trunk
2009-04-06 13:31:14 +02:00
megamage
bc2f2bc56a
[7552] Move client version dependend DBC code to src/game. Author: VladimirMangos
...
--HG--
branch : trunk
2009-03-27 09:58:20 -06:00
QAston
ce71c0e798
*Update dispel code and fix crash related to it. Thanks to megamage.
...
--HG--
branch : trunk
2009-03-23 01:54:50 +01:00
megamage
ee332629b6
*Do not allow toggle unautocastable spells for pet.
...
--HG--
branch : trunk
2009-03-21 18:05:43 -06:00
QAston
3ff11b64ba
*Move Overkill and Master of Subtlety to procflag and fix some issues with them.
...
*Proc Shattered Barrier only on aura destroy.
*Fix some possible issues with aura stackamount display.
--HG--
branch : trunk
2009-03-19 10:40:02 +01:00
megamage
3eba06e4ad
*Use SpellCastResult and finaly fix SPELL_CAST_OK value (255 custom value now). By VladimirMangos.
...
--HG--
branch : trunk
2009-03-16 12:00:14 -06:00
megamage
3c9c17b253
[7463] Make basic preparations for replace 0 as ok spell cast value by more correct value. Author: VladimirMangos
...
Currently 0 used ast OK value for spell cast checks BUT 0 = SPELL_FAILED_AFFECTING_COMBAT
So another values need used. This required lot code changes. This is first step.
--HG--
branch : trunk
2009-03-15 17:22:19 -06:00
QAston
8b96182b1c
*Fix Shattered Barrier
...
--HG--
branch : trunk
2009-03-15 02:06:59 +01:00
QAston
0d5044863e
*Add procflag PROC_EX_AURA_REMOVE.
...
*Use new procflag to fix Psyhic Horror.
*Fix a typo in Living Bomb handler.
--HG--
branch : trunk
2009-03-13 22:48:04 +01:00
QAston
6683ae58c9
* Fix mind flay target requirements.
...
--HG--
branch : trunk
2009-03-11 22:27:07 +01:00
QAston
fec6be8a74
*Fix compile.
...
--HG--
branch : trunk
2009-03-10 21:53:11 +01:00
QAston
6fb63d3325
*Make scrolls not stackable.
...
--HG--
branch : trunk
2009-03-10 16:44:03 +01:00
megamage
985b7656bb
*Merge.
...
--HG--
branch : trunk
rename : sql/updates/XXX_characters_auctionhouse.sql => sql/updates/1164_characters.sql
2009-03-08 11:36:10 -06:00
KingPin
ae70787843
Extend the spell_disabled table to have a seperate flag for pet spells from player spells, Patch by Koani
...
--HG--
branch : trunk
2009-03-07 07:47:02 -05:00
QAston
ab2fa2e52c
*Fix amount of paladin's spells damage.
...
*Fix problems with aurastate remove.
--HG--
branch : trunk
2009-03-06 18:52:39 +01:00
megamage
1cdae46468
[7376] Allow store in spell_area.aura_spell negative values for "not has aura" requirement. Author: VladimirMangos
...
Also
* Allow have in aura_spell spells with SPELL_AURA_PHASE in first effect.
* Allow negative aura_spell chaining in spell_area table.
* Better check at loading duplicate data (by requiremnt set) in spell_area table.
--HG--
branch : trunk
2009-03-03 18:41:11 -06:00
megamage
b1677c901d
[7362] Use IN_MILISECONDS where appropriate, other cleanups. Author: VladimirMangos
...
--HG--
branch : trunk
2009-03-02 16:53:50 -06:00
megamage
adb19df474
[7349] Implement spell cast depenences from area/quest.aura state store in new table spell_area. Author: VladimirMangos
...
* It allow store requirenments: area, active or rewarded quest (until possible another quest not rewarded),
aura present at character, character race/gender.
* Listed spell can marked as auto-casted when fit requirents. In this case spell requirements checked at
zone/subzone update (and then resurraction also), quest start/reward, dummy aura apply.
* Old hardcoded lines for similar check removed from sources and required DB support for work now.
--HG--
branch : trunk
2009-02-27 12:53:27 -06:00
megamage
2dbe092d9f
[7348] Remove hack code from IsDeathPersistentSpell. Author: VladimirMangos
...
Re-apply zone dependent auras at resurrection by triggering zone update for player.
--HG--
branch : trunk
2009-02-27 12:28:10 -06:00
QAston
64540eff85
*Fix bug with spellproc.
...
*Fix bug with bloodthirst healing.
--HG--
branch : trunk
2009-02-25 21:15:38 +01:00
megamage
699bc588b8
[7330] Code warnings and style cleanups. Some bugs fixes. Author: VladimirMangos
...
1) comparison singed and unsigned values
2) redundent includes
3) wrong constructor :-part field initilization
4) unused not-/*name*/-guarded args in template/virtual functions that not required like args.
5) explicitly list not implemented achievement types.
Also bugs fixed:
1) Drop wrong phase mask 0 check in WorldObject::InSamePhase.
2) ArenaTeamMember::ModifyPersonalRating incorrect work with move points in negative with infinity values in result.
3) ArenaTeam::SaveToDB code send uint64 value to string with arg format %u.
--HG--
branch : trunk
2009-02-24 11:14:28 -06:00
megamage
4ecbdb128c
[7313] Optimized checks of presence in std::set Author: zhenya
...
--HG--
branch : trunk
2009-02-21 17:03:39 -06:00
megamage
50012743e8
*Merge.
...
--HG--
branch : trunk
2009-02-18 16:57:42 -06:00
megamage
0ff7fbcd7f
*Fix a crash caused by charm/possess spells.
...
--HG--
branch : trunk
2009-02-18 16:26:02 -06:00
megamage
31637d4aac
*Merge.
...
--HG--
branch : trunk
2009-02-18 11:36:19 -06:00
KingPin
14234c86fa
Newline added to bottom of all files.
...
--HG--
branch : trunk
2009-02-17 20:07:49 -06:00
QAston
14d85a183e
*Make range check dependent from target.
...
--HG--
branch : trunk
2009-02-14 15:56:04 +01:00
megamage
a72c0d223d
[7266] Use DBC data for auction cut/deposit percents and location (auiction house id in fact).
...
More auction related code refactoring,
Move auction related code from ObjectMgr to AuctionHouseMgr.
Author: VladimirMangos
--HG--
branch : trunk
2009-02-13 19:50:20 -06:00
megamage
ba7a8cc836
[7253] Check battleground status in GetSpellAllowedInLocationError for some spells for aura remove and spell casting cases. Author: VladimirMangos
...
--HG--
branch : trunk
2009-02-10 01:00:22 -06:00