Aschbourne_PRC8/_module/nss/_uoa_fix_station.nss

88 lines
2.5 KiB
Plaintext
Raw Permalink Normal View History

2024-06-14 10:48:20 -04:00
void RepairStation(object oTarget, object oPC);
void main()
{
object oSelf = OBJECT_SELF;
object oPC = GetLocalObject(oSelf,"oActivator");
DeleteLocalObject(oSelf,"oActivator");
string sTagSelf = GetTag(oSelf);
int iAmStation;
if (GetObjectType(oSelf)==OBJECT_TYPE_PLACEABLE)
{
if (sTagSelf=="AlchemistsWorkbench") iAmStation=1;
if (sTagSelf=="OVEN_001") iAmStation=1;
if (sTagSelf=="BowyersStation") iAmStation=1;
if (sTagSelf=="OVEN_004") iAmStation=1;
if (sTagSelf=="OVEN_003") iAmStation=1;
if (sTagSelf=="DyeTub") iAmStation=1;
if (sTagSelf=="FletchingLathe") iAmStation=1;
if (sTagSelf=="GemcuttersTable") iAmStation=1;
if (sTagSelf=="GemstoneTumbler") iAmStation=1;
if (sTagSelf=="JewelcraftersWorkbench") iAmStation=1;
if (sTagSelf=="SmeltingKiln") iAmStation=1;
if (sTagSelf=="LeatherworkingTable") iAmStation=1;
if (sTagSelf=="MineralBath") iAmStation=1;
if (sTagSelf=="ScribesDesk") iAmStation=1;
if (sTagSelf=="SmeltingForge") iAmStation=1;
if (sTagSelf=="SpinningWheel") iAmStation=1;
if (sTagSelf=="TailorsDesk") iAmStation=1;
if (sTagSelf=="DRESSFORM_TAILOR") iAmStation=1;
if (sTagSelf=="TanningBath") iAmStation=1;
if (sTagSelf=="TanningOven") iAmStation=1;
if (sTagSelf=="TinkersWorkbench") iAmStation=1;
if (sTagSelf=="WoodPulpBasin") iAmStation=1;
if (sTagSelf=="WoodPulpDigester") iAmStation=1;
if (sTagSelf=="PaperMill") iAmStation=1;
if (sTagSelf=="DRESSFORM_TAILOR") iAmStation=1;
if (sTagSelf=="DRESSFORM_TAILOR") iAmStation=1;
if (sTagSelf=="CarpentersWorkbench") iAmStation=1;
}
if (iAmStation==1)
{
AssignCommand(oSelf,DelayCommand(30.0,RepairStation(oSelf, oPC)));
}
else
{
SendMessageToPC(oPC,"This is not a UOACraft Craftable Station!");
}
}
void RepairStation(object oTarget, object oPC)
{
int iAmTooClose;
object oArea1;
object oArea2 = GetArea(oTarget);
object oPC2 = GetFirstPC();
while (oPC2 != OBJECT_INVALID)
{
oArea1 = GetArea(oPC2);
if (oArea1 == oArea2)
{
if (oPC2 != oPC)
{
if (GetDistanceBetween(oTarget,oPC2)<10.0) iAmTooClose=1;
}
}
oPC2 = GetNextPC();
if (oPC2==OBJECT_INVALID) break;
}
if (iAmTooClose==0)
{
AssignCommand(oTarget,ActionSpeakString("Crafting Station repair underway.. please wait.",TALKVOLUME_TALK));
AssignCommand(oTarget,DelayCommand(1.0,ExecuteScript("_onclose_clear",oTarget)));
}
return;
}