mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 10:58:20 +00:00
Fix for bolt spell targeting self if target zone/died while casting.
Fix for bolt spell targeting self if target zone/died while casting. Despite the name being "ST_TargetOptional", this target type is reserved for projectile spells which all require a target, thus should be treated like any other targeted spell.
This commit is contained in:
+1
-1
@@ -279,7 +279,7 @@ enum RESISTTYPE
|
||||
|
||||
//Target Type IDs
|
||||
typedef enum {
|
||||
/* 01 */ ST_TargetOptional = 0x01,
|
||||
/* 01 */ ST_TargetOptional = 0x01, //only used for targeted projectile spells
|
||||
/* 02 */ ST_AEClientV1 = 0x02,
|
||||
/* 03 */ ST_GroupTeleport = 0x03,
|
||||
/* 04 */ ST_AECaster = 0x04,
|
||||
|
||||
+7
-4
@@ -406,8 +406,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
spell.targettype == ST_Self ||
|
||||
spell.targettype == ST_AECaster ||
|
||||
spell.targettype == ST_Ring ||
|
||||
spell.targettype == ST_Beam ||
|
||||
spell.targettype == ST_TargetOptional) && target_id == 0)
|
||||
spell.targettype == ST_Beam) && target_id == 0)
|
||||
{
|
||||
LogSpells("Spell [{}] auto-targeted the caster. Group? [{}], target type [{}]", spell_id, IsGroupSpell(spell_id), spell.targettype);
|
||||
target_id = GetID();
|
||||
@@ -1585,8 +1584,12 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
|
||||
case ST_TargetOptional:
|
||||
{
|
||||
if(!spell_target)
|
||||
spell_target = this;
|
||||
if (!spell_target)
|
||||
{
|
||||
LogSpells("Spell [{}] canceled: invalid target (normal)", spell_id);
|
||||
MessageString(Chat::Red, SPELL_NEED_TAR);
|
||||
return false; // can't cast these unless we have a target
|
||||
}
|
||||
CastAction = SingleTarget;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user