mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
Merge branch 'master' into Playerbot
This commit is contained in:
@@ -654,8 +654,12 @@ void ThreatMgr::ResetAllThreat()
|
||||
if (threatList.empty())
|
||||
return;
|
||||
|
||||
for (ThreatContainer::StorageType::iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
(*itr)->SetThreat(0);
|
||||
for (HostileReference* ref : threatList)
|
||||
{
|
||||
// Reset temp threat before setting threat back to 0.
|
||||
ref->resetTempThreat();
|
||||
ref->SetThreat(0.f);
|
||||
}
|
||||
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
@@ -1670,8 +1670,8 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad
|
||||
// xinef: fix from db
|
||||
if ((addToMap || gridLoad) && !data->overwrittenZ)
|
||||
{
|
||||
float tz = map->GetHeight(data->posX, data->posY, data->posZ + 1.0f, true);
|
||||
if (tz >= data->posZ && tz - data->posZ <= 1.0f)
|
||||
float tz = map->GetHeight(data->posX, data->posY, data->posZ + 0.42f, true);
|
||||
if (tz >= data->posZ && tz - data->posZ <= 0.42f)
|
||||
const_cast<CreatureData*>(data)->posZ = tz + 0.1f;
|
||||
|
||||
const_cast<CreatureData*>(data)->overwrittenZ = true;
|
||||
|
||||
@@ -369,6 +369,14 @@ void ScriptMgr::OnPlayerLoadFromDB(Player* player)
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforePlayerLogout(Player* player)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||
{
|
||||
script->OnBeforeLogout(player);
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerLogout(Player* player)
|
||||
{
|
||||
ExecuteScript<PlayerScript>([&](PlayerScript* script)
|
||||
|
||||
@@ -133,6 +133,9 @@ public:
|
||||
// Called when a player logs in.
|
||||
virtual void OnLogin(Player* /*player*/) { }
|
||||
|
||||
// Called before the player is logged out
|
||||
virtual void OnBeforeLogout(Player* /*player*/) { }
|
||||
|
||||
// Called when a player logs out.
|
||||
virtual void OnLogout(Player* /*player*/) { }
|
||||
|
||||
|
||||
@@ -362,6 +362,7 @@ public: /* PlayerScript */
|
||||
void OnPlayerSpellCast(Player* player, Spell* spell, bool skipCheck);
|
||||
void OnPlayerLogin(Player* player);
|
||||
void OnPlayerLoadFromDB(Player* player);
|
||||
void OnBeforePlayerLogout(Player* player);
|
||||
void OnPlayerLogout(Player* player);
|
||||
void OnPlayerCreate(Player* player);
|
||||
void OnPlayerSave(Player* player);
|
||||
|
||||
@@ -601,6 +601,9 @@ void WorldSession::LogoutPlayer(bool save)
|
||||
|
||||
if (_player)
|
||||
{
|
||||
//! Call script hook before other logout events
|
||||
sScriptMgr->OnBeforePlayerLogout(_player);
|
||||
|
||||
if (ObjectGuid lguid = _player->GetLootGUID())
|
||||
DoLootRelease(lguid);
|
||||
|
||||
|
||||
@@ -515,7 +515,15 @@ class spell_pilgrims_bounty_feast_on_generic : public SpellScript
|
||||
enum tTracker
|
||||
{
|
||||
SPELL_TURKEY_TRACKER = 62014,
|
||||
SPELL_ACHI_TURKINATOR_CREDIT = 62021,
|
||||
SPELL_ACHI_TURKINATOR_CREDIT = 62021
|
||||
};
|
||||
|
||||
enum Say
|
||||
{
|
||||
SAY_TURKEY_HUNTER = 33163,
|
||||
SAY_TURKEY_DOMINATION = 33164,
|
||||
SAY_TURKEY_SLAUGHTER = 33165,
|
||||
SAY_TURKEY_TRIUMPH = 33167
|
||||
};
|
||||
|
||||
class spell_pilgrims_bounty_turkey_tracker : public SpellScript
|
||||
@@ -532,16 +540,16 @@ class spell_pilgrims_bounty_turkey_tracker : public SpellScript
|
||||
switch (stackAmount)
|
||||
{
|
||||
case 10:
|
||||
target->TextEmote("Turkey Hunter!", target, true);
|
||||
target->Whisper(SAY_TURKEY_HUNTER, target, true);
|
||||
break;
|
||||
case 20:
|
||||
target->TextEmote("Turkey Domination!", target, true);
|
||||
target->Whisper(SAY_TURKEY_DOMINATION, target, true);
|
||||
break;
|
||||
case 30:
|
||||
target->TextEmote("Turkey Slaughter!", target, true);
|
||||
target->Whisper(SAY_TURKEY_SLAUGHTER, target, true);
|
||||
break;
|
||||
case 40:
|
||||
target->TextEmote("TURKEY TRIUMPH!", target, true);
|
||||
target->Whisper(SAY_TURKEY_TRIUMPH, target, true);
|
||||
target->CastSpell(target, SPELL_ACHI_TURKINATOR_CREDIT, true);
|
||||
aurEff->GetBase()->Remove();
|
||||
break;
|
||||
|
||||
@@ -950,6 +950,37 @@ class spell_q10190_battery_recharging_blaster_aura : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
enum Veraku
|
||||
{
|
||||
NPC_VERAKU = 18544,
|
||||
SPELL_CHALLENGE_VERAKU = 34895
|
||||
};
|
||||
|
||||
class spell_challenge_veraku : public SpellScript
|
||||
{
|
||||
public:
|
||||
PrepareSpellScript(spell_challenge_veraku);
|
||||
|
||||
bool Validate(SpellInfo const* /*SpellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_CHALLENGE_VERAKU });
|
||||
}
|
||||
|
||||
SpellCastResult CheckRequirement()
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Creature* veraku = caster->FindNearestCreature(NPC_VERAKU, 100.0f))
|
||||
if (!veraku->HasAura(SPELL_CHALLENGE_VERAKU))
|
||||
return SPELL_FAILED_CASTER_AURASTATE;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_challenge_veraku::CheckRequirement);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_netherstorm()
|
||||
{
|
||||
// Ours
|
||||
@@ -962,5 +993,6 @@ void AddSC_netherstorm()
|
||||
new npc_bessy();
|
||||
new npc_maxx_a_million_escort();
|
||||
RegisterSpellAndAuraScriptPair(spell_q10190_battery_recharging_blaster, spell_q10190_battery_recharging_blaster_aura);
|
||||
RegisterSpellScript(spell_challenge_veraku);
|
||||
}
|
||||
|
||||
|
||||
@@ -695,7 +695,8 @@ class spell_rog_pickpocket : public SpellScript
|
||||
|
||||
enum vanish
|
||||
{
|
||||
SPELL_PARALYZE = 38132,
|
||||
SPELL_STEALTH = 1784,
|
||||
SPELL_PARALYZE = 38132,
|
||||
SPELL_CLEAN_ESCAPE_AURA = 23582,
|
||||
SPELL_CLEAN_ESCAPE_HEAL = 23583
|
||||
};
|
||||
@@ -742,8 +743,22 @@ class spell_rog_vanish : public SpellScript
|
||||
|
||||
void HandleEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetCaster() && GetCaster()->HasAura(SPELL_CLEAN_ESCAPE_AURA))
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_CLEAN_ESCAPE_HEAL, true);
|
||||
if (GetCaster())
|
||||
{
|
||||
GetCaster()->RemoveAurasByType(SPELL_AURA_MOD_STALKED);
|
||||
|
||||
if (!GetCaster()->HasAura(SPELL_STEALTH))
|
||||
{
|
||||
// Remove stealth cooldown if needed.
|
||||
if (GetCaster()->IsPlayer() && GetCaster()->HasSpellCooldown(SPELL_STEALTH))
|
||||
GetCaster()->ToPlayer()->RemoveSpellCooldown(SPELL_STEALTH);
|
||||
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_STEALTH, true);
|
||||
}
|
||||
|
||||
if (GetCaster()->HasAura(SPELL_CLEAN_ESCAPE_AURA))
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_CLEAN_ESCAPE_HEAL, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
Reference in New Issue
Block a user