56 lines
1.7 KiB
Plaintext
56 lines
1.7 KiB
Plaintext
|
void main()
|
||
|
{
|
||
|
object oZhent=GetObjectByTag("jw_zen_magard");
|
||
|
object oPC=GetClickingObject();
|
||
|
int nDoor=GetLocalInt(oPC,"jw_magdor_in");
|
||
|
|
||
|
int nDisguised=0;
|
||
|
if (GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST,oPC))=="jw_zhent_splint"||GetTag(GetItemInSlot(INVENTORY_SLOT_CHEST,oPC))=="jw_new_zh_robe")
|
||
|
{
|
||
|
nDisguised=1;
|
||
|
}
|
||
|
|
||
|
if (GetObjectSeen(oPC,oZhent)&&nDoor<3&&nDisguised==0)
|
||
|
{
|
||
|
AssignCommand(oZhent,SetFacingPoint(GetPosition(oPC)));
|
||
|
AssignCommand(oZhent,SpeakString("This area is off limits for your own safety. I strongly advise you to leave that alone."));
|
||
|
//AssignCommand(oZhent,PlaySound("vs_nwizarm1_warn"));
|
||
|
SetLocalInt(oPC,"jw_magdor_in",nDoor+1);
|
||
|
}
|
||
|
|
||
|
else
|
||
|
|
||
|
if (GetObjectSeen(oPC,oZhent)&&nDoor>=3&&nDisguised==0)
|
||
|
{
|
||
|
//AssignCommand(oZhent,SetFacingPoint(GetPosition(oPC)));
|
||
|
AssignCommand(oZhent,SpeakString("Don't you know how to do what you're told?"));
|
||
|
SetIsTemporaryEnemy(oPC,oZhent);
|
||
|
AssignCommand(oZhent,ActionAttack(oPC));
|
||
|
location lTarget=GetLocation(OBJECT_SELF);
|
||
|
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE);
|
||
|
//Cycle through the targets within the spell shape until an invalid object is captured.
|
||
|
while (GetIsObjectValid(oTarget))
|
||
|
{
|
||
|
if (GetIsFriend(oTarget,oZhent))
|
||
|
{
|
||
|
SetIsTemporaryEnemy(oPC,oTarget);
|
||
|
AssignCommand(oTarget,ActionAttack(oPC));
|
||
|
}
|
||
|
|
||
|
//Select the next target within the shape.
|
||
|
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
if (GetObjectSeen(oPC,oZhent)&&nDisguised==1)
|
||
|
{
|
||
|
AssignCommand(oZhent,SetFacingPoint(GetPosition(oPC)));
|
||
|
AssignCommand(oZhent,SpeakString("Hmm? Are you meant to be going in there?"));
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|