mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
31 lines
664 B
Plaintext
31 lines
664 B
Plaintext
include library.player_structure;
|
|
include library.tcg;
|
|
include library.utils;
|
|
|
|
trigger OnAttach()
|
|
{
|
|
checkStructureForRanchHandScript(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
checkStructureForRanchHandScript(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
boolean checkStructureForRanchHandScript(obj_id self)
|
|
{
|
|
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;
|
|
} |