mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 00:36:07 +00:00
Merge branch 'master' into master
This commit is contained in:
@@ -1510,7 +1510,9 @@ public:
|
||||
if (!playerTarget)
|
||||
playerTarget = player;
|
||||
|
||||
;//sLog->outDetail(handler->GetTrinityString(LANG_ADDITEM), itemId, count);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDetail(handler->GetTrinityString(LANG_ADDITEM), itemId, count);
|
||||
#endif
|
||||
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
|
||||
if (!itemTemplate)
|
||||
@@ -1597,7 +1599,9 @@ public:
|
||||
if (!playerTarget)
|
||||
playerTarget = player;
|
||||
|
||||
;//sLog->outDetail(handler->GetTrinityString(LANG_ADDITEMSET), itemSetId);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDetail(handler->GetTrinityString(LANG_ADDITEMSET), itemSetId);
|
||||
#endif
|
||||
|
||||
bool found = false;
|
||||
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
|
||||
|
||||
@@ -190,7 +190,9 @@ public:
|
||||
target->SetMaxPower(POWER_ENERGY, energym);
|
||||
target->SetPower(POWER_ENERGY, energy);
|
||||
|
||||
;//sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY));
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY));
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1016,7 +1018,9 @@ public:
|
||||
{
|
||||
int32 newmoney = int32(targetMoney) + moneyToAdd;
|
||||
|
||||
;//sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS, handler->GetTrinityString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney);
|
||||
#endif
|
||||
if (newmoney <= 0)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target).c_str());
|
||||
@@ -1051,7 +1055,9 @@ public:
|
||||
target->ModifyMoney(moneyToAdd);
|
||||
}
|
||||
|
||||
;//sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), targetMoney, moneyToAdd, target->GetMoney());
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS, handler->GetTrinityString(LANG_NEW_MONEY), targetMoney, moneyToAdd, target->GetMoney());
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -783,7 +783,7 @@ public:
|
||||
if (show == "info")
|
||||
{
|
||||
// Check if the user did specify a visual waypoint
|
||||
if (target && target->GetEntry() != VISUAL_WAYPOINT)
|
||||
if (!target || target->GetEntry() != VISUAL_WAYPOINT)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_WAYPOINT_VP_SELECT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
|
||||
@@ -206,7 +206,9 @@ public:
|
||||
|
||||
void SetData64(uint32 type, uint64 data)
|
||||
{
|
||||
;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data);
|
||||
#endif
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -222,7 +224,9 @@ public:
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
|
||||
#endif
|
||||
|
||||
switch (type)
|
||||
{
|
||||
|
||||
@@ -228,7 +228,9 @@ public:
|
||||
|
||||
void PrepareEncounter()
|
||||
{
|
||||
;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId);
|
||||
#endif
|
||||
uint8 index = 0;
|
||||
uint8 count = 0;
|
||||
|
||||
|
||||
@@ -240,7 +240,9 @@ public:
|
||||
{
|
||||
AddEscortState(STATE_ESCORT_RETURNING);
|
||||
ReturnToLastPoint();
|
||||
;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point");
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -89,6 +89,7 @@ class boss_akilzon : public CreatureScript
|
||||
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
|
||||
StormCount = 0;
|
||||
isRaining = false;
|
||||
instance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
|
||||
|
||||
SetWeather(WEATHER_STATE_FINE, 0.0f);
|
||||
}
|
||||
@@ -111,6 +112,7 @@ class boss_akilzon : public CreatureScript
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
_JustDied();
|
||||
instance->SetData(DATA_AKILZONEVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who)
|
||||
|
||||
@@ -170,6 +170,7 @@ public:
|
||||
{
|
||||
_IsByOutrunner = false;
|
||||
spawnId = 0;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
@@ -228,6 +229,7 @@ public:
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
|
||||
if (quest->GetQuestId() == QUEST_RINJI_TRAPPED)
|
||||
{
|
||||
if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
|
||||
|
||||
@@ -201,6 +201,61 @@ class npc_midsummer_torch_target : public CreatureScript
|
||||
// SPELLS
|
||||
///////////////////////////////
|
||||
|
||||
enum CrabDisguise
|
||||
{
|
||||
SPELL_CRAB_DISGUISE = 46337,
|
||||
SPELL_APPLY_DIGUISE = 34804,
|
||||
SPELL_FADE_DIGUISE = 47693,
|
||||
};
|
||||
|
||||
class spell_gen_crab_disguise : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_crab_disguise() : SpellScriptLoader("spell_gen_crab_disguise") { }
|
||||
|
||||
class spell_gen_crab_disguise_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_crab_disguise_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_CRAB_DISGUISE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
caster->CastSpell(caster, SPELL_APPLY_DIGUISE, true);
|
||||
caster->setFaction(88);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
caster->CastSpell(caster, SPELL_FADE_DIGUISE, true);
|
||||
caster->RestoreFaction();
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectRemoveFn(spell_gen_crab_disguise_AuraScript::OnApply, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_gen_crab_disguise_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_crab_disguise_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum RibbonPole
|
||||
{
|
||||
SPELL_RIBBON_POLE_CHANNEL_VISUAL = 29172,
|
||||
@@ -513,6 +568,7 @@ void AddSC_event_midsummer_scripts()
|
||||
new npc_midsummer_torch_target();
|
||||
|
||||
// Spells
|
||||
new spell_gen_crab_disguise();
|
||||
new spell_midsummer_ribbon_pole();
|
||||
new spell_midsummer_torch_quest();
|
||||
new spell_midsummer_fling_torch();
|
||||
|
||||
@@ -129,9 +129,9 @@ public:
|
||||
//Second Ambush(3 Gorillas)
|
||||
case 21:
|
||||
Talk(SAY_OOX_AMBUSH);
|
||||
me->SummonCreature(NPC_GORILLA, -4595.81f, 2005.99f, 53.08f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
me->SummonCreature(NPC_GORILLA, -4597.53f, 2008.31f, 52.70f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
me->SummonCreature(NPC_GORILLA, -4599.37f, 2010.59f, 52.77f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
me->SummonCreature(NPC_GORILLA, -4652.76f, 1956.69f, 67.99f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
me->SummonCreature(NPC_GORILLA, -4654.73f, 1959.71f, 47.66f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
me->SummonCreature(NPC_GORILLA, -4657.01f, 1963.19f, 67.48f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
break;
|
||||
//Third Ambush(4 Gnolls)
|
||||
case 30:
|
||||
|
||||
@@ -446,7 +446,7 @@ public:
|
||||
if (!who || !who->IsInWorld() || who->GetZoneId() != 4395)
|
||||
return;
|
||||
|
||||
if (!me->IsWithinDist(who, 12.0f, false))
|
||||
if (!me->IsWithinDist(who, 5.0f, false))
|
||||
return;
|
||||
|
||||
Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
|
||||
@@ -416,7 +416,9 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_commander_dawnforge event already in progress, need to wait.");
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_commander_dawnforge event already in progress, need to wait.");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -570,6 +570,7 @@ void AddSC_outdoorpvp_gh();
|
||||
|
||||
// player
|
||||
void AddSC_chat_log();
|
||||
void AddSC_character_creation();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -642,6 +643,7 @@ void AddWorldScripts()
|
||||
AddSC_npc_taxi();
|
||||
AddSC_achievement_scripts();
|
||||
AddSC_chat_log();
|
||||
AddSC_character_creation();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2242,7 +2242,8 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader
|
||||
enum AnimalBloodPoolSpell
|
||||
{
|
||||
SPELL_ANIMAL_BLOOD = 46221,
|
||||
SPELL_SPAWN_BLOOD_POOL = 63471
|
||||
SPELL_SPAWN_BLOOD_POOL = 63471,
|
||||
FACTION_DETHA_ATTACK = 942
|
||||
};
|
||||
|
||||
class spell_gen_animal_blood : public SpellScriptLoader
|
||||
@@ -2266,13 +2267,20 @@ class spell_gen_animal_blood : public SpellScriptLoader
|
||||
// Remove all auras with spell id 46221, except the one currently being applied
|
||||
while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, 0, 0, 0, GetAura()))
|
||||
GetUnitOwner()->RemoveOwnedAura(aur);
|
||||
if (Unit* owner = GetUnitOwner())
|
||||
{
|
||||
owner->setFaction(FACTION_DETHA_ATTACK);
|
||||
}
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* owner = GetUnitOwner())
|
||||
{
|
||||
owner->RestoreFaction();
|
||||
if (owner->IsInWater())
|
||||
owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -22,6 +22,7 @@ set(scripts_STAT_SRCS
|
||||
${AC_SCRIPTS_DIR}/World/npc_professions.cpp
|
||||
${AC_SCRIPTS_DIR}/World/npc_taxi.cpp
|
||||
${AC_SCRIPTS_DIR}/World/npcs_special.cpp
|
||||
${AC_SCRIPTS_DIR}/World/character_creation.cpp
|
||||
)
|
||||
|
||||
AC_ADD_SCRIPT_LOADER("World" "ScriptLoader.h")
|
||||
|
||||
56
src/scripts/World/character_creation.cpp
Normal file
56
src/scripts/World/character_creation.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: http://github.com/azerothcore/azerothcore-wotlk/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Creationabilities
|
||||
{
|
||||
WARRIOR_CREATION_BATTLE_STANCE = 2457, // Battle Stance
|
||||
DEATH_KNIGHT_CREATION_BLOOD_PRESENCE = 48266, // Blood Presence
|
||||
};
|
||||
|
||||
// Instead of adding a hacky way into Player::Create, we use existing hooks to cast these spells on first character login
|
||||
class CharacterCreationProcedures : public PlayerScript
|
||||
{
|
||||
public:
|
||||
CharacterCreationProcedures() : PlayerScript("CharacterCreationProcedures")
|
||||
{
|
||||
}
|
||||
|
||||
void OnFirstLogin(Player* player)
|
||||
{
|
||||
switch (player->getClass())
|
||||
{
|
||||
// Only two classes posses an aura on creation;
|
||||
case CLASS_WARRIOR:
|
||||
player->CastSpell(player, WARRIOR_CREATION_BATTLE_STANCE, true);
|
||||
return;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
player->CastSpell(player, DEATH_KNIGHT_CREATION_BLOOD_PRESENCE, true);
|
||||
return;
|
||||
// We include, but do not change the other classes
|
||||
case CLASS_NONE:
|
||||
case CLASS_PALADIN:
|
||||
case CLASS_HUNTER:
|
||||
case CLASS_ROGUE:
|
||||
case CLASS_PRIEST:
|
||||
case CLASS_SHAMAN:
|
||||
case CLASS_MAGE:
|
||||
case CLASS_WARLOCK:
|
||||
// case CLASS_UNK: // Does not exist!
|
||||
case CLASS_DRUID:
|
||||
default:
|
||||
// Can be modified based on personal needs;
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_character_creation()
|
||||
{
|
||||
new CharacterCreationProcedures();
|
||||
}
|
||||
@@ -227,7 +227,9 @@ bool EquippedOk(Player* player, uint32 spellId)
|
||||
if (item && item->GetTemplate()->RequiredSpell == reqSpell)
|
||||
{
|
||||
//player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
|
||||
;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry());
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry());
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user