-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy path1.txt
760 lines (718 loc) · 30.1 KB
/
1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 91edb44..58495de 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -313,12 +313,7 @@ void Battleground::Update(uint32 diff)
// Update start time and reset stats timer
m_StartTime += diff;
- if (GetStatus() == STATUS_WAIT_JOIN)
- {
- m_ResetStatTimer += diff;
- m_CountdownTimer += diff;
- }
- m_ValidStartPositionTimer += diff;
+ m_ResetStatTimer += diff;
PostUpdateImpl(diff);
}
@@ -476,8 +471,10 @@ inline void Battleground::_ProcessJoin(uint32 diff)
// *** BATTLEGROUND STARTING SYSTEM ***
// *********************************************************
ModifyStartDelayTime(diff);
+ ModifyCountdownTimer(diff);
- if (!isArena())
+ // I know it's a too big but it's the value sent in packet, I get it from retail sniff.
+ // I think it's link to the countdown when bgs start
SetRemainingTime(300000);
if (m_ResetStatTimer > 5000)
@@ -488,23 +485,6 @@ inline void Battleground::_ProcessJoin(uint32 diff)
player->ResetAllPowers();
}
- // Send packet every 10 seconds until the 2nd field reach 0
- if (m_CountdownTimer >= 10000)
- {
- uint32 countdownMaxForBGType = isArena() ? ARENA_COUNTDOWN_MAX : BATTLEGROUND_COUNTDOWN_MAX;
-
- WorldPacket data(SMSG_START_TIMER, 4+4+4);
- data << uint32(0); // unk
- data << uint32(countdownMaxForBGType - (m_CountdownTimer / 1000));
- data << uint32(countdownMaxForBGType);
-
- for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
- if (Player* player = ObjectAccessor::FindPlayer(itr->first))
- player->GetSession()->SendPacket(&data);
-
- m_CountdownTimer = 0;
- }
-
if (!(m_Events & BG_STARTING_EVENT_1))
{
m_Events |= BG_STARTING_EVENT_1;
@@ -525,6 +505,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
StartingEventCloseDoors();
SetStartDelayTime(StartDelayTimes[BG_STARTING_EVENT_FIRST]);
+ SetCountdownTimer(StartDelayTimes[BG_STARTING_EVENT_FIRST]);
// First start warning - 2 or 1 minute
SendMessageToAll(StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
@@ -1281,6 +1262,10 @@ void Battleground::AddPlayer(Player* player)
}
}
+ // Send last message for player if he missed it
+ if (GetStartDelayTime() <= 59000 && GetStartDelayTime() >= 0)
+ SendMessageToPlayer(m_lastMessageId, CHAT_MSG_BG_SYSTEM_NEUTRAL, player);
+
player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
player->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true);
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 2e2f2e8..3c87a95 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -1234,7 +1234,6 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 1.0f);
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 1.0f);
SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_SPELL)));
-
break;
}
case 19833: // Snake Trap - Venomous Snake
@@ -1316,6 +1315,19 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
SetCreateHealth(m_owner->CountPctFromMaxHealth(10));
break;
}
+ // Guardian of Ancient Kings
+ case 46506:
+ {
+ if (Player* pOwner = m_owner->ToPlayer())
+ {
+ m_modMeleeHitChance = pOwner->GetFloatValue(PLAYER_FIELD_UI_HIT_MODIFIER) + pOwner->GetRatingBonusValue(CR_HIT_MELEE);
+ m_baseSpellCritChance = pOwner->GetFloatValue(PLAYER_CRIT_PERCENTAGE) + pOwner->GetRatingBonusValue(CR_HIT_SPELL);
+ }
+
+ SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0.75f * m_owner->GetFloatValue(UNIT_FIELD_MINDAMAGE));
+ SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0.75f * m_owner->GetFloatValue(UNIT_FIELD_MAXDAMAGE));
+ break;
+ }
default:
break;
}
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 522c5f5..a71fab1 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -9458,6 +9458,9 @@ void Player::_ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackTy
AuraEffectList const& auraDamagePctList = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for (AuraEffectList::const_iterator itr = auraDamagePctList.begin(); itr != auraDamagePctList.end(); ++itr)
_ApplyWeaponDependentAuraDamageMod(item, attackType, *itr, apply);
+
+ UpdateMeleeHitChances();
+ UpdateRangedHitChances();
}
void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attackType, constAuraEffectPtr aura, bool apply)
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index 3f3e54b..fbeae17 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -476,8 +476,9 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
if (IsInFeralForm()) //check if player is druid and in cat or bear forms
{
float weaponSpeed = BASE_ATTACK_TIME / 1000.f;
- if (Item* weapon = GetWeaponForAttack(BASE_ATTACK, true))
- weaponSpeed = weapon->GetTemplate()->Delay / 1000;
+ if (Item* weapon = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
+ if (weapon->GetTemplate()->Class == ITEM_CLASS_WEAPON)
+ weaponSpeed = float(0.001f * weapon->GetTemplate()->Delay);
if (GetShapeshiftForm() == FORM_CAT)
{
@@ -760,7 +761,18 @@ void Player::UpdateMasteryPercentage()
void Player::UpdateMeleeHitChances()
{
- m_modMeleeHitChance = (float)GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
+ m_modMeleeHitChance = 0;
+ AuraEffectList const & alist = GetAuraEffectsByType(SPELL_AURA_MOD_HIT_CHANCE);
+ Item *weapon = this->GetWeaponForAttack(BASE_ATTACK);
+ for (AuraEffectList::const_iterator itr = alist.begin(); itr != alist.end(); ++itr)
+ {
+ if ((*itr)->GetSpellInfo()->EquippedItemSubClassMask && !weapon)
+ continue;
+ if (weapon && !weapon->IsFitToSpellRequirements((*itr)->GetSpellInfo()))
+ continue;
+ m_modMeleeHitChance += (*itr)->GetAmount();
+ }
+ SetFloatValue(PLAYER_FIELD_UI_HIT_MODIFIER, m_modMeleeHitChance);
m_modMeleeHitChance += GetRatingBonusValue(CR_HIT_MELEE);
if (Pet* pet = GetPet())
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 00904eb..2b37ff2 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -859,13 +859,19 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
switch (cleanDamage->attackType)
{
case BASE_ATTACK:
+ {
weaponSpeedHitFactor = uint32(GetAttackTime(cleanDamage->attackType) / 1000.0f * 6.5f);
RewardRage(weaponSpeedHitFactor, true);
break;
+ }
case OFF_ATTACK:
+ {
weaponSpeedHitFactor = uint32(GetAttackTime(cleanDamage->attackType) / 1000.0f * 3.25f);
RewardRage(weaponSpeedHitFactor, true);
break;
+ }
+ case RANGED_ATTACK:
+ break;
default:
break;
}
@@ -893,7 +899,9 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
{
// Rage from absorbed damage
if (cleanDamage && cleanDamage->absorbed_damage && victim->getPowerType() == POWER_RAGE)
+ {
victim->RewardRage(cleanDamage->absorbed_damage, false);
+ }
return 0;
}
@@ -7419,6 +7427,14 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffectPtr trigge
{
switch (dummySpell->Id)
{
+ // Lava Surge
+ case 77755:
+ case 77756:
+ {
+ triggered_spell_id = 77762;
+ target = this;
+ break;
+ }
case 120676:// Stormlash Totem
{
// -- http://www.wowhead.com/spell=120668#comments:id=1707196
@@ -20400,16 +20416,35 @@ void Unit::RewardRage(uint32 baseRage, bool attacker)
{
float addRage = baseRage;
- // talent who gave more rage on attack
if (attacker)
+ {
+ // talent who gave more rage on attack
addRage *= 1.0f + GetTotalAuraModifier(SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT) / 100.0f;
+
+ // Sentinel - Protection Warrior Mastery
+ if (AuraEffectPtr aurEff = GetAuraEffect(29144, 1))
+ if (getVictim() && (!getVictim()->getVictim() || (getVictim()->getVictim() && this != getVictim()->getVictim())))
+ addRage *= float((aurEff->GetAmount() + 100.0f) / 100.0f);
+ }
else
{
- addRage /= (GetMaxHealth() / 100);
+ addRage /= (GetCreateHealth()/35);
// Generate rage from damage taken only in Berserker Stance
if (!HasAura(2458))
return;
+
+ // Berserker Rage effect
+ if (HasAura(18499))
+ {
+ float mod = 2.0f;
+
+ // Unshackled Fury (Mastery Fury Warrior)
+ if (AuraPtr aura = GetAura(76856))
+ mod += float(aura->GetEffect(0)->GetAmount() / 100.0f);
+
+ addRage *= mod;
+ }
}
ModifyPower(POWER_RAGE, uint32(addRage * 10));
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 8603621..282c678 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2225,8 +2225,11 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui
if (quality > ITEM_QUALITY_ARTIFACT)
return 0;
+ if (itemClass != ITEM_CLASS_ARMOR)
+ return 0;
+
// all items but shields
- if (itemClass != ITEM_CLASS_ARMOR || itemSubclass != ITEM_SUBCLASS_ARMOR_SHIELD)
+ if (itemSubclass != ITEM_SUBCLASS_ARMOR_SHIELD)
{
ItemArmorQualityEntry const* armorQuality = sItemArmorQualityStore.LookupEntry(itemlevel);
ItemArmorTotalEntry const* armorTotal = sItemArmorTotalStore.LookupEntry(itemlevel);
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index 770a84a..f820f99 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -458,7 +458,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
if (deletePacket)
delete packet;
-#define MAX_PROCESSED_PACKETS_IN_SAME_WORLDSESSION_UPDATE 100
+#define MAX_PROCESSED_PACKETS_IN_SAME_WORLDSESSION_UPDATE 200
processedPackets++;
//process only a max amout of packets in 1 Update() call.
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index a6a2852..70db38f 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1174,6 +1174,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
m_fixed_periodic.SetFixedTotalDamage(temp_damage * (GetBase()->GetMaxDuration() / GetAmplitude()));
hasFixedPeriodic = true;
+ amount = temp_damage;
}
}
}
@@ -1817,9 +1818,6 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
spellId2 = 48629;
spellId3 = 106840;
break;
- case FORM_TREE:
- spellId = 34123;
- break;
case FORM_TRAVEL:
spellId = 5419;
break;
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index b6655df..046cac8 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1801,6 +1801,23 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
{
switch (GetSpellInfo()->Id)
{
+ // Tree of Life
+ case 33891:
+ {
+ if (apply)
+ {
+ caster->CastSpell(caster, 5420, true);
+ caster->CastSpell(caster, 81097, true);
+ caster->CastSpell(caster, 81098, true);
+ }
+ else
+ {
+ caster->RemoveAurasDueToSpell(5420);
+ caster->RemoveAurasDueToSpell(81097);
+ caster->RemoveAurasDueToSpell(81098);
+ }
+ break;
+ }
case 5229: // Enrage
if (target->HasAura(70726)) // Item - Druid T10 Feral 4P Bonus
if (apply)
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 38063f7..9269a5e 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5559,7 +5559,8 @@ void Spell::TakePower()
{
if (m_CastItem || m_triggeredByAuraSpell)
return;
- //Don't take power if the spell is cast while .cheat power is enabled.
+
+ // Don't take power if the spell is cast while .cheat power is enabled.
if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_POWER))
@@ -5570,9 +5571,12 @@ void Spell::TakePower()
bool hit = true;
if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
- if (powerType == POWER_RAGE || powerType == POWER_ENERGY || powerType == POWER_RUNES)
+ if (powerType == POWER_HOLY_POWER || powerType == POWER_ENERGY || powerType == POWER_RUNES)
+ {
if (uint64 targetGUID = m_targets.GetUnitTargetGUID())
+ {
for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
+ {
if (ihit->targetGUID == targetGUID)
{
if (ihit->missCondition != SPELL_MISS_NONE)
@@ -5584,8 +5588,11 @@ void Spell::TakePower()
}
break;
}
+ }
+ }
+ }
}
-
+
if (powerType == POWER_RUNES)
{
TakeRunePower(hit);
@@ -5620,7 +5627,7 @@ void Spell::TakePower()
if (hit)
m_caster->ModifyPower(powerType, -m_powerCost);
else
- m_caster->ModifyPower(powerType, -irand(0, m_powerCost/4));
+ m_caster->ModifyPower(powerType, -CalculatePct(m_powerCost, 20)); // Refund 80% of power on fail 4.x
}
void Spell::TakeAmmo()
@@ -6813,6 +6820,18 @@ SpellCastResult Spell::CheckCast(bool strict)
break;
}
+ case SPELL_AURA_MOD_HEALTH_REGEN_PERCENT:
+ {
+ // Health Funnel
+ if (m_spellInfo->Id == 755)
+ {
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (Pet * pet = m_caster->ToPlayer()->GetPet())
+ if (pet->IsFullHealth())
+ return SPELL_FAILED_ALREADY_AT_FULL_HEALTH;
+ }
+ break;
+ }
default:
break;
}
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 9e62743..c4b0449 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -857,6 +857,15 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
{
switch (m_spellInfo->Id)
{
+ // Lava Surge
+ case 77762:
+ {
+ if (m_caster->GetTypeId() != TYPEID_PLAYER)
+ return;
+
+ m_caster->ToPlayer()->RemoveSpellCooldown(51505, true);
+ return;
+ }
case 128997:// Spirit Beast Blessing
{
m_caster->CastSpell(m_caster, 127830, true);
@@ -2492,7 +2501,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
if (level_diff > 0)
damage -= level_multiplier * level_diff;
- if (damage < 0)
+ if (!damage)
return;
if (unitTarget->GetMaxPower(power) == 0)
@@ -5094,16 +5103,7 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/)
unitTarget->getHostileRefManager().UpdateVisibility();
- Unit::AttackerSet const& attackers = unitTarget->getAttackers();
- for (Unit::AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
- {
- if (!(*itr)->canSeeOrDetect(unitTarget))
- (*(itr++))->AttackStop();
- else
- ++itr;
- }
-
- unitTarget->m_lastSanctuaryTime = getMSTime();
+ unitTarget->CombatStop(false);
// Vanish allows to remove all threat and cast regular stealth so other spells can be used
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->Id == 131369)
@@ -5113,6 +5113,9 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/)
if (m_caster->ToPlayer()->HasSpell(58426))
m_caster->CastSpell(m_caster, 58427, true);
}
+ else if(!IsTriggered())
+ unitTarget->m_lastSanctuaryTime = getMSTime();
+
}
void Spell::EffectAddComboPoints(SpellEffIndex /*effIndex*/)
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index cbd0018..4b8c7b9 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -4225,6 +4225,14 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->Effects[EFFECT_0].TargetA = TARGET_UNIT_CASTER;
spellInfo->Effects[EFFECT_0].TargetB = 0;
break;
+ // Tree of Life
+ case 65139:
+ spellInfo->Effects[1].Effect = 0;
+ spellInfo->Effects[1].ApplyAuraName = 0;
+ break;
+ case 60206: // Ram
+ spellInfo->Effects[2].RadiusEntry = sSpellRadiusStore.LookupEntry(13);
+ break;
default:
break;
}
@@ -4870,9 +4878,6 @@ void SpellMgr::LoadDbcDataCorrections()
case 73530: // Shadow Trap (visual)
spellInfo->DurationIndex = 28; // 5 seconds
break;
- case 60206: // Ram
- spellInfo->EffectRadiusIndex[2] = EFFECT_RADIUS_10_YARDS;
- break;
case 73529: // Shadow Trap
spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_10_YARDS; // 10yd
break;
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index bcf0196..5c66448 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -43,7 +43,7 @@ enum PriestSpells
PRIEST_LEAP_OF_FAITH_JUMP = 110726,
PRIEST_INNER_WILL = 73413,
PRIEST_INNER_FIRE = 588,
- PRIEST_NPC_SHADOWY_APPARITION = 61966,
+ PRIEST_NPC_SHADOWY_APPARITION = 46954,
PRIEST_SPELL_HALO_HEAL_SHADOW = 120696,
PRIEST_SPELL_HALO_HEAL_HOLY = 120692,
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index c0e64dc..07cf16b 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -3334,72 +3334,6 @@ class npc_spirit_link_totem : public CreatureScript
};
/*######
-# npc_shadowy_apparition
-######*/
-
-class npc_shadowy_apparition : public CreatureScript
-{
- public:
- npc_shadowy_apparition() : CreatureScript("npc_shadowy_apparition") { }
-
- struct npc_shadowy_apparitionAI : public ScriptedAI
- {
- uint64 targetGUID;
-
- npc_shadowy_apparitionAI(Creature* creature) : ScriptedAI(creature)
- {
- targetGUID = 0;
- Unit* owner = creature->GetOwner();
-
- if (owner)
- {
- if (creature->GetEntry() == 61966)
- {
- owner->CastSpell(creature, 87213, true); // Clone player skin
- creature->CastSpell(creature, 87427, true); // Shadow aura
- creature->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, owner->GetGUID());
- creature->SetUInt32Value(UNIT_CREATED_BY_SPELL, 113724);
- creature->SetReactState(REACT_PASSIVE);
- }
- }
- }
-
- void SetGUID(uint64 guid, int32)
- {
- targetGUID = guid;
- }
-
- void UpdateAI(const uint32 diff)
- {
- Unit* owner = me->GetOwner();
-
- if (!owner)
- return;
-
- if (!me->HasAura(87213))
- owner->CastSpell(me, 87213, true); // Clone player skin
- else if (!me->HasAura(87427))
- me->CastSpell(me, 87427, true); // Shadow aura
-
- if (Unit* target = Unit::GetCreature(*me, targetGUID))
- {
- if (target->GetDistance(me) < 2.0f)
- {
- me->CastSpell(target, 87532, true); // Death Damage
- me->CastSpell(me, 87529, true); // Death visual
- me->ForcedDespawn();
- }
- }
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_shadowy_apparitionAI(creature);
- }
-};
-
-/*######
# npc_demoralizing_banner
######*/
@@ -3528,66 +3462,63 @@ enum GuardianSpellsAndEntries
class npc_guardian_of_ancient_kings : public CreatureScript
{
- public:
- npc_guardian_of_ancient_kings() : CreatureScript("npc_guardian_of_ancient_kings") { }
+public:
+ npc_guardian_of_ancient_kings() : CreatureScript("npc_guardian_of_ancient_kings") { }
- struct npc_guardian_of_ancient_kingsAI : public ScriptedAI
- {
- npc_guardian_of_ancient_kingsAI(Creature *creature) : ScriptedAI(creature) {}
+ CreatureAI *GetAI(Creature *creature) const
+ {
+ return new npc_guardian_of_ancient_kingsAI(creature);
+ }
- void Reset()
- {
- if (me->GetEntry() == NPC_RETRI_GUARDIAN || me->GetEntry() == NPC_HOLY_GUARDIAN)
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
- else if (me->GetEntry() == NPC_PROTECTION_GUARDIAN)
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
+ struct npc_guardian_of_ancient_kingsAI : public ScriptedAI
+ {
+ npc_guardian_of_ancient_kingsAI(Creature *c) : ScriptedAI(c)
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
+ }
- if (me->GetEntry() == NPC_RETRI_GUARDIAN)
- me->SetReactState(REACT_DEFENSIVE);
- else
- me->SetReactState(REACT_PASSIVE);
+ void Reset()
+ {
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
+
+ if (me->GetEntry() == NPC_RETRI_GUARDIAN)
+ me->SetReactState(REACT_AGGRESSIVE);
+ else
+ me->SetReactState(REACT_PASSIVE);
- if (me->GetEntry() == NPC_PROTECTION_GUARDIAN)
- {
- if (me->GetOwner())
- DoCast(me->GetOwner(), SPELL_ANCIENT_GUARDIAN_VISUAL);
- }
- else if (me->GetEntry() == NPC_RETRI_GUARDIAN)
+ if (me->GetEntry() == NPC_PROTECTION_GUARDIAN)
+ {
+ if (me->GetOwner())
+ DoCast(me->GetOwner(), SPELL_ANCIENT_GUARDIAN_VISUAL);
+ }
+ else if (me->GetEntry() == NPC_RETRI_GUARDIAN)
+ {
+ if (me->GetOwner())
{
- if (me->GetOwner())
- {
- if (me->GetOwner()->getVictim())
- AttackStart(me->GetOwner()->getVictim());
+ if (me->GetOwner()->getVictim())
+ AttackStart(me->GetOwner()->getVictim());
- DoCast(me, 86703, true);
- }
+ DoCast(me, 86703, true);
}
- else if (me->GetEntry() == NPC_HOLY_GUARDIAN)
- if (me->GetOwner())
- me->GetOwner()->CastSpell(me->GetOwner(), SPELL_ANCIENT_HEALER, true);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
+ }
+ }
- if (me->GetOwner())
- if (Unit* newVictim = me->GetOwner()->getVictim())
- if (me->getVictim() != newVictim)
- AttackStart(newVictim);
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
- if (me->HasUnitState(UNIT_STATE_CASTING))
- return;
+ if (me->GetOwner())
+ if (Unit* newVictim = me->GetOwner()->getVictim())
+ if (me->getVictim() != newVictim)
+ AttackStart(newVictim);
- DoMeleeAttackIfReady();
- }
- };
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_guardian_of_ancient_kingsAI(creature);
+ DoMeleeAttackIfReady();
}
+ };
};
/*######
@@ -4845,6 +4776,66 @@ class npc_spectral_guise : public CreatureScript
}
};
+/*######
+## npc_shadowy_apparition
+######*/
+
+class npc_shadowy_apparition : public CreatureScript
+{
+ public:
+ npc_shadowy_apparition() : CreatureScript("npc_shadowy_apparition") { }
+
+ CreatureAI *GetAI(Creature* pCreature) const
+ {
+ return new npc_shadowy_apparitionAI(pCreature);
+ }
+
+ struct npc_shadowy_apparitionAI : public ScriptedAI
+ {
+ npc_shadowy_apparitionAI(Creature* pCreature) : ScriptedAI(pCreature)
+ {
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_FEAR, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_ROOT, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_FREEZE, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_HORROR, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SAPPED, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_CHARM, true);
+ me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, true);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
+ me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
+ me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
+ me->SetSpeed(MOVE_RUN, 0.3f);
+ }
+
+ bool bCast;
+
+ void Reset()
+ {
+ bCast = false;
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (!me->getVictim() || me->getVictim()->isDead())
+ me->DespawnOrUnsummon();
+
+ if (!bCast && me->GetDistance(me->getVictim()) < 1.0f)
+ {
+ bCast = true;
+ me->CastSpell(me->getVictim(), 87532, true, NULL, NULL, (me->GetOwner() ? me->GetOwner()->GetGUID() : 0));
+ me->DespawnOrUnsummon();
+ }
+ }
+ };
+};
+
void AddSC_npcs_special()
{
new npc_air_force_bots();
@@ -4882,7 +4873,6 @@ void AddSC_npcs_special()
new npc_capacitor_totem();
new npc_feral_spirit();
new npc_spirit_link_totem();
- new npc_shadowy_apparition();
new npc_demoralizing_banner();
new npc_frozen_orb();
new npc_guardian_of_ancient_kings();
@@ -4906,4 +4896,5 @@ void AddSC_npcs_special()
new npc_void_tendrils();
new npc_psyfiend();
new npc_spectral_guise();
+ new npc_shadowy_apparition();
}