Merge pull request #176 from KayenEQ/Development

ST_PetMaster target type support added
This commit is contained in:
Michael Cook 2014-08-10 23:04:06 -04:00
commit f0c46664d2
2 changed files with 20 additions and 2 deletions

View File

@ -131,10 +131,10 @@ typedef enum {
/* 41 */ ST_Group = 0x29, /* 41 */ ST_Group = 0x29,
/* 42 */ ST_Directional = 0x2a, //ae around this target between two angles /* 42 */ ST_Directional = 0x2a, //ae around this target between two angles
/* 43 */ ST_GroupClientAndPet = 0x2b, /* 43 */ ST_GroupClientAndPet = 0x2b,
/* 44 */ ST_Beam = 0x2c, //like directional but facing in front of you always /* 44 */ //ST_Beam = 0x2c, //like directional but facing in front of you always
/* 45 */ //ST_Ring = 0x2d, // Like a mix of PB ae + rain spell(has ae duration) /* 45 */ //ST_Ring = 0x2d, // Like a mix of PB ae + rain spell(has ae duration)
/* 46 */ ST_TargetsTarget = 0x2e, // uses the target of your target /* 46 */ ST_TargetsTarget = 0x2e, // uses the target of your target
/* 47 */ //ST_PetMaster = 0x2e, // uses the master as target /* 47 */ ST_PetMaster = 0x2f, // uses the master as target
} SpellTargetType; } SpellTargetType;
typedef enum { typedef enum {

View File

@ -1780,6 +1780,24 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
break; break;
} }
case ST_PetMaster:
{
Mob *owner = nullptr;
if (IsPet())
owner = GetOwner();
else if ((IsNPC() && CastToNPC()->GetSwarmOwner()))
owner = entity_list.GetMobID(CastToNPC()->GetSwarmOwner());
if (!owner)
return false;
spell_target = owner;
CastAction = SingleTarget;
break;
}
default: default:
{ {
mlog(SPELLS__CASTING_ERR, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); mlog(SPELLS__CASTING_ERR, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name);