mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts: Build fix
This commit is contained in:
@@ -119,7 +119,7 @@ void WorldSession::HandleUseItemOpcode(WorldPackets::Spells::UseItem& packet)
|
||||
SpellCastTargets targets(user, packet.Cast);
|
||||
|
||||
// Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state.
|
||||
if (!sScriptMgr->OnItemUse(user, item, targets))
|
||||
if (!sScriptMgr->OnItemUse(user, item, targets, packet.Cast.CastID))
|
||||
{
|
||||
// no script or script not process request by self
|
||||
user->CastItemUseSpell(item, targets, packet.Cast.CastID, packet.Cast.Misc);
|
||||
|
||||
@@ -1490,13 +1490,13 @@ bool ScriptMgr::OnQuestAccept(Player* player, Item* item, Quest const* quest)
|
||||
return tmpscript->OnQuestAccept(player, item, quest);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnItemUse(Player* player, Item* item, SpellCastTargets const& targets)
|
||||
bool ScriptMgr::OnItemUse(Player* player, Item* item, SpellCastTargets const& targets, ObjectGuid castId)
|
||||
{
|
||||
ASSERT(player);
|
||||
ASSERT(item);
|
||||
|
||||
GET_SCRIPT_RET(ItemScript, item->GetScriptId(), tmpscript, false);
|
||||
return tmpscript->OnUse(player, item, targets);
|
||||
return tmpscript->OnUse(player, item, targets, castId);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnItemExpire(Player* player, ItemTemplate const* proto)
|
||||
|
||||
@@ -368,7 +368,7 @@ class TC_GAME_API ItemScript : public ScriptObject
|
||||
virtual bool OnQuestAccept(Player* /*player*/, Item* /*item*/, Quest const* /*quest*/) { return false; }
|
||||
|
||||
// Called when a player uses the item.
|
||||
virtual bool OnUse(Player* /*player*/, Item* /*item*/, SpellCastTargets const& /*targets*/) { return false; }
|
||||
virtual bool OnUse(Player* /*player*/, Item* /*item*/, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) { return false; }
|
||||
|
||||
// Called when the item expires (is destroyed).
|
||||
virtual bool OnExpire(Player* /*player*/, ItemTemplate const* /*proto*/) { return false; }
|
||||
@@ -940,7 +940,7 @@ class TC_GAME_API ScriptMgr
|
||||
|
||||
bool OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Item* target);
|
||||
bool OnQuestAccept(Player* player, Item* item, Quest const* quest);
|
||||
bool OnItemUse(Player* player, Item* item, SpellCastTargets const& targets);
|
||||
bool OnItemUse(Player* player, Item* item, SpellCastTargets const& targets, ObjectGuid castId);
|
||||
bool OnItemExpire(Player* player, ItemTemplate const* proto);
|
||||
bool OnItemRemove(Player* player, Item* item);
|
||||
|
||||
|
||||
@@ -1338,7 +1338,7 @@ class spell_putricide_mutation_init : public SpellScriptLoader
|
||||
SpellCastResult result = CheckRequirementInternal(extension);
|
||||
if (result != SPELL_CAST_OK)
|
||||
{
|
||||
Spell::SendCastResult(GetExplTargetUnit()->ToPlayer(), GetSpellInfo(), 0, result, extension);
|
||||
Spell::SendCastResult(GetExplTargetUnit()->ToPlayer(), GetSpellInfo(), GetSpell()->m_SpellVisual, GetSpell()->m_castId, result, extension);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1435,7 +1435,7 @@ class spell_putricide_mutated_transformation : public SpellScriptLoader
|
||||
if (putricide->AI()->GetData(DATA_ABOMINATION))
|
||||
{
|
||||
if (Player* player = caster->ToPlayer())
|
||||
Spell::SendCastResult(player, GetSpellInfo(), 0, SPELL_FAILED_CUSTOM_ERROR, SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS);
|
||||
Spell::SendCastResult(player, GetSpellInfo(), GetSpell()->m_SpellVisual, GetSpell()->m_castId, SPELL_FAILED_CUSTOM_ERROR, SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ class icecrown_citadel_teleport : public GameObjectScript
|
||||
|
||||
if (player->IsInCombat())
|
||||
{
|
||||
Spell::SendCastResult(player, spell, 0, SPELL_FAILED_AFFECTING_COMBAT);
|
||||
ObjectGuid castId = ObjectGuid::Create<HighGuid::Cast>(SPELL_CAST_SOURCE_NORMAL, player->GetMapId(), spell->Id, player->GetMap()->GenerateLowGuid<HighGuid::Cast>());
|
||||
Spell::SendCastResult(player, spell, 0, castId, SPELL_FAILED_AFFECTING_COMBAT);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -85,7 +86,10 @@ class at_frozen_throne_teleport : public AreaTriggerScript
|
||||
if (player->IsInCombat())
|
||||
{
|
||||
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(FROZEN_THRONE_TELEPORT))
|
||||
Spell::SendCastResult(player, spell, 0, SPELL_FAILED_AFFECTING_COMBAT);
|
||||
{
|
||||
ObjectGuid castId = ObjectGuid::Create<HighGuid::Cast>(SPELL_CAST_SOURCE_NORMAL, player->GetMapId(), spell->Id, player->GetMap()->GenerateLowGuid<HighGuid::Cast>());
|
||||
Spell::SendCastResult(player, spell, 0, castId, SPELL_FAILED_AFFECTING_COMBAT);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1265,7 +1265,7 @@ class spell_ulduar_teleporter : public SpellScriptLoader
|
||||
|
||||
if (GetExplTargetUnit()->IsInCombat())
|
||||
{
|
||||
Spell::SendCastResult(GetExplTargetUnit()->ToPlayer(), GetSpellInfo(), 0, SPELL_FAILED_AFFECTING_COMBAT);
|
||||
Spell::SendCastResult(GetExplTargetUnit()->ToPlayer(), GetSpellInfo(), GetSpell()->m_SpellVisual, GetSpell()->m_castId, SPELL_FAILED_AFFECTING_COMBAT);
|
||||
return SPELL_FAILED_AFFECTING_COMBAT;
|
||||
}
|
||||
|
||||
|
||||
@@ -885,7 +885,7 @@ class item_tainted_core : public ItemScript
|
||||
public:
|
||||
item_tainted_core() : ItemScript("item_tainted_core") { }
|
||||
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& targets) override
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& targets, ObjectGuid /*castId*/) override
|
||||
{
|
||||
InstanceScript* instance = player->GetInstanceScript();
|
||||
if (!instance)
|
||||
|
||||
@@ -232,10 +232,8 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
Talk(SAY_NOVA);
|
||||
|
||||
if (SpellInfo const* nova = sSpellMgr->GetSpellInfo(SPELL_BURNING_NOVA))
|
||||
{
|
||||
if (Aura* aura = Aura::TryRefreshStackOrCreate(nova, MAX_EFFECT_MASK, me, me))
|
||||
if (Aura* aura = Aura::TryRefreshStackOrCreate(nova, ObjectGuid::Create<HighGuid::Cast>(SPELL_CAST_SOURCE_NORMAL, me->GetMapId(), nova->Id, me->GetMap()->GenerateLowGuid<HighGuid::Cast>()), MAX_EFFECT_MASK, me, me))
|
||||
aura->ApplyForTargets();
|
||||
}
|
||||
|
||||
if (IsHeroic())
|
||||
DoTeleportAll(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
|
||||
@@ -49,7 +49,7 @@ class item_only_for_flight : public ItemScript
|
||||
public:
|
||||
item_only_for_flight() : ItemScript("item_only_for_flight") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) override
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/, ObjectGuid castId) override
|
||||
{
|
||||
uint32 itemId = item->GetEntry();
|
||||
bool disabled = false;
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
break;
|
||||
case 34475:
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES))
|
||||
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_ON_GROUND);
|
||||
Spell::SendCastResult(player, spellInfo, 0, castId, SPELL_FAILED_NOT_ON_GROUND);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class item_nether_wraith_beacon : public ItemScript
|
||||
public:
|
||||
item_nether_wraith_beacon() : ItemScript("item_nether_wraith_beacon") { }
|
||||
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& /*targets*/) override
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) override
|
||||
{
|
||||
if (player->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class item_gor_dreks_ointment : public ItemScript
|
||||
public:
|
||||
item_gor_dreks_ointment() : ItemScript("item_gor_dreks_ointment") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& targets) override
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& targets, ObjectGuid /*castId*/) override
|
||||
{
|
||||
if (targets.GetUnitTarget() && targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT &&
|
||||
targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578))
|
||||
@@ -133,7 +133,7 @@ class item_incendiary_explosives : public ItemScript
|
||||
public:
|
||||
item_incendiary_explosives() : ItemScript("item_incendiary_explosives") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const & /*targets*/) override
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) override
|
||||
{
|
||||
if (player->FindNearestCreature(26248, 15) || player->FindNearestCreature(26249, 15))
|
||||
return false;
|
||||
@@ -223,7 +223,7 @@ class item_pile_fake_furs : public ItemScript
|
||||
public:
|
||||
item_pile_fake_furs() : ItemScript("item_pile_fake_furs") { }
|
||||
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const & /*targets*/) override
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) override
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
for (uint8 i = 0; i < CaribouTrapsNum; ++i)
|
||||
@@ -268,7 +268,7 @@ class item_petrov_cluster_bombs : public ItemScript
|
||||
public:
|
||||
item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { }
|
||||
|
||||
bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/) override
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& /*targets*/, ObjectGuid castId) override
|
||||
{
|
||||
if (player->GetZoneId() != ZONE_ID_HOWLING)
|
||||
return false;
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
|
||||
{
|
||||
if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
|
||||
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
|
||||
Spell::SendCastResult(player, spellInfo, 0, castId, SPELL_FAILED_NOT_HERE);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -332,7 +332,7 @@ class item_dehta_trap_smasher : public ItemScript
|
||||
public:
|
||||
item_dehta_trap_smasher() : ItemScript("item_dehta_trap_smasher") { }
|
||||
|
||||
bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/) override
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE)
|
||||
return false;
|
||||
@@ -368,7 +368,7 @@ class item_trident_of_nazjan : public ItemScript
|
||||
public:
|
||||
item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) override
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
@@ -395,7 +395,7 @@ class item_captured_frog : public ItemScript
|
||||
public:
|
||||
item_captured_frog() : ItemScript("item_captured_frog") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) override
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) override
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_THE_PERFECT_SPIES) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user