34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
//69_hench_destroyobject
|
|
//Created By: 69MEH69 MAR2005
|
|
#include "69_inc_henai"
|
|
|
|
void main()
|
|
{
|
|
object oMaster = GetMaster();
|
|
ClearAllActions();
|
|
SetAssociateState(NW_ASC_IS_BUSY);
|
|
int bFound = FALSE;
|
|
string sName;
|
|
location lCenter = GetLocation(OBJECT_SELF);
|
|
object oThing = GetFirstObjectInShape(SHAPE_SPHERE,15.0,lCenter,TRUE,OBJECT_TYPE_PLACEABLE);
|
|
while(GetIsObjectValid(oThing))
|
|
{
|
|
if((GetPlotFlag(oThing) == FALSE) && (GetUseableFlag(oThing) == TRUE))
|
|
{
|
|
bFound = TRUE;
|
|
ActionEquipMostDamagingMelee(oThing);
|
|
ActionAttack(oThing);
|
|
}
|
|
oThing = GetNextObjectInShape(SHAPE_SPHERE,15.0,lCenter,TRUE,OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_ITEM);
|
|
} // while(GetIsObjectValid(oThing))
|
|
ActionDoCommand(SetAssociateState(NW_ASC_IS_BUSY,FALSE));
|
|
if(HasRangedWeapon69(OBJECT_SELF) && GetCombatCondition(X0_COMBAT_FLAG_RANGED) == TRUE)
|
|
{
|
|
bkEquipRanged(oMaster);
|
|
}
|
|
if(!bFound)
|
|
SpeakString("I don't see anything to destroy around here.");
|
|
}
|
|
|
|
|