aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/CalendarHandler.cpp41
-rw-r--r--src/game/Level2.cpp2
-rw-r--r--src/game/SpellAuras.cpp53
-rw-r--r--src/game/Unit.cpp156
-rw-r--r--src/shared/revision.h4
-rw-r--r--src/shared/revision_nr.h2
6 files changed, 191 insertions, 67 deletions
diff --git a/src/game/CalendarHandler.cpp b/src/game/CalendarHandler.cpp
index fd2858646c2..6b1484bcbab 100644
--- a/src/game/CalendarHandler.cpp
+++ b/src/game/CalendarHandler.cpp
@@ -22,11 +22,52 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Opcodes.h"
+#include "InstanceSaveMgr.h"
+
+
void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
{
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR");
recv_data.hexlike();
+
+ time_t cur_time = time(NULL);
+
+ WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR,4+4*0+4+4*0+4+4);
+
+ // TODO: calendar invite event output
+ data << (uint32) 0; //invite node count
+ // TODO: calendar event output
+ data << (uint32) 0; //event count
+
+ data << (uint32) 0; //wtf??
+ data << (uint32) secsToTimeBitFields(cur_time); // current time
+
+ uint32 counter = 0;
+ size_t p_counter = data.wpos();
+ data << uint32(counter); // instance save count
+
+ for(int i = 0; i < TOTAL_DIFFICULTIES; ++i)
+ {
+ for (Player::BoundInstancesMap::iterator itr = _player->m_boundInstances[i].begin(); itr != _player->m_boundInstances[i].end(); ++itr)
+ {
+ if(itr->second.perm)
+ {
+ InstanceSave *save = itr->second.save;
+ data << uint32(save->GetMapId());
+ data << uint32(save->GetDifficulty());
+ data << uint32(save->GetResetTime() - cur_time);
+ data << uint64(save->GetInstanceId()); // instance save id as unique instance copy id
+ ++counter;
+ }
+ }
+ }
+ data.put<uint32>(p_counter,counter);
+
+ data << (uint32) 1135753200; //wtf?? (28.12.2005 12:00)
+ sLog.outDebug("Sending calendar");
+ //data.hexlike();
+ SendPacket(&data);
}
void WorldSession::HandleCalendarGetEvent(WorldPacket &recv_data)
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 63b00300639..89a845e697c 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -1692,12 +1692,10 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
{
-
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str());
}
else
{
-
PSendSysMessage(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str());
}
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 3cf59160187..c67fd23bdec 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5637,59 +5637,6 @@ void Aura::PeriodicTick()
//pdamage = pCaster->SpellDamageBonus(m_target,GetSpellProto(),pdamage,DOT);
- // talent Soul Siphon add bonus to Drain Life spells
- if( GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags & 0x8) )
- {
- // find talent max bonus percentage
- Unit::AuraList const& mClassScriptAuras = pCaster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(Unit::AuraList::const_iterator i = mClassScriptAuras.begin(); i != mClassScriptAuras.end(); ++i)
- {
- if ((*i)->GetModifier()->m_miscvalue == 4992 || (*i)->GetModifier()->m_miscvalue == 4993)
- {
- if((*i)->GetEffIndex()!=1)
- {
- sLog.outError("Expected spell %u structure change, need code update",(*i)->GetId());
- break;
- }
-
- // effect 1 m_amount
- int32 maxPercent = (*i)->GetModifier()->m_amount;
- // effect 0 m_amount
- int32 stepPercent = pCaster->CalculateSpellDamage((*i)->GetSpellProto(),0,(*i)->GetSpellProto()->EffectBasePoints[0],pCaster);
-
- // count affliction effects and calc additional damage in percentage
- int32 modPercent = 0;
- Unit::AuraMap const& victimAuras = m_target->GetAuras();
- for (Unit::AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
- {
- Aura* aura = itr->second;
- if (aura->IsPositive())continue;
- SpellEntry const* m_spell = aura->GetSpellProto();
- if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK)
- continue;
-
- SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(m_spell->Id);
- SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(m_spell->Id);
-
- for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
- {
- if(_spell_idx->second->skillId == SKILL_AFFLICTION)
- {
- modPercent += stepPercent;
- if (modPercent >= maxPercent)
- {
- modPercent = maxPercent;
- break;
- }
- }
- }
- }
- pdamage += (pdamage*modPercent/100);
- break;
- }
- }
- }
-
//As of 2.2 resilience reduces damage from DoT ticks as much as the chance to not be critically hit
// Reduce dot damage from resilience for players
if (m_target->GetTypeId()==TYPEID_PLAYER)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 9d768454c18..608597174c8 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7720,19 +7720,157 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
if( (*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto) )
TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
- // .. taken pct: scripted (increases damage of * against targets *)
- AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ // done scripted mod (take it from owner)
+ Unit *owner = GetOwner();
+ if (!owner) owner = this;
+ AuraList const& mOverrideClassScript= owner->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
+ if (!(*i)->isAffectedOnSpell(spellProto))
+ continue;
switch((*i)->GetModifier()->m_miscvalue)
{
- //Molten Fury
- case 4920: case 4919:
+ // Molten Fury
+ case 4920:
+ case 4919:
+ {
if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
- TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f; break;
+ TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
+ break;
+ }
+ // Soul Siphon
+ case 4992:
+ case 4993:
+ {
+ // effect 1 m_amount
+ int32 maxPercent = (*i)->GetModifier()->m_amount;
+ // effect 0 m_amount
+ int32 stepPercent = CalculateSpellDamage((*i)->GetSpellProto(), 0, (*i)->GetSpellProto()->EffectBasePoints[0], this);
+ // count affliction effects and calc additional damage in percentage
+ int32 modPercent = 0;
+ Unit::AuraMap const& victimAuras = pVictim->GetAuras();
+ for (Unit::AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
+ {
+ SpellEntry const* m_spell = itr->second->GetSpellProto();
+ if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK || !(m_spell->SpellFamilyFlags & 0x0004071B8044C402LL))
+ continue;
+ modPercent += stepPercent;
+ if (modPercent >= maxPercent)
+ {
+ modPercent = maxPercent;
+ break;
+ }
+ }
+ DoneTotalMod *= (modPercent+100.0f)/100.0f;
+ break;
+ }
+ // Starfire Bonus
+ case 5481:
+ {
+ AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+ for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ {
+ SpellEntry const* m_spell = (*itr)->GetSpellProto();
+ if (m_spell->SpellFamilyName == SPELLFAMILY_DRUID &&
+ m_spell->SpellFamilyFlags & 0x0000000000200002LL)
+ {
+ DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
+ break;
+ }
+ }
+ break;
+ }
+ case 4418: // Increased Shock Damage
+ case 4554: // Increased Lightning Damage
+ case 4555: // Improved Moonfire
+ case 5142: // Increased Lightning Damage
+ case 5147: // Improved Consecration
+ case 5148: // Idol of the Shooting Star
+ case 6008: // Increased Lightning Damage / Totem of Hex
+ {
+ pdamage+=(*i)->GetModifier()->m_amount;
+ break;
+ }
+ // Tundra Stalker
+ // Merciless Combat
+ case 7277:
+ {
+ // Merciless Combat
+ if ((*i)->GetSpellProto()->SpellIconID == 2656)
+ {
+ if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
+ TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
+ }
+ else // Tundra Stalker
+ {
+ AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
+ for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ {
+ SpellEntry const* m_spell = (*itr)->GetSpellProto();
+ if (m_spell->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
+ m_spell->SpellFamilyFlags & 0x0400000000000000LL)
+ {
+ DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ case 7293:
+ {
+ AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+ for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ {
+ SpellEntry const* m_spell = (*itr)->GetSpellProto();
+ if (m_spell->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
+ m_spell->SpellFamilyFlags & 0x0200000000000000LL)
+ {
+ DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
+ break;
+ }
+ }
+ break;
+ }
+ // Twisted Faith
+ case 7377:
+ {
+ AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+ for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ {
+ SpellEntry const* m_spell = (*itr)->GetSpellProto();
+ if (m_spell->SpellFamilyName == SPELLFAMILY_PRIEST &&
+ m_spell->SpellFamilyFlags & 0x0000000000008000LL &&
+ (*itr)->GetCasterGUID()==GetGUID())
+ {
+ DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
+ break;
+ }
+ }
+ break;
+ }
+ // Marked for Death
+ case 7598:
+ case 7599:
+ case 7600:
+ case 7601:
+ case 7602:
+ {
+ AuraList const& auras = pVictim->GetAurasByType(SPELL_AURA_MOD_STALKED);
+ for(AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ {
+ SpellEntry const* m_spell = (*itr)->GetSpellProto();
+ if (m_spell->SpellFamilyName == SPELLFAMILY_HUNTER &&
+ m_spell->SpellFamilyFlags & 0x0000000000000400LL)
+ {
+ DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
+ break;
+ }
+ }
+ break;
+ }
}
}
-
// .. taken pct: dummy auras
AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
@@ -7752,8 +7890,8 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
}
break;
//This is changed in WLK, using aura 255
- //Mangle
- case 2312:
+ // Mangle
+ /*case 2312:
case 44955:
for(int j=0;j<3;j++)
{
@@ -7763,7 +7901,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
break;
}
}
- break;
+ break;*/
}
}
diff --git a/src/shared/revision.h b/src/shared/revision.h
index fcee9b895b3..fcfb3898983 100644
--- a/src/shared/revision.h
+++ b/src/shared/revision.h
@@ -1,7 +1,7 @@
#ifndef __REVISION_H__
#define __REVISION_H__
- #define _REVISION "1083"
- #define _HASH "b79b2c3d242f"
+ #define _REVISION "1087"
+ #define _HASH "89fbd8b03c1a"
#define _REVISION_DATE "*"
#define _REVISION_TIME "*"
#endif // __REVISION_H__
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index aecd6e404c8..7b21feb017a 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "7183"
+ #define REVISION_NR "7187"
#endif // __REVISION_NR_H__