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

Conflicts:
	sql/base/characters_database.sql
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Handlers/CharacterHandler.cpp
This commit is contained in:
Nay committed 2012-09-09 02:18:58 +01:00
commit 7c4e7a9ebc
20 files changed
+149 -39

No files matched your search

+2 -2
View File
@@ -1220,7 +1220,7 @@ DROP TABLE IF EXISTS `characters`;
CREATE TABLE `characters` (
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`account` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account Identifier',
`name` varchar(12) NOT NULL DEFAULT '',
`name` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`slot` tinyint(3) unsigned NOT NULL DEFAULT '0',
`race` tinyint(3) unsigned NOT NULL DEFAULT '0',
`class` tinyint(3) unsigned NOT NULL DEFAULT '0',
@@ -2419,4 +2419,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2012-09-05 18:59:26
-- Dump completed on 2012-09-08 15:27:29
@@ -0,0 +1 @@
UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (32930,33909); -- Kologarn
@@ -0,0 +1,10 @@
-- Criteria data for achievement 'Wrecking Ball'
DELETE FROM `disables` WHERE `sourceType`=4 AND `entry` IN (3368, 3369, 3370, 12578, 7623, 3371);
DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (3368, 3369, 3370, 12578, 7623, 3371);
INSERT INTO `achievement_criteria_data`(`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES
(3368,2,0,0,''),
(3369,2,0,0,''),
(3370,2,0,0,''),
(12578,2,0,0,''),
(7623,2,0,0,''),
(3371,2,0,0,'');
@@ -0,0 +1,4 @@
DELETE FROM `command` WHERE `name` = 'start';
DELETE FROM `command` WHERE `name` = 'unstuck';
INSERT INTO `command` (`name`, `security`, `help`) VALUES
('unstuck', 0, 'Syntax: .unstuck $playername [inn/graveyard/startzone]\n\nTeleports specified player to specified location. Default location is player\'s current hearth location.');
@@ -0,0 +1,3 @@
DELETE FROM `trinity_string` WHERE `entry`=63; -- Existing entry 63 is not present in Language.h. It's safe to remove it.
INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
(63, 'You can''t do that right now.');
@@ -1708,6 +1708,11 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
float dy = y - GetPositionY();
float dz = z - GetPositionZ();
float dist = sqrt(dx*dx + dy*dy);
//! Check if the distance between the 2 objects is 0, can happen if both objects are on the same position.
//! The code below this check wont crash if dist is 0 because 0/0 in float operations is valid, and returns infinite
if (G3D::fuzzyEq(dist, 0.0f))
return true;
float sinB = dx / dist;
float cosB = dy / dist;
dx = dist * (cosA * cosB + sinA * sinB);
@@ -2691,6 +2691,15 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
return go;
}
GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float range) const
{
GameObject* go = NULL;
Trinity::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
VisitNearbyGridObject(range, searcher);
return go;
}
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry, float maxSearchRange) const
{
CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
+1
View File
@@ -878,6 +878,7 @@ class WorldObject : public Object, public WorldLocation
Creature* FindNearestCreature(uint32 entry, float range, bool alive = true) const;
GameObject* FindNearestGameObject(uint32 entry, float range) const;
GameObject* FindNearestGameObjectOfType(GameobjectTypes type, float range) const;
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
+1 -1
View File
@@ -14733,7 +14733,7 @@ bool Player::CanSeeStartQuest(Quest const* quest)
bool Player::CanTakeQuest(Quest const* quest, bool msg)
{
return !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this)
return !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this)
&& SatisfyQuestStatus(quest, msg) && SatisfyQuestExclusiveGroup(quest, msg)
&& SatisfyQuestClass(quest, msg) && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg)
&& SatisfyQuestSkill(quest, msg) && SatisfyQuestReputation(quest, msg)
+4 -4
View File
@@ -4233,10 +4233,10 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask)
if ((*i)->GetMiscValue() & misc_mask)
if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup))
modifier += (*i)->GetAmount();
for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr)
modifier += itr->second;
return modifier;
}
@@ -12372,13 +12372,13 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in
}
break;
case SPELLFAMILY_PALADIN:
if (spellProto->SpellFamilyFlags[0] & 0x00000002)
if (spellProto->SpellFamilyFlags[0] & 0x00000002 && spellProto->SpellIconID == 298)
{
// Glyph of Blessing of Might
if (AuraEffect* aurEff = GetAuraEffect(57958, 0))
duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS;
}
else if (spellProto->SpellFamilyFlags[0] & 0x00010000)
else if (spellProto->SpellFamilyFlags[0] & 0x00010000 && spellProto->SpellIconID == 306)
{
// Glyph of Blessing of Wisdom
if (AuraEffect* aurEff = GetAuraEffect(57979, 0))
+5
View File
@@ -7275,6 +7275,11 @@ uint8 ObjectMgr::CheckPlayerName(const std::string& name, bool create)
if (!isValidString(wname, strictMask, false, create))
return CHAR_NAME_MIXED_LANGUAGES;
wstrToLower(wname);
for (size_t i = 2; i < wname.size(); ++i)
if (wname[i] == wname[i-1] && wname[i] == wname[i-2])
return CHAR_NAME_THREE_CONSECUTIVE;
return CHAR_NAME_SUCCESS;
}
@@ -694,6 +694,30 @@ namespace Trinity
NearestGameObjectEntryInObjectRangeCheck(NearestGameObjectEntryInObjectRangeCheck const&);
};
// Success at unit in range, range update for next check (this can be use with GameobjectLastSearcher to find nearest GO with a certain type)
class NearestGameObjectTypeInObjectRangeCheck
{
public:
NearestGameObjectTypeInObjectRangeCheck(WorldObject const& obj, GameobjectTypes type, float range) : i_obj(obj), i_type(type), i_range(range) {}
bool operator()(GameObject* go)
{
if (go->GetGoType() == i_type && i_obj.IsWithinDistInMap(go, i_range))
{
i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
return true;
}
return false;
}
float GetLastRange() const { return i_range; }
private:
WorldObject const& i_obj;
GameobjectTypes i_type;
float i_range;
// prevent clone this object
NearestGameObjectTypeInObjectRangeCheck(NearestGameObjectTypeInObjectRangeCheck const&);
};
class GameObjectWithDbGUIDCheck
{
public:
@@ -1396,6 +1396,23 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender()))
return;
uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor);
if (!go)
{
WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4);
data << uint32(2);
SendPacket(&data);
return;
}
if (_player->getStandState() != UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight)
{
WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4);
data << uint32(2);
SendPacket(&data);
return;
}
uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor);
// 0 - ok
+2 -1
View File
@@ -86,7 +86,8 @@ enum TrinityStrings
LANG_CONNECTED_PLAYERS = 60,
LANG_ACCOUNT_ADDON = 61,
LANG_IMPROPER_VALUE = 62,
// Room for more level 0 63-99 not used
LANG_CANT_DO_NOW = 63,
// Room for more level 0 64-99 not used
// level 1 chat
LANG_GLOBAL_NOTIFY = 100,
+2 -2
View File
@@ -917,7 +917,7 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa
{
case TARGET_UNIT_CHANNEL_TARGET:
{
WorldObject* target = ObjectAccessor::GetUnit(*m_caster, channeledSpell->m_targets.GetUnitTargetGUID());
WorldObject* target = ObjectAccessor::GetUnit(*m_caster, m_originalCaster->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT));
CallScriptObjectTargetSelectHandlers(target, effIndex);
// unit target may be no longer avalible - teleported out of map for example
if (target && target->ToUnit())
@@ -929,7 +929,7 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa
case TARGET_DEST_CHANNEL_TARGET:
if (channeledSpell->m_targets.HasDst())
m_targets.SetDst(channeledSpell->m_targets);
else if (WorldObject* target = ObjectAccessor::GetWorldObject(*m_caster, channeledSpell->m_targets.GetObjectTargetGUID()))
else if (WorldObject* target = ObjectAccessor::GetWorldObject(*m_caster, m_originalCaster->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT)))
{
CallScriptObjectTargetSelectHandlers(target, effIndex);
if (target)
-4
View File
@@ -1237,10 +1237,6 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
bool SpellInfo::CanDispelAura(SpellInfo const* aura) const
{
// These auras (like ressurection sickness) can't be dispelled
if (aura->Attributes & SPELL_ATTR0_NEGATIVE_1)
return false;
// These spells (like Mass Dispel) can dispell all auras
if (Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)
return true;
+49 -15
View File
@@ -81,7 +81,7 @@ public:
{ "save", SEC_PLAYER, false, &HandleSaveCommand, "", NULL },
{ "saveall", SEC_MODERATOR, true, &HandleSaveAllCommand, "", NULL },
{ "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "", NULL },
{ "start", SEC_PLAYER, false, &HandleStartCommand, "", NULL },
{ "unstuck", SEC_PLAYER, true, &HandleUnstuckCommand, "", NULL },
{ "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "", NULL },
{ "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "", NULL },
{ "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "", NULL },
@@ -928,34 +928,68 @@ public:
return true;
}
static bool HandleStartCommand(ChatHandler* handler, char const* /*args*/)
static bool HandleUnstuckCommand(ChatHandler* handler, char const* args)
{
Player* player = handler->GetSession()->GetPlayer();
if (player->isInFlight())
//No args required for players
if (handler->GetSession() && AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity()))
{
handler->SendSysMessage(LANG_YOU_IN_FLIGHT);
Player* player = handler->GetSession()->GetPlayer();
if (player->isInFlight() || player->isInCombat())
{
handler->SendSysMessage(LANG_CANT_DO_NOW);
handler->SetSentErrorMessage(true);
return false;
}
//7355: "Stuck"
player->CastSpell(player, 7355, false);
return true;
}
if (!*args)
return false;
char* player_str = strtok((char*)args, " ");
if (!player_str)
return false;
char* location_str = strtok(NULL, "");
if (!location_str)
location_str = "inn";
Player* player = NULL;
std::string playerName;
if (!handler->extractPlayerTarget((char*)player_str, &player, NULL, &playerName))
return false;
if (player->isInFlight() || player->isInCombat())
{
handler->SendSysMessage(LANG_CANT_DO_NOW);
handler->SetSentErrorMessage(true);
return false;
}
if (player->isInCombat())
if (!stricmp(location_str, "inn"))
{
handler->SendSysMessage(LANG_YOU_IN_COMBAT);
handler->SetSentErrorMessage(true);
return false;
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
return true;
}
if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
if (!stricmp(location_str, "graveyard"))
{
// if player is dead and stuck, send ghost to graveyard
player->RepopAtGraveyard();
return true;
}
// cast spell Stuck
player->CastSpell(player, 7355, false);
return true;
if (!stricmp(location_str, "startzone"))
{
player->TeleportTo(player->GetStartPosition());
return true;
}
//Not a supported argument
return false;
}
static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args)
+1 -1
View File
@@ -447,7 +447,7 @@ class npc_muglash : public CreatureScript
DoScriptText(SAY_MUG_START1, creature);
creature->setFaction(113);
pEscortAI->Start(true, true, player->GetGUID());
pEscortAI->Start(true, false, player->GetGUID());
}
}
return true;
@@ -330,7 +330,7 @@ public:
me->DespawnOrUnsummon();
}
void UpdateAI(uint32 const diff) {}
void UpdateAI(uint32 const /*diff*/) {}
};
};
@@ -441,7 +441,7 @@ public:
me->DespawnOrUnsummon();
}
void UpdateAI(uint32 const diff) {}
void UpdateAI(uint32 const /*diff*/) {}
};
};
+7 -7
View File
@@ -679,38 +679,38 @@ 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)
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();