86 lines
1.9 KiB
Plaintext
86 lines
1.9 KiB
Plaintext
#include "cleanup"
|
|
|
|
/*void TrashObject(object oObject)
|
|
{
|
|
|
|
|
|
object oItem = GetFirstItemInInventory(oObject);
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
DestroyObject(oItem);
|
|
oItem = GetNextItemInInventory(oObject);
|
|
}
|
|
DestroyObject(oObject);
|
|
}
|
|
void CleanArea(object oPC)
|
|
{
|
|
int iObjectType;
|
|
object oObject = GetFirstObjectInArea(GetArea(oPC));
|
|
while (oObject != OBJECT_INVALID)
|
|
{
|
|
|
|
if(GetObjectType(oObject) == OBJECT_TYPE_PLACEABLE && GetTag(oObject) == "BodyBag")
|
|
|
|
{
|
|
if ((GetTag(oObject)!="starfall")&&(GetIsPC(oObject)==FALSE))
|
|
{
|
|
TrashObject(oObject);
|
|
}
|
|
}
|
|
oObject = GetNextObjectInArea(GetArea(oPC));
|
|
}
|
|
}
|
|
*/
|
|
void main()
|
|
{
|
|
|
|
object oPC = GetLastUsedBy();
|
|
object oMod = GetModule();
|
|
|
|
int nInt = GetLocalInt(oMod, "challenge");
|
|
int nInt2 = GetLocalInt(oMod, "duel_on");
|
|
int oProg = GetLocalInt(oMod, "in_progress");
|
|
int oChest = GetLocalInt(oMod, "chest_here");
|
|
int oGameMode = GetLocalInt(oMod, "gamemode");
|
|
if (oChest!=1)
|
|
{
|
|
if ((nInt!=1)&&(nInt2!=1)&&(oProg!=1))
|
|
{
|
|
AssignCommand(oPC, PlaySound("sce_positive"));
|
|
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
|
|
ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
|
|
DelayCommand(1.0, FloatingTextStringOnCreature("Area Cleaned", oPC));
|
|
CleanArea(oPC);
|
|
}
|
|
else
|
|
{
|
|
|
|
if (nInt2!=1)
|
|
{
|
|
PlaySound("sim_cntresist");
|
|
FloatingTextStringOnCreature("You can't use this during a super challenge.", oPC);
|
|
}
|
|
else
|
|
{
|
|
PlaySound("sim_cntresist");
|
|
FloatingTextStringOnCreature("You can't use this during a battle.", oPC);
|
|
}
|
|
|
|
}
|
|
}
|
|
else
|
|
{
|
|
PlaySound("sim_cntresist");
|
|
FloatingTextStringOnCreature("You can't clean the area until the reward chest has been looted.", oPC);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|