89 lines
2.8 KiB
Plaintext
89 lines
2.8 KiB
Plaintext
//cages a humanoid of medium or smaller size.
|
|
//If not real, an illusion of a cage is created
|
|
//If destroyable, can be selected and bashed
|
|
//If time> 0.0, will destroy self after time interval
|
|
void Cage(object oTarget, int bReal=TRUE, int bDestroy=TRUE, float fTime=0.0);
|
|
|
|
void Cage(object oTarget, int bReal=TRUE, int bDestroy=TRUE, float fTime=0.0)
|
|
{
|
|
if(bReal==FALSE)
|
|
{
|
|
effect eVis= EffectVisualEffect(509);
|
|
if(fTime!=0.0)
|
|
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetLocation(oTarget), fTime);
|
|
else
|
|
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eVis, GetLocation(oTarget));
|
|
}
|
|
else if(bDestroy==FALSE)
|
|
{
|
|
string sObj= "x0_cagewall";
|
|
|
|
//north wall
|
|
vector vPos= GetPosition(oTarget);
|
|
vPos.y+=1.0;
|
|
location lLoc= Location(GetArea(oTarget), vPos, DIRECTION_NORTH);
|
|
object oCreate= CreateObject(OBJECT_TYPE_PLACEABLE, sObj, lLoc);
|
|
if(fTime!=0.0)
|
|
DestroyObject(oCreate, fTime);
|
|
|
|
//south wall
|
|
vPos= GetPosition(oTarget);
|
|
vPos.y-=1.0;
|
|
lLoc= Location(GetArea(oTarget), vPos, DIRECTION_SOUTH);
|
|
oCreate= CreateObject(OBJECT_TYPE_PLACEABLE, sObj, lLoc);
|
|
if(fTime!=0.0)
|
|
DestroyObject(oCreate, fTime);
|
|
|
|
//east wall
|
|
vPos= GetPosition(oTarget);
|
|
vPos.x+=1.0;
|
|
lLoc= Location(GetArea(oTarget), vPos, DIRECTION_EAST);
|
|
oCreate= CreateObject(OBJECT_TYPE_PLACEABLE, sObj, lLoc);
|
|
if(fTime!=0.0)
|
|
DestroyObject(oCreate, fTime);
|
|
|
|
//west wall
|
|
vPos= GetPosition(oTarget);
|
|
vPos.x-=1.0;
|
|
lLoc= Location(GetArea(oTarget), vPos, DIRECTION_WEST);
|
|
oCreate= CreateObject(OBJECT_TYPE_PLACEABLE, sObj, lLoc);
|
|
if(fTime!=0.0)
|
|
DestroyObject(oCreate, fTime);
|
|
}
|
|
else
|
|
{
|
|
string sObj= "cagewall2";
|
|
//north wall
|
|
vector vPos= GetPosition(oTarget);
|
|
vPos.y+=1.0;
|
|
location lLoc= Location(GetArea(oTarget), vPos, DIRECTION_NORTH);
|
|
object oCreate= CreateObject(OBJECT_TYPE_PLACEABLE, sObj, lLoc);
|
|
if(fTime!=0.0)
|
|
DestroyObject(oCreate, fTime);
|
|
|
|
//south wall
|
|
vPos= GetPosition(oTarget);
|
|
vPos.y-=1.0;
|
|
lLoc= Location(GetArea(oTarget), vPos, DIRECTION_SOUTH);
|
|
oCreate= CreateObject(OBJECT_TYPE_PLACEABLE, sObj, lLoc);
|
|
if(fTime!=0.0)
|
|
DestroyObject(oCreate, fTime);
|
|
|
|
//east wall
|
|
vPos= GetPosition(oTarget);
|
|
vPos.x+=1.0;
|
|
lLoc= Location(GetArea(oTarget), vPos, DIRECTION_EAST);
|
|
oCreate= CreateObject(OBJECT_TYPE_PLACEABLE, sObj, lLoc);
|
|
if(fTime!=0.0)
|
|
DestroyObject(oCreate, fTime);
|
|
|
|
//west wall
|
|
vPos= GetPosition(oTarget);
|
|
vPos.x-=1.0;
|
|
lLoc= Location(GetArea(oTarget), vPos, DIRECTION_WEST);
|
|
oCreate= CreateObject(OBJECT_TYPE_PLACEABLE, sObj, lLoc);
|
|
if(fTime!=0.0)
|
|
DestroyObject(oCreate, fTime);
|
|
}
|
|
}
|