mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
[9035] Attempt make more fast and less hackish spell target checks
* Enable server side recheck clear negative to friend or positive to enemy casts that already checks at client side * Use more fast way check in similar cases for non-players, and fall back to old way in unclear (for while at least) Please report if some spell stop propertly casted at friends/enemies.
This commit is contained in:
parent
27e7190301
commit
9e18fc5745
4 changed files with 58 additions and 7 deletions
|
|
@ -426,6 +426,40 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool IsExplicitPositiveTarget(uint32 targetA)
|
||||
{
|
||||
// positive targets
|
||||
switch(targetA)
|
||||
{
|
||||
case TARGET_SELF:
|
||||
case TARGET_SINGLE_FRIEND:
|
||||
case TARGET_SINGLE_PARTY:
|
||||
case TARGET_CHAIN_HEAL:
|
||||
case TARGET_SINGLE_FRIEND_2:
|
||||
case TARGET_AREAEFFECT_PARTY_AND_CLASS:
|
||||
case TARGET_SELF2:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsExplicitNegativeTarget(uint32 targetA)
|
||||
{
|
||||
// non-positive targets
|
||||
switch(targetA)
|
||||
{
|
||||
case TARGET_CHAIN_DAMAGE:
|
||||
case TARGET_CURRENT_ENEMY_COORDINATES:
|
||||
case TARGET_SINGLE_ENEMY:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
||||
{
|
||||
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue