begin script ScaffoldDragSelection(ThisScaffold)
DistHandToScaffold = 0
TargetPosScaffoldFromHand = 0
NextScaffoldCivic = 0
NextScaffoldHouse = 0
PlannedScaffold = 0
oTown = get town with id 0
HouseCivicVisual = 0
start
HouseCivicVisual = create visual effect VISUAL_MIRACLE_TORNADO_GROUND on ThisScaffold time -1
SCALE of ThisScaffold = 1.00
SCALE of HouseCivicVisual = 0.20
override mesh for ThisScaffold with "m_greekabode_a"
enable ThisScaffold indestructible
begin loop
if not key KB_LSHIFT down
if hand position not near {ThisScaffold} radius 5.00 and NextScaffoldHouse == 0 and bindable action BINDABLE_ACTION_TYPE_ACTION performed
SCALE of ThisScaffold = 1.00
SCALE of HouseCivicVisual = 0.20
override mesh for ThisScaffold with "m_greekabode_a"
NextScaffoldHouse += 1
wait 0.5 seconds
end if
if hand position not near {ThisScaffold} radius 5.00 and NextScaffoldHouse == 1 and bindable action BINDABLE_ACTION_TYPE_ACTION performed
SCALE of ThisScaffold = 1.00
override mesh for ThisScaffold with "m_greekabode_b"
NextScaffoldHouse += 1
wait 0.5 seconds
end if
if hand position not near {ThisScaffold} radius 5.00 and NextScaffoldHouse == 2 and bindable action BINDABLE_ACTION_TYPE_ACTION performed
SCALE of ThisScaffold = 1.00
override mesh for ThisScaffold with "m_greekabode_c"
NextScaffoldHouse += 1
wait 0.5 seconds
end if
if hand position not near {ThisScaffold} radius 5.00 and NextScaffoldHouse == 3 and bindable action BINDABLE_ACTION_TYPE_ACTION performed
SCALE of ThisScaffold = 1.00
override mesh for ThisScaffold with "m_greekabode_d"
NextScaffoldHouse += 1
wait 0.5 seconds
end if
if hand position not near {ThisScaffold} radius 5.00 and NextScaffoldHouse == 4 and bindable action BINDABLE_ACTION_TYPE_ACTION performed
SCALE of ThisScaffold = 1.00
SCALE of HouseCivicVisual = 0.30
override mesh for ThisScaffold with "m_greekabode_e"
NextScaffoldHouse += 1
wait 0.5 seconds
end if
if NextScaffoldHouse > 4
NextScaffoldHouse = 0
end if
end if
if key KB_LSHIFT down
if hand position not near {ThisScaffold} radius 5.00 and NextScaffoldCivic == 0 and bindable action BINDABLE_ACTION_TYPE_ACTION performed
SCALE of ThisScaffold = 1.00
SCALE of HouseCivicVisual = 0.55
override mesh for ThisScaffold with "m_greekstoragepit"
NextScaffoldCivic = 1
wait 0.5 seconds
end if
if hand position not near {ThisScaffold} radius 5.00 and NextScaffoldCivic == 1 and bindable action BINDABLE_ACTION_TYPE_ACTION performed
SCALE of ThisScaffold = 1.00
SCALE of HouseCivicVisual = 0.60
override mesh for ThisScaffold with "m_greekaltar"
NextScaffoldCivic = 2
wait 0.5 seconds
end if
if hand position not near {ThisScaffold} radius 5.00 and NextScaffoldCivic == 2 and bindable action BINDABLE_ACTION_TYPE_ACTION performed
SCALE of ThisScaffold = 1.00
SCALE of HouseCivicVisual = 0.45
override mesh for ThisScaffold with "m_greekbathhouse"
NextScaffoldCivic = 3
wait 0.5 seconds
end if
if hand position not near {ThisScaffold} radius 5.00 and NextScaffoldCivic == 3 and bindable action BINDABLE_ACTION_TYPE_ACTION performed
SCALE of ThisScaffold = 1.00
SCALE of HouseCivicVisual = 0.35
override mesh for ThisScaffold with "m_greekgranary"
NextScaffoldCivic = 0
wait 0.5 seconds
end if
end if
if ThisScaffold != get object held
if ThisScaffold == get object left clicked or ThisScaffold == get object right clicked
stop visual effect HouseCivicVisual
stop script "ScaffoldRotation"
clear left clicked object
clear right clicked object
wait 0.5 seconds
run background script ScaffoldSize(ThisScaffold, NextScaffoldHouse, NextScaffoldCivic)
wait 3 seconds
end if
end if
end loop
end script ScaffoldDragSelection