casucristy

Untitled

Jul 27th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.76 KB | None | 0 0
  1. From ab2fa41322f5c02fdea66ca3d7abe80d04403c67 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Sat, 28 Jul 2012 06:01:17 +0300
  4. Subject: [PATCH] Fix talent Sin and Punishment - Priest (both effects).
  5.  
  6. ---
  7.  src/server/game/Entities/Unit/Unit.cpp |   69 +++++++++++++++++++++++++-------
  8.  1 file changed, 54 insertions(+), 15 deletions(-)
  9.  
  10. diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
  11. index 46207ff..95871d7 100644
  12. --- a/src/server/game/Entities/Unit/Unit.cpp
  13. +++ b/src/server/game/Entities/Unit/Unit.cpp
  14. @@ -3742,6 +3742,35 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId
  15.                      }
  16.                      return;
  17.                  }
  18. +               case SPELLFAMILY_PRIEST:
  19. +               {
  20. +                   if(aura->GetId() == 34914) //Vampiric Touch
  21. +                   {
  22. +                       Unit* caster = aura->GetCaster();
  23. +                       if(caster)
  24. +                       {
  25. +                           uint32 uChance = 0;
  26. +                           if(caster->HasAura(87099))
  27. +                               uChance = 50;
  28. +                           else if(caster->HasAura(87100))
  29. +                               uChance = 100;
  30. +                          
  31. +                           if(uChance && roll_chance_i(uChance))
  32. +                           {
  33. +                               std::list<Unit*> targets;
  34. +                               SkyFire::AnyUnfriendlyUnitInObjectRangeCheck u_check(dispeller,caster,10.0f);
  35. +                               SkyFire::UnitListSearcher<SkyFire::AnyUnfriendlyUnitInObjectRangeCheck> searcher(caster, targets,u_check);
  36. +                               dispeller->VisitNearbyObject(10.0f,searcher);
  37. +                               for (std::list<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
  38. +                               {
  39. +                                   if(caster->IsHostileTo(*iter))
  40. +                                       (*iter)->AddAura(87204,*iter);
  41. +                               }  
  42. +                           }
  43. +                       }
  44. +                   }
  45. +                   break;
  46. +               }
  47.                  default:
  48.                      break;
  49.              }
  50. @@ -6363,21 +6392,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
  51.  
  52.                      target = this;
  53.                      break;
  54. -                }
  55. -                // Sin and Punishment
  56. -                case 87100:
  57. -                case 87099:
  58. -                {
  59. -                    if (Player* caster = triggeredByAura->GetCaster()->ToPlayer())
  60. -                    {
  61. -                        if (caster->HasSpellCooldown(34433))
  62. -                        {
  63. -                            uint32 seconds = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcValue();
  64. -                            caster->UpdateSpellCooldown(34433, seconds);
  65. -                            return true;
  66. -                        }
  67. -                    }
  68. -                    return false;
  69.                  }                
  70.                  // Glyph of Prayer of Healing
  71.                  case 55680:
  72. @@ -11542,6 +11556,31 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage
  73.             if(unit = aura->GetCaster())
  74.                 unit->CastSpell(unit,85759);
  75.         }
  76. +       //mind flay crit
  77. +       else if(spellProto->Id == 15407)    //has sin and punishment talents
  78. +       {
  79. +            if (modOwner->HasSpellCooldown(34433)) //has cooldown at shadowfiend
  80. +            {
  81. +               uint32 seconds = 0;
  82. +
  83. +               if(modOwner->HasAura(87099))    //sin & punishment rank 1
  84. +                   seconds = -5;
  85. +               else if(modOwner->HasAura(87100))   //sin & punisment rank 2
  86. +                   seconds = -10;
  87. +
  88. +                uint32 curCooldown = modOwner->GetSpellCooldownDelay(34433);
  89. +
  90. +               curCooldown += seconds;
  91. +
  92. +               modOwner->AddSpellCooldown(34433, 0, uint32(time(NULL) + curCooldown));
  93. +
  94. +               WorldPacket data(SMSG_MODIFY_COOLDOWN, 4+8+4);
  95. +               data << uint32(34433);              
  96. +               data << uint64(GetGUID());              
  97. +               data << int32(seconds * 1000);          
  98. +               modOwner->GetSession()->SendPacket(&data);
  99. +            }
  100. +       }
  101.     }
  102.  
  103.      return damage;
  104. --
  105. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment