Dylmani555 wrote...
Yeah, it's just I'm trying to make this portal not work for Half orcs or half elves, or red dragon disciples or purple dragon knights, because they are not allowed on the map I'm making, due to the lore behind the map.
Okay thanks for the help '> I think it should work now.
Ok there is a better function then the GetclassBy Position that you are currently using. It is the GetLevelByclass function. With it you will only need to check if the level returned is greater then 0 to know if the have taken the calss ot not. That with what we learned above and your If statment can be rewritten as.
if(
GetRacialType(oPC) == RACIAL_TYPE_HALFELF ||
GetRacialType(oPC) == RACIAL_TYPE_HALFORC ||
GetLevelByclass(class_TYPE_DRAGONDISCIPLE, oPC) > 0 ||
GetLevelByclass(class_TYPE_DRAGONDISCIPLE , oPC) > 0 ||
)
{
// TRUE Case meaning one of the cases above was true.
// You did not want to transport this PC so do nothing.
}
else
{
// False clause. oPC wan not any of the checks above.
// This guy is safe to teleport.
}
As another option you can invert the return of the expression above by using the Not(!) operator. You would just need to soround the entire expression with parentheses and apply the Not.
!(expression)
In that case you would have:
if(
! (
GetRacialType(oPC) == RACIAL_TYPE_HALFELF ||
GetRacialType(oPC) == RACIAL_TYPE_HALFORC ||
GetLevelByclass(class_TYPE_DRAGONDISCIPLE, oPC) > 0 ||
GetLevelByclass(class_TYPE_DRAGONDISCIPLE , oPC) > 0 ||
)
)
{
// True Case the PC as not any of the casses above.
// Safe to transport.
}
Modifié par Lightfoot8, 28 avril 2012 - 07:55 .