mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[7990] Trigering "on hit" combat spell only at related to current hit weapon.
Also check at loading that only weapon item templates have "on hit" spell triggers. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
e3fd03c7b9
commit
31957a22d6
5 changed files with 13 additions and 8 deletions
|
|
@ -1688,12 +1688,18 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
{
|
||||
for (int j = 0; j < MAX_ITEM_PROTO_SPELLS; ++j)
|
||||
{
|
||||
if(proto->Spells[j].SpellTrigger >= MAX_ITEM_SPELLTRIGGER || proto->Spells[j].SpellTrigger == ITEM_SPELLTRIGGER_LEARN_SPELL_ID)
|
||||
if (proto->Spells[j].SpellTrigger >= MAX_ITEM_SPELLTRIGGER || proto->Spells[j].SpellTrigger == ITEM_SPELLTRIGGER_LEARN_SPELL_ID)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)",i,j+1,proto->Spells[j].SpellTrigger);
|
||||
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
|
||||
const_cast<ItemPrototype*>(proto)->Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
||||
}
|
||||
// on hit can be sued only at weapon
|
||||
else if (proto->Spells[j].SpellTrigger == ITEM_SPELLTRIGGER_CHANCE_ON_HIT)
|
||||
{
|
||||
if(proto->Class != ITEM_CLASS_WEAPON)
|
||||
sLog.outErrorDb("Item (Entry: %u) isn't weapon (Class: %u) but has on hit spelltrigger_%d (%u), it will not triggered.",i,proto->Class,j+1,proto->Spells[j].SpellTrigger);
|
||||
}
|
||||
|
||||
if(proto->Spells[j].SpellId)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue