Merge remote-tracking branch 'origin/master' into mmaps

Conflicts:
	src/server/game/Movement/Spline/MoveSplineInit.cpp
This commit is contained in:
Nay
2012-09-08 01:32:47 +01:00
18 changed files with 136 additions and 44 deletions
@@ -0,0 +1,2 @@
ALTER TABLE `characters` MODIFY `name`
VARCHAR(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
@@ -0,0 +1 @@
UPDATE `creature_template` SET `unit_flags2`=`unit_flags2`|0x800; -- UNIT_FLAG2_REGENERATE_POWER
@@ -0,0 +1,3 @@
DELETE FROM spell_script_names WHERE spell_id = -755;
INSERT IGNORE INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(-755, 'spell_warl_health_funnel');
@@ -0,0 +1,6 @@
DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (10304,10313);
INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES
(10304,5,62320,0,''),
(10304,12,0,0,''),
(10313,5,62320,0,''),
(10313,12,1,0,'');
+1 -1
View File
@@ -409,7 +409,7 @@ bool AuthSocket::_HandleLogonChallenge()
PreparedQueryResult banresult = LoginDatabase.Query(stmt); PreparedQueryResult banresult = LoginDatabase.Query(stmt);
if (banresult) if (banresult)
{ {
if ((*banresult)[0].GetUInt64() == (*banresult)[1].GetUInt64()) if ((*banresult)[0].GetUInt32() == (*banresult)[1].GetUInt32())
{ {
pkt << uint8(WOW_FAIL_BANNED); pkt << uint8(WOW_FAIL_BANNED);
sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
@@ -1951,6 +1951,20 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
delete targets; delete targets;
break; break;
} }
case SMART_ACTION_SET_HOME_POS:
{
if (!me)
break;
if (e.GetTargetType() == SMART_TARGET_SELF)
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
else if (e.GetTargetType() == SMART_TARGET_POSITION)
me->SetHomePosition(e.target.x, e.target.y, e.target.z, e.target.o);
else
sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SET_HOME_POS is not using SMART_TARGET_SELF or SMART_TARGET_POSITION, skipping");
break;
}
default: default:
sLog->outError(LOG_FILTER_SQL, "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); sLog->outError(LOG_FILTER_SQL, "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break; break;
@@ -904,6 +904,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SEND_GOSSIP_MENU: case SMART_ACTION_SEND_GOSSIP_MENU:
case SMART_ACTION_GO_SET_LOOT_STATE: case SMART_ACTION_GO_SET_LOOT_STATE:
case SMART_ACTION_SEND_TARGET_TO_TARGET: case SMART_ACTION_SEND_TARGET_TO_TARGET:
case SMART_ACTION_SET_HOME_POS:
break; break;
default: default:
sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id); sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
@@ -484,8 +484,9 @@ enum SMART_ACTION
SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId
SMART_ACTION_GO_SET_LOOT_STATE = 99, // state SMART_ACTION_GO_SET_LOOT_STATE = 99, // state
SMART_ACTION_SEND_TARGET_TO_TARGET = 100, // id SMART_ACTION_SEND_TARGET_TO_TARGET = 100, // id
SMART_ACTION_SET_HOME_POS = 101, // none
SMART_ACTION_END = 101, SMART_ACTION_END = 102,
}; };
struct SmartAction struct SmartAction
+1 -1
View File
@@ -29,7 +29,7 @@ class Player;
enum LFGenum enum LFGenum
{ {
LFG_TIME_ROLECHECK = 2*MINUTE, LFG_TIME_ROLECHECK = 40*IN_MILLISECONDS,
LFG_TIME_BOOT = 2*MINUTE, LFG_TIME_BOOT = 2*MINUTE,
LFG_TIME_PROPOSAL = 2*MINUTE, LFG_TIME_PROPOSAL = 2*MINUTE,
LFG_TANKS_NEEDED = 1, LFG_TANKS_NEEDED = 1,
+3 -2
View File
@@ -14723,13 +14723,14 @@ bool Player::CanSeeStartQuest(Quest const* quest)
bool Player::CanTakeQuest(Quest const* quest, bool msg) bool Player::CanTakeQuest(Quest const* quest, bool msg)
{ {
return SatisfyQuestStatus(quest, msg) && SatisfyQuestExclusiveGroup(quest, msg) return !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this)
&& SatisfyQuestStatus(quest, msg) && SatisfyQuestExclusiveGroup(quest, msg)
&& SatisfyQuestClass(quest, msg) && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg) && SatisfyQuestClass(quest, msg) && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg)
&& SatisfyQuestSkill(quest, msg) && SatisfyQuestReputation(quest, msg) && SatisfyQuestSkill(quest, msg) && SatisfyQuestReputation(quest, msg)
&& SatisfyQuestPreviousQuest(quest, msg) && SatisfyQuestTimed(quest, msg) && SatisfyQuestPreviousQuest(quest, msg) && SatisfyQuestTimed(quest, msg)
&& SatisfyQuestNextChain(quest, msg) && SatisfyQuestPrevChain(quest, msg) && SatisfyQuestNextChain(quest, msg) && SatisfyQuestPrevChain(quest, msg)
&& SatisfyQuestDay(quest, msg) && SatisfyQuestWeek(quest, msg) && SatisfyQuestDay(quest, msg) && SatisfyQuestWeek(quest, msg)
&& SatisfyQuestSeasonal(quest,msg) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this) && SatisfyQuestSeasonal(quest,msg)
&& SatisfyQuestConditions(quest, msg); && SatisfyQuestConditions(quest, msg);
} }
+30 -31
View File
@@ -4305,12 +4305,17 @@ uint32 Unit::GetDoTsByCaster(uint64 casterGUID) const
int32 Unit::GetTotalAuraModifier(AuraType auratype) const int32 Unit::GetTotalAuraModifier(AuraType auratype) const
{ {
std::map<SpellGroup, int32> SameEffectSpellGroup;
int32 modifier = 0; int32 modifier = 0;
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup))
modifier += (*i)->GetAmount(); modifier += (*i)->GetAmount();
for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr)
modifier += itr->second;
return modifier; return modifier;
} }
@@ -4353,14 +4358,19 @@ int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype) const
int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
{ {
std::map<SpellGroup, int32> SameEffectSpellGroup;
int32 modifier = 0; int32 modifier = 0;
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
{ if ((*i)->GetMiscValue() & misc_mask)
if ((*i)->GetMiscValue()& misc_mask) if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup))
modifier += (*i)->GetAmount(); modifier += (*i)->GetAmount();
}
for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr)
modifier += itr->second;
return modifier; return modifier;
} }
@@ -6672,34 +6682,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
CastCustomSpell(target, triggered_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura); CastCustomSpell(target, triggered_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura);
return true; return true;
} }
// Sacred Shield
if (dummySpell->SpellFamilyFlags[1] & 0x80000)
{
if (procFlag & PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS)
{
if (procSpell->SpellFamilyName == SPELLFAMILY_PALADIN && (procSpell->SpellFamilyFlags[0] & 0x40000000))
{
basepoints0 = damage / 12;
if (basepoints0)
CastCustomSpell(this, 66922, &basepoints0, NULL, NULL, true, 0, triggeredByAura, victim->GetGUID());
return true;
}
else
return false;
}
else if (damage > 0)
triggered_spell_id = 58597;
// Item - Paladin T8 Holy 4P Bonus
if (Unit* caster = triggeredByAura->GetCaster())
if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0))
cooldown = aurEff->GetAmount();
target = this;
break;
}
// Righteous Vengeance // Righteous Vengeance
if (dummySpell->SpellIconID == 3025) if (dummySpell->SpellIconID == 3025)
{ {
@@ -6720,6 +6702,23 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
} }
switch (dummySpell->Id) switch (dummySpell->Id)
{ {
// Sacred Shield
case 53601:
{
if (procFlag & PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS)
return false;
if (damage > 0)
triggered_spell_id = 58597;
// Item - Paladin T8 Holy 4P Bonus
if (Unit* caster = triggeredByAura->GetCaster())
if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0))
cooldown = aurEff->GetAmount();
target = this;
break;
}
// Heart of the Crusader // Heart of the Crusader
case 20335: // rank 1 case 20335: // rank 1
triggered_spell_id = 21183; triggered_spell_id = 21183;
+8 -4
View File
@@ -84,9 +84,13 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data)
unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect" unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect"
} }
void WorldSession::HandleUnlearnSkillOpcode(WorldPacket & recv_data) void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recvData)
{ {
uint32 skill_id; uint32 skillId;
recv_data >> skill_id; recvData >> skillId;
GetPlayer()->SetSkill(skill_id, 0, 0, 0);
if (!IsPrimaryProfessionSkill(skillId))
return;
GetPlayer()->SetSkill(skillId, 0, 0, 0);
} }
@@ -167,6 +167,7 @@ void MoveSpline::Initialize(const MoveSplineInitArgs& args)
point_Idx_offset = args.path_Idx_offset; point_Idx_offset = args.path_Idx_offset;
initialOrientation = args.initialOrientation; initialOrientation = args.initialOrientation;
onTransport = false;
time_passed = 0; time_passed = 0;
vertical_acceleration = 0.f; vertical_acceleration = 0.f;
effect_start_time = 0; effect_start_time = 0;
@@ -118,6 +118,7 @@ namespace Movement
const Vector3 CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx+1) : Vector3();} const Vector3 CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx+1) : Vector3();}
int32 currentPathIdx() const; int32 currentPathIdx() const;
bool onTransport;
std::string ToString() const; std::string ToString() const;
}; };
} }
@@ -71,10 +71,11 @@ namespace Movement
real_position.z = unit->GetTransOffsetZ(); real_position.z = unit->GetTransOffsetZ();
real_position.orientation = unit->GetTransOffsetO(); real_position.orientation = unit->GetTransOffsetO();
} }
// there is a big chance that current position is unknown if current state is not finalized, need compute it // there is a big chance that current position is unknown if current state is not finalized, need compute it
// this also allows CalculatePath spline position and update map position in much greater intervals // this also allows CalculatePath spline position and update map position in much greater intervals
// Don't compute for transport movement. The unit could be in a motion between two transports, thus having transport moveflag but is resulting in regular positions // Don't compute for transport movement if the unit is in a motion between two transports
else if (!move_spline.Finalized()) if (!move_spline.Finalized() && move_spline.onTransport == transport)
real_position = move_spline.ComputePosition(); real_position = move_spline.ComputePosition();
// should i do the things that user should do? - no. // should i do the things that user should do? - no.
@@ -84,6 +85,7 @@ namespace Movement
// corrent first vertex // corrent first vertex
args.path[0] = real_position; args.path[0] = real_position;
args.initialOrientation = real_position.orientation; args.initialOrientation = real_position.orientation;
move_spline.onTransport = transport;
uint32 moveFlags = unit->m_movementInfo.GetMovementFlags(); uint32 moveFlags = unit->m_movementInfo.GetMovementFlags();
if (args.flags.walkmode) if (args.flags.walkmode)
+5
View File
@@ -1200,6 +1200,11 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_AUTOBROADCAST] = ConfigMgr::GetBoolDefault("AutoBroadcast.On", false); m_bool_configs[CONFIG_AUTOBROADCAST] = ConfigMgr::GetBoolDefault("AutoBroadcast.On", false);
m_int_configs[CONFIG_AUTOBROADCAST_CENTER] = ConfigMgr::GetIntDefault("AutoBroadcast.Center", 0); m_int_configs[CONFIG_AUTOBROADCAST_CENTER] = ConfigMgr::GetIntDefault("AutoBroadcast.Center", 0);
m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = ConfigMgr::GetIntDefault("AutoBroadcast.Timer", 60000); m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = ConfigMgr::GetIntDefault("AutoBroadcast.Timer", 60000);
if (reload)
{
m_timers[WUPDATE_AUTOBROADCAST].SetInterval(m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL]);
m_timers[WUPDATE_AUTOBROADCAST].Reset();
}
// MySQL ping time interval // MySQL ping time interval
m_int_configs[CONFIG_DB_PING_INTERVAL] = ConfigMgr::GetIntDefault("MaxPingTime", 30); m_int_configs[CONFIG_DB_PING_INTERVAL] = ConfigMgr::GetIntDefault("MaxPingTime", 30);
@@ -329,6 +329,8 @@ public:
// used to despawn corpse immediately // used to despawn corpse immediately
me->DespawnOrUnsummon(); me->DespawnOrUnsummon();
} }
void UpdateAI(uint32 const diff) {}
}; };
}; };
@@ -438,6 +440,8 @@ public:
// used to despawn corpse immediately // used to despawn corpse immediately
me->DespawnOrUnsummon(); me->DespawnOrUnsummon();
} }
void UpdateAI(uint32 const diff) {}
}; };
}; };
@@ -41,6 +41,10 @@ enum WarlockSpells
WARLOCK_HAUNT_HEAL = 48210, WARLOCK_HAUNT_HEAL = 48210,
WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
WARLOCK_CURSE_OF_DOOM_EFFECT = 18662, WARLOCK_CURSE_OF_DOOM_EFFECT = 18662,
WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703,
WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704,
WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955,
WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956,
}; };
class spell_warl_banish : public SpellScriptLoader class spell_warl_banish : public SpellScriptLoader
@@ -671,6 +675,48 @@ class spell_warl_curse_of_doom : public SpellScriptLoader
} }
}; };
class spell_warl_health_funnel : public SpellScriptLoader
{
public:
spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { }
class spell_warl_health_funnel_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_health_funnel_AuraScript)
void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
Unit* target = GetTarget();
if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2))
target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true);
else if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1))
target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true);
}
void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1);
target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2);
}
void Register()
{
OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_health_funnel_AuraScript();
}
};
void AddSC_warlock_spell_scripts() void AddSC_warlock_spell_scripts()
{ {
new spell_warl_banish(); new spell_warl_banish();
@@ -686,4 +732,5 @@ void AddSC_warlock_spell_scripts()
new spell_warl_haunt(); new spell_warl_haunt();
new spell_warl_unstable_affliction(); new spell_warl_unstable_affliction();
new spell_warl_curse_of_doom(); new spell_warl_curse_of_doom();
new spell_warl_health_funnel();
} }