Advertisement
Guest User

Untitled

a guest
Jan 4th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. // Lightning Overload
  2. if (dummySpell->SpellIconID == 2018) // only this spell have SpellFamily Shaman SpellIconID == 2018 and dummy aura
  3. {
  4. if (!procSpell || GetTypeId() != TYPEID_PLAYER || !victim)
  5. return false;
  6.  
  7. // custom cooldown processing case
  8. if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(dummySpell->Id))
  9. return false;
  10.  
  11. uint32 spellId = 0;
  12. // Every Lightning Bolt and Chain Lightning spell have duplicate vs half damage and zero cost
  13. switch (procSpell->Id)
  14. {
  15. // Lightning Bolt
  16. case 403: spellId = 45284; break; // Rank 1
  17. case 529: spellId = 45286; break; // Rank 2
  18. case 548: spellId = 45287; break; // Rank 3
  19. case 915: spellId = 45288; break; // Rank 4
  20. case 943: spellId = 45289; break; // Rank 5
  21. case 6041: spellId = 45290; break; // Rank 6
  22. case 10391: spellId = 45291; break; // Rank 7
  23. case 10392: spellId = 45292; break; // Rank 8
  24. case 15207: spellId = 45293; break; // Rank 9
  25. case 15208: spellId = 45294; break; // Rank 10
  26. case 25448: spellId = 45295; break; // Rank 11
  27. case 25449: spellId = 45296; break; // Rank 12
  28. case 49237: spellId = 49239; break; // Rank 13
  29. case 49238: spellId = 49240; break; // Rank 14
  30. // Chain Lightning
  31. case 421: spellId = 45297; break; // Rank 1
  32. case 930: spellId = 45298; break; // Rank 2
  33. case 2860: spellId = 45299; break; // Rank 3
  34. case 10605: spellId = 45300; break; // Rank 4
  35. case 25439: spellId = 45301; break; // Rank 5
  36. case 25442: spellId = 45302; break; // Rank 6
  37. case 49270: spellId = 49268; break; // Rank 7
  38. case 49271: spellId = 49269; break; // Rank 8
  39. default:
  40. sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id);
  41. return false;
  42. }
  43.  
  44. // Chain Lightning
  45. if (procSpell->SpellFamilyFlags[0] & 0x2)
  46. {
  47. // Chain lightning has [LightOverload_Proc_Chance] / [Max_Number_of_Targets] chance to proc of each individual target hit.
  48. // A maxed LO would have a 33% / 3 = 11% chance to proc of each target.
  49. // LO chance was already "accounted" at the proc chance roll, now need to divide the chance by [Max_Number_of_Targets]
  50. float chance = 100.0f / procSpell->Effects[effIndex].ChainTarget;
  51. if (!roll_chance_f(chance))
  52. return false;
  53.  
  54. // Remove cooldown (Chain Lightning - have Category Recovery time)
  55. ToPlayer()->RemoveSpellCooldown(spellId);
  56. }
  57.  
  58. CastSpell(victim, spellId, true, castItem, triggeredByAura);
  59.  
  60. if (cooldown && GetTypeId() == TYPEID_PLAYER)
  61. ToPlayer()->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown);
  62.  
  63. return true;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement