@@ -1600,12 +1600,16 @@ class spell_sha_flametongue_weapon : public AuraScript
16001600 // if (!item || !item->IsEquipped())
16011601 // return false;
16021602
1603- Item* item = eventInfo.GetCastItem ();
1604- if (!item && actor->IsPlayer ())
1605- item = actor->ToPlayer ()->GetItemByGuid (GetAura ()->GetCastItemGUID ());
1603+ ObjectGuid itemGuid = GetAura ()->GetCastItemGUID ();
1604+ Item* item = nullptr ;
16061605
1607- if (!item || (actor->IsPlayer () && !item->IsEquipped ()))
1608- return false ;
1606+ if (actor->IsPlayer ())
1607+ item = actor->ToPlayer ()->GetItemByGuid (itemGuid);
1608+ else if (actor->IsNPCBot ())
1609+ item = actor->ToCreature ()->GetBotEquipsByGuid (itemGuid);
1610+
1611+ if (!item)
1612+ return false ; // Use 'return false;' if this is inside CheckProc (a bool function)
16091613
16101614 // WeaponAttackType attType = Player::GetAttackBySlot(item->GetSlot());
16111615 // if (attType != BASE_ATTACK && attType != OFF_ATTACK)
@@ -1653,14 +1657,13 @@ class spell_sha_flametongue_weapon : public AuraScript
16531657 // return;
16541658
16551659 // npcbot: Item detection for both players and bots
1656- Item* item = eventInfo.GetCastItem ();
1657- if (!item)
1658- {
1659- if (actor->IsPlayer ())
1660- item = actor->ToPlayer ()->GetWeaponForAttack (attType);
1661- else if (actor->IsNPCBot ())
1662- item = actor->ToCreature ()->GetBotEquips (attType == BASE_ATTACK ? 0 : 1 );
1663- }
1660+ ObjectGuid itemGuid = GetAura ()->GetCastItemGUID ();
1661+ Item* item = nullptr ;
1662+
1663+ if (actor->IsPlayer ())
1664+ item = actor->ToPlayer ()->GetWeaponForAttack (attType);
1665+ else if (actor->IsNPCBot ())
1666+ item = actor->ToCreature ()->GetBotEquipsByGuid (itemGuid);
16641667
16651668 if (!item) return ;
16661669
@@ -2234,12 +2237,16 @@ class spell_sha_windfury_weapon : public AuraScript
22342237 // return false;
22352238
22362239 // Get the item responsible for the proc
2237- Item* item = eventInfo.GetCastItem ();
2238- if (!item && actor->IsPlayer ())
2239- item = actor->ToPlayer ()->GetItemByGuid (GetAura ()->GetCastItemGUID ());
2240+ ObjectGuid itemGuid = GetAura ()->GetCastItemGUID ();
2241+ Item* item = nullptr ;
22402242
2241- if (!item || (actor->IsPlayer () && !item->IsEquipped ()))
2242- return false ;
2243+ if (actor->IsPlayer ())
2244+ item = actor->ToPlayer ()->GetItemByGuid (itemGuid);
2245+ else if (actor->IsNPCBot ())
2246+ item = actor->ToCreature ()->GetBotEquipsByGuid (itemGuid);
2247+
2248+ if (!item)
2249+ return false ; // Use 'return false;' if this is inside CheckProc (a bool function)
22432250
22442251 // WeaponAttackType attType = Player::GetAttackBySlot(item->GetSlot());
22452252 // if (attType != BASE_ATTACK && attType != OFF_ATTACK)
@@ -2283,10 +2290,16 @@ class spell_sha_windfury_weapon : public AuraScript
22832290 // if (!item)
22842291 // return;
22852292
2286- Item* item = eventInfo.GetCastItem ();
2287- if (!item && actor->IsPlayer ())
2288- item = actor->ToPlayer ()->GetItemByGuid (GetAura ()->GetCastItemGUID ());
2289- if (!item) return ;
2293+ ObjectGuid itemGuid = GetAura ()->GetCastItemGUID ();
2294+ Item* item = nullptr ;
2295+
2296+ if (actor->IsPlayer ())
2297+ item = actor->ToPlayer ()->GetItemByGuid (itemGuid);
2298+ else if (actor->IsNPCBot ())
2299+ item = actor->ToCreature ()->GetBotEquipsByGuid (itemGuid);
2300+
2301+ if (!item)
2302+ return ;
22902303
22912304 // uint8 slot = item->GetSlot();
22922305 // bool mainHand = slot == EQUIPMENT_SLOT_MAINHAND;
@@ -2323,6 +2336,9 @@ class spell_sha_windfury_weapon : public AuraScript
23232336 // int32 bonus = windfurySpellInfo ? windfurySpellInfo->Effects[EFFECT_1].CalcValue(player) : 0;
23242337 // bonus = int32(bonus * player->GetAttackTime(mainHand ? BASE_ATTACK : OFF_ATTACK) / 1000.f);
23252338
2339+ // Calculation is now unified for both types
2340+ int32 bonus = spellInfo ? spellInfo->Effects [EFFECT_1].CalcValue (actor) : 0 ;
2341+ bonus = int32 (bonus * actor->GetAttackTime (mainHand ? BASE_ATTACK : OFF_ATTACK) / 1000 .f );
23262342
23272343 // player->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, bonus, target, true, item, aurEff);
23282344 // player->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, bonus, target, true, item, aurEff);
0 commit comments