mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 14:46:24 +00:00
fix(Script/Quest): Protecting Our Own (#19247)
* fix(Core/Spells): Gor'drek's Ointment * Update spell_item.cpp * ;
This commit is contained in:
@@ -4808,6 +4808,13 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->AttributesEx4 |= SPELL_ATTR4_NO_CAST_LOG;
|
||||
});
|
||||
|
||||
// Gor'drek's Ointment
|
||||
ApplySpellFix({ 32578 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_CASTER_PROCS;
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPRESS_TARGET_PROCS;
|
||||
});
|
||||
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
SpellInfo* spellInfo = mSpellInfoMap[i];
|
||||
|
||||
@@ -4021,6 +4021,36 @@ class spell_item_fel_mana_potion : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 32578 - Gor'drek's Ointment
|
||||
enum DreksOintment
|
||||
{
|
||||
NPC_THUNDERLORD_DIRE_WOLF = 20748,
|
||||
SPELL_GOR_DREKS_OINTMENT = 32578
|
||||
};
|
||||
|
||||
class spell_item_gor_dreks_ointment : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_item_gor_dreks_ointment)
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (target->GetEntry() == NPC_THUNDERLORD_DIRE_WOLF && !target->HasAura(SPELL_GOR_DREKS_OINTMENT))
|
||||
return SPELL_CAST_OK;
|
||||
if (target->GetEntry() != NPC_THUNDERLORD_DIRE_WOLF)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
|
||||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_item_gor_dreks_ointment::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_item_spell_scripts()
|
||||
{
|
||||
RegisterSpellScript(spell_item_massive_seaforium_charge);
|
||||
@@ -4144,5 +4174,6 @@ void AddSC_item_spell_scripts()
|
||||
RegisterSpellScript(spell_item_scroll_of_retribution);
|
||||
RegisterSpellAndAuraScriptPair(spell_item_eye_of_grillok, spell_item_eye_of_grillok_aura);
|
||||
RegisterSpellScript(spell_item_fel_mana_potion);
|
||||
RegisterSpellScript(spell_item_gor_dreks_ointment);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,18 +20,6 @@
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Spell.h"
|
||||
/* ScriptData
|
||||
SDName: Item_Scripts
|
||||
SD%Complete: 100
|
||||
SDComment: Items for a range of different items. See content below (in script)
|
||||
SDCategory: Items
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
item_flying_machine(i34060, i34061) Engineering crafted flying machines
|
||||
item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
|
||||
item_only_for_flight Items which should only useable while flying
|
||||
EndContentData */
|
||||
|
||||
/*#####
|
||||
# item_only_for_flight
|
||||
@@ -79,26 +67,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
# item_gor_dreks_ointment
|
||||
#####*/
|
||||
|
||||
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
|
||||
{
|
||||
if (targets.GetUnitTarget() && targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT &&
|
||||
targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578))
|
||||
return false;
|
||||
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, nullptr);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
# item_incendiary_explosives
|
||||
#####*/
|
||||
@@ -248,7 +216,6 @@ public:
|
||||
void AddSC_item_scripts()
|
||||
{
|
||||
new item_only_for_flight();
|
||||
new item_gor_dreks_ointment();
|
||||
new item_incendiary_explosives();
|
||||
new item_mysterious_egg();
|
||||
new item_disgusting_jar();
|
||||
|
||||
Reference in New Issue
Block a user