mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-14 23:07:51 -04:00
40 lines
1.1 KiB
Java
Executable File
40 lines
1.1 KiB
Java
Executable File
package script.systems.tcg;
|
|
|
|
import script.library.tcg;
|
|
import script.obj_id;
|
|
|
|
public class barn_structure extends script.base_script
|
|
{
|
|
public barn_structure()
|
|
{
|
|
}
|
|
public int OnAttach(obj_id self) throws InterruptedException
|
|
{
|
|
checkStructureForRanchHandScript(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
checkStructureForRanchHandScript(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public boolean checkStructureForRanchHandScript(obj_id self) throws InterruptedException
|
|
{
|
|
if (!isValidId(self) || !exists(self))
|
|
{
|
|
return false;
|
|
}
|
|
obj_id cellId = getCellId(self, tcg.CELL_NAME);
|
|
if (!isValidId(cellId) || !exists(cellId))
|
|
{
|
|
return false;
|
|
}
|
|
if (hasObjVar(cellId, tcg.RANCHHAND_CELLCHECK) && !hasScript(cellId, tcg.RANCHHAND_CELL_SCRIPT))
|
|
{
|
|
return false;
|
|
}
|
|
attachScript(cellId, tcg.RANCHHAND_CELL_SCRIPT);
|
|
return true;
|
|
}
|
|
}
|