82 lines
1.9 KiB
Plaintext
82 lines
1.9 KiB
Plaintext
#ifndef _mr_api_
|
|
#define _mr_api_
|
|
objectdef MRApi
|
|
{
|
|
static member:bool IsForMe(string forWhoTarget)
|
|
{
|
|
variable string target = ${forWhoTarget};
|
|
variable string prefix = ${forWhoTarget.Token[1, ":"]};
|
|
variable bool negate = FALSE;
|
|
|
|
|
|
if ${target.Count[":"]} > 0
|
|
{
|
|
negate:Set[${prefix.Equal["not"]}]
|
|
target:Set[${forWhoTarget.Token[2, ":"]}];
|
|
}
|
|
|
|
if ${prefix.Equal["igw"]}
|
|
{
|
|
return ${Me.Group["${target}"](exists)}
|
|
}
|
|
|
|
if ${prefix.Equal["igwbn"]}
|
|
{
|
|
|
|
return !${Me.Name.Equal["${target}"]) && ${Me.Group["${target}"](exists)}
|
|
}
|
|
|
|
if ${prefix.Equal["irw"]}
|
|
{
|
|
return ${Me.Raid["${target}"](exists)}
|
|
}
|
|
|
|
if ${prefix.Equal["irwbn"]}
|
|
{
|
|
return !${Me.Name.Equal["${target}"]) && ${Me.Raid["${target}"](exists)}
|
|
}
|
|
|
|
if ${target.Equal["${Me.Name}"]} || ${target.Equal["all"]}
|
|
{
|
|
echo "Name match ${negate.Not}"
|
|
return ${negate.Not};
|
|
}
|
|
|
|
if ${target.Equal["${Me.Class}"]} || ${target.Equal["${Me.SubClass}"]} || ${target.Equal["${Me.Archetype}"]}
|
|
{
|
|
return ${negate.Not};
|
|
}
|
|
|
|
if ${target.Equal["melee"]} && (${Me.Archetype.Equal["fighter"]} || ${Me.Archetype.Equal["scout"]})
|
|
{
|
|
echo "melee match"
|
|
return ${negate.Not};
|
|
}
|
|
|
|
if ${target.Equal["caster"]} && (${Me.Archetype.Equal["mage"]} || ${Me.Archetype.Equal["priest"]})
|
|
{
|
|
return ${negate.Not};
|
|
}
|
|
|
|
|
|
return ${negate}
|
|
}
|
|
|
|
static method MoveTo(string forWho, point3f location)
|
|
{
|
|
echo "Moving to ${location}"
|
|
if ${MRApi.IsForMe[${forWho}]}
|
|
{
|
|
MRNav:MoveTo["${location}"]
|
|
}
|
|
else
|
|
{
|
|
echo "NotForMe"
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
#endif
|